Search found 26 matches

by Mravko
13 Jun 2019, 14:39
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Hi again,

There seems to be at least two areas in the platform that are competing for the hardware serial interrupt.
1. Serial.ino
2. _p165_SerSwitch.ino

both of them are evaluating "while (Serial.available())".

I'm not sure how that is resolved but I suspect Serial.ino has precedence?
by Mravko
08 May 2019, 16:03
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Hi enesbcs, I've been thinking... Looking at the code, it seems that in the Read function only ever processes the first 12 or 15 bytes. I don't see that it increments. First check: if (bytes_read == 0) { // packet start --> check if byte 0 is "0x55" Second check: if (bytes_read == 1) { // ...
by Mravko
07 May 2019, 08:17
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Hi enesbcs, Ok, so I've done some major debugging of the plugin and here are my findings: Everything in the plugin works great except the reading of the tuya MCU. rationale: First I have to add a delay to the reading. The plugin will eventually read all four lines. It may take up to 20 minutes for i...
by Mravko
07 May 2019, 07:40
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Debug: - Enable serial port usage, but disable serial logging, also disable all plugin (P165) and device that using serial pins. - Setup "Communication - Serial Server" plugin for debugging (port 23, baud 9600, 8n1) https://www.letscontrolit.com/wiki/index.php/Ser2Net - install Realterm t...
by Mravko
04 May 2019, 07:33
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

1. looking into the following code: line 681: I'm interested in the byte "btnnum". What's confusing is this line "Serial.write( (btnnum + 1) ); // relay number 1,2,3" Are we adding "+ 1" because btnnum = 01 for the first relay? Yes the Tuya addresses buttons from 1, th...
by Mravko
03 May 2019, 09:11
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

If I select 0, it doesn't parse anything from the MCU. I may get 1 set of four log entries, every 1-2 minutes It is very sad. My old Tuya unit reports its state on its own when any status is changed on it without any periodic check. If it is true, than i will never buy Tuya switches again. Sonoff a...
by Mravko
03 May 2019, 09:07
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

So two things: 1. looking into the following code: line 681: void sendmcucommand(byte btnnum, byte state, byte swtype, byte btnum_mode) // btnnum=0,1,2, state=0/1 { byte sstate; switch (swtype) { case SER_SWITCH_YEWE: { Serial.write(0x55); // Tuya header 55AA Serial.write(0xAA); Serial.write(0x00); ...
by Mravko
02 May 2019, 07:24
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

I've loaded this version up and after introducing a 5 sec interval I got a somewhat cleaner output: And what if you set 0 sec intervals? I'm wondering..., when reading the States of the input, is there a way to discard everything before the 100ms delay? As the MCU sends the whole lot, at ~5 second ...
by Mravko
01 May 2019, 17:18
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

3. When I switch them all off, the first two switches report off but switch 3 and 4 report staying on (Not so good) Screen Shot 2019-05-01 at 1.32.32 pm.png My thoughts: I'm wondering if it has anything to do with the way the device sends an update (~ every 10 seconds)? and the way that plugin deal...
by Mravko
01 May 2019, 16:22
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

1. Start of message - Wait for a gap longer than say 100ms and then start grabbing the data. 2. End of message - Payload is complete when there is no more data for 100ms. I see no reason for waiting anything, neither checking the message end. To know where is the package end, you have to check and ...
by Mravko
01 May 2019, 12:55
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Another problem I have now is I'm unable to do an OTA upload on a 1M chip as the code exceeded 600ish kb.

I have to cut the RX track, solder the wires, upload the firmware via USB, un-solder the wires, place the RX track back and so on. :(
by Mravko
01 May 2019, 12:52
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

3. When I switch them all off, the first two switches report off but switch 3 and 4 report staying on (Not so good) Screen Shot 2019-05-01 at 1.32.32 pm.png My thoughts: I'm wondering if it has anything to do with the way the device sends an update (~ every 10 seconds)? and the way that plugin deal...
by Mravko
01 May 2019, 05:57
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Hi enesbcs, Ok we are nearly there. One more issue. 1. When the switch has been power-cycled it reports all 4 switches off: (Good) Screen Shot 2019-05-01 at 1.30.02 pm.png 2. When I toggle all four switches, it reports all 4 switches are on: (Good) Screen Shot 2019-05-01 at 1.39.59 pm.png Screen Sho...
by Mravko
01 May 2019, 00:23
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

One step further and here is what I have: 55AA 01 07 05 01 01 00 01 00 0F /Switch OFF 55AA 01 07 05 02 01 00 01 00 10 /Switch OFF 55AA 01 07 05 03 01 00 01 00 11 /Switch OFF 55AA 01 07 05 04 01 00 01 00 12 /Switch OFF 55AA 01 07 05 01 01 00 01 01 10 /Switch ON* 55AA 01 07 05 02 01 00 01 00 10 /Swit...
by Mravko
30 Apr 2019, 11:33
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Looking into the plug-in code I've noticed two things: 1. There might be a typo and a case missing: from line 390: log = F("SerSW : State "); if (Plugin_165_ostate[0] != Plugin_165_switchstate[0]) { UserVar[event->BaseVarIndex] = Plugin_165_switchstate[0]; log += F(" r0:"); log +...
by Mravko
30 Apr 2019, 06:56
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

However: The log shows the same thing. With all four switches are "on" the output is: SerSW : Dimmer 364670: EVENT: MCU#Relay0=1.00 364674: EVENT: MCU#Relay1=1.00 364676: EVENT: MCU#Relay2=1.00 364679: EVENT: MCU#Relay3=0.00 error: So he fourth relay is not reporting that it is on and wit...
by Mravko
29 Apr 2019, 10:29
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Have you developed this in PlatformIO or Arduino IDE?

If PlatformIO, provide the source in a zip, if you like.
I''ll give it a go myself and post the results.

Mravko...
by Mravko
29 Apr 2019, 10:20
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Added 4th button for TUYA. I've compiled for core240 (this core proved itself working earlier), core241 (may work), core242 (may not work) with the last ESPEasy sources with untouched serial code. (20181231) 4M and 1M builds and 1M/PUYA builds also included. Thanks heaps! I'll let you know how it g...
by Mravko
29 Apr 2019, 09:14
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Added 4th button for TUYA. I've compiled for core240 (this core proved itself working earlier), core241 (may work), core242 (may not work) with the last ESPEasy sources with untouched serial code. (20181231) 4M and 1M builds and 1M/PUYA builds also included. Thanks heaps! I'll let you know how it g...
by Mravko
28 Apr 2019, 16:38
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

So here is the 4 gang wall switch 4ch - back.jpg the switches have a controller board and a relay board, as well as the current sensors. I guess the current sensors are not that important (it's more of a nice-to-have), especially for the GPOs. But if it isnt too much trouble, may I ask for a versio...
by Mravko
28 Apr 2019, 14:54
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Oh and one more thing... The Tuya only has 1 relay and 3 (or 1 + 2 dimmer) My tuya switches hav 1, 2, 3 and 4 relays. I am unable to select 4 relays in the Yewelink/TUYA type How hard is it to add the 4 relays to the TUYA switch type drop-down? I've never seen a Tuya device with more than 3 buttons...
by Mravko
28 Apr 2019, 07:03
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Oh and one more thing...
The Tuya only has 1 relay and 3 (or 1 + 2 dimmer)

My tuya switches hav 1, 2, 3 and 4 relays.

I am unable to select 4 relays in the Yewelink/TUYA type

How hard is it to add the 4 relays to the TUYA switch type drop-down?
by Mravko
26 Apr 2019, 12:18
Forum: ESP Easy: Software
Topic: Serial MCU controlled relay/switch
Replies: 459
Views: 959921

Re: Serial MCU controlled relay/switch

Hi there, I have yet another Tuya-based family of Wi-Fi switches and power outlet devices that are also controlled by the MCU and serail comms to the TYWE3S Wi-Fi module. I'm guessing this plug-in will work fine. I have noticed, however, that both the switches (1, 2, 3 and 4 Gang) as well as the Pow...
by Mravko
21 Feb 2019, 00:12
Forum: ESP Easy: Software
Topic: (Solved) MQTT (OpenHAB, HA and any standard) cannot control Virtual GPIO's (PCF8574)?
Replies: 4
Views: 4838

Re: (Solved) OpenHAB MQTT cannot control Virtual GPIO's (PCF8574)?

I have a suggestion: I believe this is simple to be solved for good... I'm not so good at programing at all but I conceptually know what needs to be done. In "_P019_PCF8574.ino" you need to add a function that will take a command from the "%sysname%/%tskname%/%valname%" and the p...
by Mravko
20 Feb 2019, 08:53
Forum: ESP Easy: Software
Topic: (Solved) MQTT (OpenHAB, HA and any standard) cannot control Virtual GPIO's (PCF8574)?
Replies: 4
Views: 4838

Re: (Solved) OpenHAB MQTT cannot control Virtual GPIO's (PCF8574)?

Well, partially solved... I have a workaround that works well (almost a proper solution). Looking into the Switch input - PCF8574 .ino file I realised that it wasn't listening for the right message coming from MQTT, so I experimented with it and found the right syntax. this is the configuration (in ...
by Mravko
18 Feb 2019, 09:25
Forum: ESP Easy: Software
Topic: (Solved) MQTT (OpenHAB, HA and any standard) cannot control Virtual GPIO's (PCF8574)?
Replies: 4
Views: 4838

(Solved) MQTT (OpenHAB, HA and any standard) cannot control Virtual GPIO's (PCF8574)?

Hi all, Long time follower, first time writer. To cut to the chase, I have hit a road block. I am able to publish a (OpenHAB MQTT) state change for a GPIO pin (e.g.13) and the ESPEasy will react with the state change and send back the state. The logs also confirm that there is a SW: change and (if y...