From 182768ee1156dd446262830cafb29de987d3bda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bub=C3=ADk?= Date: Sat, 22 May 2021 17:09:10 +0200 Subject: [PATCH 1/4] Add codes for manufactirer ACER (yet untested) --- tasmota/xdrv_53_projector_ctrl.h | 26 ++++++++++++++++++++++++++ tasmota/xdrv_53_projector_ctrl.ino | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_53_projector_ctrl.h b/tasmota/xdrv_53_projector_ctrl.h index 4aca0d12bcc6..4c4eed62e9c0 100644 --- a/tasmota/xdrv_53_projector_ctrl.h +++ b/tasmota/xdrv_53_projector_ctrl.h @@ -65,6 +65,32 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { #define PROJECTOR_CTRL_QRYPWR_WARMING 0x31 //placebo +#elif defined(USE_PROJECTOR_CTRL_ACER) +/* see the serial codes in + * http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687 + * not really tested with ACER devices + */ +#define PROJECTOR_CTRL_LOGNAME "DLP[ACER]" +static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 +static const uint8_t projector_ctrl_msg_qry_pwr[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //line97 +static const uint8_t projector_ctrl_msg_pwr_on[] = { '*',' ','0',' ','I','R',' ','0','0','1', 0x0d }; //line18 +static const uint8_t projector_ctrl_msg_pwr_off[] = { '*',' ','0',' ','I','R',' ','0','0','2', 0x0d }; //line19 +static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { + {PROJECTOR_CTRL_S_QRY_TYPE, &projector_ctrl_msg_qry_typ[0], sizeof(projector_ctrl_msg_qry_typ), + PROJECTOR_CTRL_SERIAL_TIMEOUT, 'M', 10, 6, 4, '?', 1, 0, 1}, + {PROJECTOR_CTRL_S_QRY_PWR, &projector_ctrl_msg_qry_pwr[0], sizeof(projector_ctrl_msg_qry_pwr), + PROJECTOR_CTRL_SERIAL_TIMEOUT, 'L', 7, 5, 1, '?', 1, 0, 1}, + {PROJECTOR_CTRL_S_PWR_ON, &projector_ctrl_msg_pwr_on[0], sizeof(projector_ctrl_msg_pwr_on), + PROJECTOR_CTRL_SERIAL_TIMEOUT, 'O', 2, 0, 1, '?', 1, 0, 1}, + {PROJECTOR_CTRL_S_PWR_OFF, &projector_ctrl_msg_pwr_off[0], sizeof(projector_ctrl_msg_pwr_off), + PROJECTOR_CTRL_SERIAL_TIMEOUT, 'O', 2, 0, 1, '?', 1, 0, 1} +}; +#define PROJECTOR_CTRL_QRYPWR_ON '1' +#define PROJECTOR_CTRL_QRYPWR_COOLING '1' //placebo +#define PROJECTOR_CTRL_QRYPWR_STARTING '1' //placebo +#define PROJECTOR_CTRL_QRYPWR_WARMING '1' //placebo + + #else #error USE_PROJECTOR_CTRL: No projector type defined #endif diff --git a/tasmota/xdrv_53_projector_ctrl.ino b/tasmota/xdrv_53_projector_ctrl.ino index 4c8142d7abb7..70ca4d6c32c8 100644 --- a/tasmota/xdrv_53_projector_ctrl.ino +++ b/tasmota/xdrv_53_projector_ctrl.ino @@ -23,11 +23,12 @@ * LCD/DLP Projector Control via serial interface * https://www.sharpnecdisplays.eu/p/download/v/5e14a015e26cacae3ae64a422f7f8af4/cp/Products/Projectors/Shared/CommandLists/PDF-ExternalControlManual-english.pdf#page=5 * https://www.optoma.co.uk/uploads/manuals/hd36-m-en-gb.pdf#page=56 + * http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687 \*********************************************************************************************/ #define XDRV_53 53 -#if !defined(USE_PROJECTOR_CTRL_NEC) && !defined(USE_PROJECTOR_CTRL_OPTOMA) +#if !defined(USE_PROJECTOR_CTRL_NEC) && !defined(USE_PROJECTOR_CTRL_OPTOMA) && !defined(USE_PROJECTOR_CTRL_ACER) #define USE_PROJECTOR_CTRL_NEC // Use at least one projector #endif From 918de7a166c142885cb0d1b7b58e9abf30365528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bub=C3=ADk?= Date: Tue, 25 May 2021 00:53:03 +0200 Subject: [PATCH 2/4] ACER protocol made functional on real device --- tasmota/xdrv_53_projector_ctrl.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tasmota/xdrv_53_projector_ctrl.h b/tasmota/xdrv_53_projector_ctrl.h index 4c4eed62e9c0..ea010b5c59ca 100644 --- a/tasmota/xdrv_53_projector_ctrl.h +++ b/tasmota/xdrv_53_projector_ctrl.h @@ -68,22 +68,23 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { #elif defined(USE_PROJECTOR_CTRL_ACER) /* see the serial codes in * http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687 - * not really tested with ACER devices + * tested with ACER P1500 */ #define PROJECTOR_CTRL_LOGNAME "DLP[ACER]" -static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 -static const uint8_t projector_ctrl_msg_qry_pwr[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //line97 -static const uint8_t projector_ctrl_msg_pwr_on[] = { '*',' ','0',' ','I','R',' ','0','0','1', 0x0d }; //line18 -static const uint8_t projector_ctrl_msg_pwr_off[] = { '*',' ','0',' ','I','R',' ','0','0','2', 0x0d }; //line19 +//static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 - responds *000\rModel Model P1500E\r [fails in OFF mode] +static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //cannot query typ, so query Lamp status instead +static const uint8_t projector_ctrl_msg_qry_pwr[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //line97 - responds *000\rLamp 0\r +static const uint8_t projector_ctrl_msg_pwr_on[] = { '*',' ','0',' ','I','R',' ','0','0','1', 0x0d }; //line18 - responds *000\r +static const uint8_t projector_ctrl_msg_pwr_off[] = { '*',' ','0',' ','I','R',' ','0','0','2', 0x0d }; //line19 - responds *000\r static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { {PROJECTOR_CTRL_S_QRY_TYPE, &projector_ctrl_msg_qry_typ[0], sizeof(projector_ctrl_msg_qry_typ), - PROJECTOR_CTRL_SERIAL_TIMEOUT, 'M', 10, 6, 4, '?', 1, 0, 1}, + PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 12, 10, 1, '?', 1, 0, 1}, {PROJECTOR_CTRL_S_QRY_PWR, &projector_ctrl_msg_qry_pwr[0], sizeof(projector_ctrl_msg_qry_pwr), - PROJECTOR_CTRL_SERIAL_TIMEOUT, 'L', 7, 5, 1, '?', 1, 0, 1}, + PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 12, 10, 1, '?', 1, 0, 1}, {PROJECTOR_CTRL_S_PWR_ON, &projector_ctrl_msg_pwr_on[0], sizeof(projector_ctrl_msg_pwr_on), - PROJECTOR_CTRL_SERIAL_TIMEOUT, 'O', 2, 0, 1, '?', 1, 0, 1}, + PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 5, 0, 1, '?', 1, 0, 1}, {PROJECTOR_CTRL_S_PWR_OFF, &projector_ctrl_msg_pwr_off[0], sizeof(projector_ctrl_msg_pwr_off), - PROJECTOR_CTRL_SERIAL_TIMEOUT, 'O', 2, 0, 1, '?', 1, 0, 1} + PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 5, 0, 1, '?', 1, 0, 1} }; #define PROJECTOR_CTRL_QRYPWR_ON '1' #define PROJECTOR_CTRL_QRYPWR_COOLING '1' //placebo From 82468f9168dc393d34d11639a60328bd29f369fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bub=C3=ADk?= Date: Tue, 25 May 2021 18:14:36 +0200 Subject: [PATCH 3/4] ACER protocol - additional notes --- tasmota/xdrv_53_projector_ctrl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_53_projector_ctrl.h b/tasmota/xdrv_53_projector_ctrl.h index ea010b5c59ca..50733734ec21 100644 --- a/tasmota/xdrv_53_projector_ctrl.h +++ b/tasmota/xdrv_53_projector_ctrl.h @@ -69,10 +69,12 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { /* see the serial codes in * http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687 * tested with ACER P1500 + * every command is first acknowledged by "*000\r" (success) or "*001\r" (failure) followed by an optional response + * most commands fail in stand-by mode */ #define PROJECTOR_CTRL_LOGNAME "DLP[ACER]" -//static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 - responds *000\rModel Model P1500E\r [fails in OFF mode] -static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //cannot query typ, so query Lamp status instead +//static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 - responds *000\rModel Model P1500E\r [fails in stand-by mode] +static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //cannot query type, so query Lamp status instead static const uint8_t projector_ctrl_msg_qry_pwr[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //line97 - responds *000\rLamp 0\r static const uint8_t projector_ctrl_msg_pwr_on[] = { '*',' ','0',' ','I','R',' ','0','0','1', 0x0d }; //line18 - responds *000\r static const uint8_t projector_ctrl_msg_pwr_off[] = { '*',' ','0',' ','I','R',' ','0','0','2', 0x0d }; //line19 - responds *000\r From 5cdafaa46ab25c3d9baeb98459d986cb9b18327c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bub=C3=ADk?= Date: Tue, 25 May 2021 18:39:08 +0200 Subject: [PATCH 4/4] ACER - don't log the checksum, it is for NEC only --- tasmota/xdrv_53_projector_ctrl.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_53_projector_ctrl.ino b/tasmota/xdrv_53_projector_ctrl.ino index 70ca4d6c32c8..40c8d4a9ff69 100644 --- a/tasmota/xdrv_53_projector_ctrl.ino +++ b/tasmota/xdrv_53_projector_ctrl.ino @@ -154,12 +154,18 @@ projector_ctrl_write(struct projector_ctrl_softc_s *sc, const uint8_t *bytes, co } #ifdef USE_PROJECTOR_CTRL_NEC serial->write(cksum); -#endif #ifdef DEBUG_PROJECTOR_CTRL char hex_b[(len + 1) * 2]; AddLog_P(LOG_LEVEL_DEBUG,PSTR(PROJECTOR_CTRL_LOGNAME ": RAW bytes %s %02x"), ToHex_P((uint8_t *)bytes, len, hex_b, sizeof(hex_b)), cksum); #endif //DEBUG_PROJECTOR_CTRL +#else //!USE_PROJECTOR_CTRL_NEC +#ifdef DEBUG_PROJECTOR_CTRL + char hex_b[(len + 1) * 2]; + AddLog_P(LOG_LEVEL_DEBUG,PSTR(PROJECTOR_CTRL_LOGNAME ": RAW bytes %s"), + ToHex_P((uint8_t *)bytes, len, hex_b, sizeof(hex_b))); +#endif //DEBUG_PROJECTOR_CTRL +#endif //!USE_PROJECTOR_CTRL_NEC serial->flush(); return;