Serial MCU controlled relay/switch

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Serial MCU controlled relay/switch

#401 Post by Micha_he » 02 Sep 2020, 08:06

But you must new configure your device! The plugin get a other number...

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#402 Post by fresnoboy » 02 Sep 2020, 08:42

Micha_he wrote: 02 Sep 2020, 08:06 But you must new configure your device! The plugin get a other number...
I know, it resets and should be broadcasting on a new SSID right, just like it was when it was initialized the first time? I don't see any wifi signal coming from it...

thx!

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Serial MCU controlled relay/switch

#403 Post by Micha_he » 02 Sep 2020, 11:28

No. If you didn't factory-reset your ESP before new flashing, it didn't loose the config. It starts with the last config.

Or flash a blank (with the suitable size of the ESP-flash) image before the new one, to clean it.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#404 Post by fresnoboy » 02 Sep 2020, 20:10

Ok, I flashed it with the PUYA image that I had used before, and the module came up fine. I configured it to talk to the wifi network, and all was well. The I tried to flash the newer ESP_Easy_mega_20200029 4M1M images, but none of them would come up and work. No contact on the wifi network, and no blue blinks as is normally seen on the PUYA image.

I used the test and custom loads, (all 4M1M .bin's) and no go. So I am clearly doing something wrong, as this isn't even getting the core functionality to work. It's still in the programmer connected to USB power (but flipped back to the UART position after programming), and I can't even connect to it via WiFi.

Any ideas?

thx
mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#405 Post by TD-er » 02 Sep 2020, 21:42

If you had a PUYA build working, then you had 1M build?
PUYA chips only were in 1M flash sizes, as far as I know at least.

So make sure you have a build for the right flash size.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#406 Post by fresnoboy » 02 Sep 2020, 23:02

TD-er wrote: 02 Sep 2020, 21:42 If you had a PUYA build working, then you had 1M build?
PUYA chips only were in 1M flash sizes, as far as I know at least.

So make sure you have a build for the right flash size.
That was the problem, I needed to use the 1M image. However, when loading that version, I don't see any option for a serial controlled switch in the device types. This is with: ESP_Easy_mega_20200829_normal_ESP8266_1M.bin

There don't appear to be any "test" builds that are 1M in size, at least for the latest pre-release version. This is why I asked the question in the first place about which load works on the LC Tech switch 8266 and has the serial port switch compiled in.

Is there another place to get downloads than the github repository that would have an updated 1M build with the serial switch support compiled in?

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Serial MCU controlled relay/switch

#407 Post by Micha_he » 02 Sep 2020, 23:11

Same here with 'ESP_Easy_mega_20200829_normal_ESP8266_1M_VCC.bin'. No 'Serial MCU controled switch' available !

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#408 Post by TD-er » 02 Sep 2020, 23:13

It is indeed labeled "testing" so only appears on the "test" builds.

I can make a separate build definition for this one.
If you're using it on a 1M unit, then you probably also don't have lots of other plugins needed, right?

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Serial MCU controlled relay/switch

#409 Post by Micha_he » 02 Sep 2020, 23:25

I need it on my MOES WIFI Dimmer with 1MB Flash.

I use only:

- openHAB MQTT
- Serial MCU controlled switch
- Switch input

Maybe 'Generic dummy device' is a good idea... But I'm not currently using it.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#410 Post by TD-er » 02 Sep 2020, 23:37

Can you make an issue for it, or else I may forget about it tomorrow.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#411 Post by fresnoboy » 03 Sep 2020, 00:13

TD-er wrote: 02 Sep 2020, 23:13 It is indeed labeled "testing" so only appears on the "test" builds.

I can make a separate build definition for this one.
If you're using it on a 1M unit, then you probably also don't have lots of other plugins needed, right?
Right, this is for the LC Tech switches in this thread, so not a lot of other stuff in terms of devices for me and I suspect people in this thread.

thx
mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#412 Post by TD-er » 03 Sep 2020, 08:59

So somtheing like this should be OK:

Code: Select all

    "CONTROLLER_SET_ALL",
    "NOTIFIER_SET_NONE",
    "PLUGIN_SET_ONLY_SWITCH",
    "USES_P001",  # Switch
    "USES_P026",  # Sysinfo
    "USES_P029",  # Domoticz MQTT Helper
    "USES_P033",  # Dummy
    "USES_P037",  # MQTT import
    "USES_P081",  # Cron
    "USES_P091",  # SerSwitch


fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#414 Post by fresnoboy » 03 Sep 2020, 23:15

TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...

thx!
mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#415 Post by TD-er » 03 Sep 2020, 23:36

fresnoboy wrote: 03 Sep 2020, 23:15
TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...

thx!
mike
Have you tested the test build I made?

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#416 Post by fresnoboy » 04 Sep 2020, 00:04

TD-er wrote: 03 Sep 2020, 23:36
fresnoboy wrote: 03 Sep 2020, 23:15
TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...

thx!
mike
Have you tested the test build I made?
Yes indeed. I flashed it fine and it booted and ran on the esp8266, and picked up the config from the last flash I had done on it. It seems to find the hardware, though the code for the serial controlled switch seems different than what is in the PUYA version, which has a field for the # of relays in the device as opposed too assuming 4. Based on the switch used, this should work fine, though it will report more relays up to MQTT than actually exist.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#417 Post by TD-er » 04 Sep 2020, 17:51

So this is a bug?
What should it do and what do you now see on MQTT?
Would be nice to see MQTT output.
And also if it really is a bug, it would be great to have it on Github (not on the forum, as it hard to find later)

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#418 Post by fresnoboy » 04 Sep 2020, 23:45

TD-er wrote: 04 Sep 2020, 17:51 So this is a bug?
What should it do and what do you now see on MQTT?
Would be nice to see MQTT output.
And also if it really is a bug, it would be great to have it on Github (not on the forum, as it hard to find later)
Sorry for not being clear, the build didn't have the Openhab MQTT agent in it which is what I normally use and have a working config for.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#419 Post by TD-er » 05 Sep 2020, 14:27

Not any controller?

Can you try this one? https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
It has the stable controllers included.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#420 Post by fresnoboy » 05 Sep 2020, 20:50

TD-er wrote: 05 Sep 2020, 14:27 Not any controller?

Can you try this one? https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
It has the stable controllers included.
It still doesn't have the Openhab MQTT controller in it as the original PUYA one in this thread did, but I figured out how to get the Domoticz MQTT to work with my broker so at least for me, it seems to be a good replacement.

I'll test it over the next few days and see if its more reliable.

Will this be one of the standard github builds going forward?

thx
mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#421 Post by TD-er » 06 Sep 2020, 11:44

What controller do you need then?
It should include these:

Code: Select all

#ifdef CONTROLLER_SET_STABLE
    #define USES_C001   // Domoticz HTTP
    #define USES_C002   // Domoticz MQTT
    #define USES_C003   // Nodo telnet
    #define USES_C004   // ThingSpeak
    #define USES_C005   // Home Assistant (openHAB) MQTT
    #define USES_C006   // PiDome MQTT
    #define USES_C007   // Emoncms
    #define USES_C008   // Generic HTTP
    #define USES_C009   // FHEM HTTP
    #define USES_C010   // Generic UDP
    #define USES_C013   // ESPEasy P2P network
#endif

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#422 Post by fresnoboy » 06 Sep 2020, 18:24

USES_C005 is the one I was referring to... Would be great if that were included.

Thx
Mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#423 Post by TD-er » 06 Sep 2020, 21:48

It should be included in the last test build I linked : https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
But since the build size hardly differs from the one I made before, I think it must also be included in the one before.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#424 Post by fresnoboy » 06 Sep 2020, 22:22

TD-er wrote: 06 Sep 2020, 21:48 It should be included in the last test build I linked : https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
But since the build size hardly differs from the one I made before, I think it must also be included in the one before.
TD-er, I am very sure that build only has:

Standalone
Domoticz HTTP
Domoticz HQTT
Generic HTTP
ESPEasy P2P Networking

At least thats the only thing I see when I go to controllers and select the protocol menu option.

thx
mike

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#425 Post by fresnoboy » 06 Sep 2020, 22:26

PS I also don't see an option in this build for a log ("Open log output") in the tools page. The realtime updating log is pretty handy for debugging things. Did it move to a different place in the newer builds?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#426 Post by TD-er » 06 Sep 2020, 22:28

No, that's probably got something to do with me selecting the "OTA" definition to make a smaller build.
That macro also disables a lot of debug logs and some more like timing stats etc.
But since it won't fit in OTA-sizes, I guess it does not make sense to keep it small.
I will enable it and make a new test build.

New test build: https://www.dropbox.com/s/8vx1cadxlz8rb ... M.bin?dl=0

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#427 Post by fresnoboy » 06 Sep 2020, 23:13

TD-er wrote: 06 Sep 2020, 22:28 No, that's probably got something to do with me selecting the "OTA" definition to make a smaller build.
That macro also disables a lot of debug logs and some more like timing stats etc.
But since it won't fit in OTA-sizes, I guess it does not make sense to keep it small.
I will enable it and make a new test build.

New test build: https://www.dropbox.com/s/8vx1cadxlz8rb ... M.bin?dl=0
Ah! Perfect! All the controllers from the original PUYA build and more, and the log window as well. I'll work on configuring this and see how well it works!

Thanks so much!
mike

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#428 Post by TD-er » 06 Sep 2020, 23:21

Please let me know if you're still missing something.
Otherwise I will merge it and it will be part of the next nightly builds.

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#429 Post by fresnoboy » 07 Sep 2020, 02:03

TD-er wrote: 06 Sep 2020, 23:21 Please let me know if you're still missing something.
Otherwise I will merge it and it will be part of the next nightly builds.
I am upgrading the software on my LC Tech builds with this one. It converted over from the PUYA build referenced in this thread fine, with the exception of the serial controlled switch device. After thew new firmware booted, when you go to devices, it says Plugin 165 not included in the build.

I can manually update the config and seems to work fine, but it's not a seamless upgrade. Are there two serial controlled switch plugins?

thx
mike

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Serial MCU controlled relay/switch

#430 Post by Micha_he » 07 Sep 2020, 07:50

No, but you read my post here ?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#431 Post by TD-er » 07 Sep 2020, 09:27

fresnoboy wrote: 07 Sep 2020, 02:03
TD-er wrote: 06 Sep 2020, 23:21 Please let me know if you're still missing something.
Otherwise I will merge it and it will be part of the next nightly builds.
I am upgrading the software on my LC Tech builds with this one. It converted over from the PUYA build referenced in this thread fine, with the exception of the serial controlled switch device. After thew new firmware booted, when you go to devices, it says Plugin 165 not included in the build.

I can manually update the config and seems to work fine, but it's not a seamless upgrade. Are there two serial controlled switch plugins?

thx
mike
The old provided build had a plugin ID of 165, which is from the range of the playground plugins.
The new build I made is with the code moved to the main repository, which thus have a lower plugin ID.
So your settings of P165 should be deleted and added again to make it work with this last build.

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#432 Post by svde » 10 Sep 2020, 12:11

Looks like the plugin in the main repository has ID 91. I've built it and see that it was being compiled. But I don't see it in the list of devices.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#433 Post by TD-er » 10 Sep 2020, 12:23

Do you have "USES_P091" defined in your build?

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#434 Post by svde » 10 Sep 2020, 13:08

TD-er wrote: 10 Sep 2020, 12:23 Do you have "USES_P091" defined in your build?
OK. Corrected that. It's working now.

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#435 Post by svde » 10 Sep 2020, 18:13

Any chance that the "Output - Domoticz MQTT Helper" device can be used to control the relay?

fresnoboy
Normal user
Posts: 17
Joined: 01 Sep 2020, 22:34

Re: Serial MCU controlled relay/switch

#436 Post by fresnoboy » 10 Sep 2020, 20:03

svde wrote: 10 Sep 2020, 18:13 Any chance that the "Output - Domoticz MQTT Helper" device can be used to control the relay?
Don't think so. That relay is controlled by the 8266's serial port.

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#437 Post by svde » 11 Sep 2020, 10:56

Too bad, it would make the "Output - Domoticz MQTT Helper" a lot more useful if it could do that. Another usecase is behind able to take a value from MQTT and store it in a variable. I may start a different thread on this, as it's off-topic here.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Serial MCU controlled relay/switch

#438 Post by Ath » 11 Sep 2020, 11:22

You could use the more generic MQTT Import plugin to receive values from Domoticz, then act on the data using the Rules event that is activated when the value changes:

Code: Select all

on MQTTImport#Value1 do
  // Send (serial) command to turn on/off relay
endon
/Ton (PayPal.me)

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#439 Post by svde » 12 Sep 2020, 08:25

My understanding is that the "Generic - MQTT Import" plugin isn't suitable to get data from Domoticz. Domoticz publishes everything under one MQTT topic (domoticz/out) in json format, example:

domoticz/out {
"Battery" : 255,
"RSSI" : 12,
"description" : "",
"dtype" : "Air Quality",
"hwid" : "5",
"id" : "82228",
"idx" : 228,
"name" : "Kitchen CO2",
"nvalue" : 621,
"stype" : "Voltcraft CO-20",
"unit" : 1
}

I haven't been able to find examples of the "Generic - MQTT Import" plugin working with Domoticz.

The nice thing about the "Output - Domoticz MQTT Helper" plugin is that it takes care of parsing the json which domoticz publishes to domoticz/out.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#440 Post by TD-er » 12 Sep 2020, 13:07

So, what are you missing?
Should it -based on the IDX value- send an event with the nvalue or svalue as eventvalue?

svde
New user
Posts: 8
Joined: 07 Aug 2018, 19:35

Re: Serial MCU controlled relay/switch

#441 Post by svde » 13 Sep 2020, 16:38

I currently have 2 usecases:

1) Sending outside temperature and humidity values from domoticz to the ESP, so it can be displayed on an oled screen. I currently have a dzvents script which is triggered by the Buienradar device:

Code: Select all

local FQDN0 = 'esp-easy-0.XXXX.XX'

return {
	active = true,
	on = {
		devices = { 'BR THB' }
	},
	execute = function(domoticz, device)
		br_thb = domoticz.devices('BR THB')
		domoticz.openURL({
			url = 'http://' .. FQDN0 .. '/control?cmd=TaskValueSet,4,1,' .. br_thb.rawData[1] .. ''
		})
		domoticz.openURL({
			url = 'http://' .. FQDN0 .. '/control?cmd=TaskValueSet,4,2,' .. br_thb.rawData[2] .. ''
		})
	end
}
The values are written to the 4th (dummy) device:
Image

And displayed on the OLED screen:
Image

I'd like the "Output - Domoticz MQTT Helper" plugin to pick up these values from MQTT itself. In this case, follow idx 549 and put the values in the dummy device.

2) Send the state of a virtual switch in domoticz to the ESP. This ESP is a lctech board with a serial controlled relay.

At the moment a http call is done from domoticz to the ESP:
Image

It would be nice if the "Output - Domoticz MQTT Helper" plugin could also select the relay device next to the gpio.

zenonmb
New user
Posts: 6
Joined: 10 Sep 2021, 18:45

Re: Serial MCU controlled relay/switch

#442 Post by zenonmb » 24 Sep 2021, 18:07

Colleagues,

I am working with the LC Tech module 4 relays as HTTP station for openskrinkler app . The issue I am facing is that when the ESP8266 ESp01 is on(attached to) the relay board, it does not connect to the WIFI.
If the ESP01 is not installed (since had to remove it to program with ESPEasy) , but connected with +Vcc, GND, Tx,Rx it works ok .
The only difference when the module is removed (to programm the ESP) are the GPIO0/2, RST and CH_PD. The first two I have them open and the others to +V .
Was wondering if the local controller sets these pins and prevent the WIFI to connect .
This is what I get when the ESP01 is dettached (works OK)

INIT : Booting version: (custom) (ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3)
91 : INIT : Warm boot #2 - Restart Reason: External System
95 : FS : Mounting...
101 : FS : Mount successful, used 75802 bytes of 113201
108 : CRC : No program memory checksum found. Check output of crc2.py
114 : CRC : SecuritySettings CRC ...OK
131 : INIT : Free RAM:19888
132 : INIT : I2C
132 : INIT : SPI not▒▒137 : SerSW : Init LCTech 115200 baud 4 btn
145 : INFO : Plugins: 11 [Normal] (ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3)
145 : EVENT: System#Wake
150 : WIFI : Set WiFi to STA
182 : WIFI : Connecting NETGEAR attempt #0
185 : EVENT: System#Boot
238 : EVENT: Control_bomba#Relay0=0.00
241 : EVENT: Control_bomba#Relay1=0.00
244 : EVENT: Control_bomba#Relay2=0.00
246 : EVENT: Control_bomba#Relay3=0.00
1521 : WD : Uptime 0 ConnectFailures 0 FreeMem 18616
4326 : WIFI : Connected! AP: NETGEAR (C0:3F:0E:06:A3:7A) Ch: 11 Duration: 4143 ms
4328 : EVENT: WiFi#ChangedAccesspoint
4411 : WIFI : DHCP IP: 192.168.0.144 (ESP-Easy-0) GW: 192.168.0.1 SN: 255.255.255.0 duration: 84 ms
4412 : EVENT: WiFi#Connected

When I put the module in the main relay board, I see this one

INIT : Booting version: (custom) (ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3)
94 : INIT : Cold Boot - Restart Reason: External System
97 : FS : Mounting...
103 : FS : Mount successful, used 75802 bytes of 113201
110 : CRC : No program memory checksum found. Check output of crc2.py
116 : CRC : SecuritySettings CRC ...OK
133 : INIT : Free RAM:19888
134 : INIT : I2C
134 : INIT : SPI not▒▒139 : SerSW : Init LCTech 115200 baud 4 btn
147 : INFO : Plugins: 11 [Normal] (ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3)
147 : EVENT: System#Wake
152 : WIFI : Set WiFi to STA
184 : WIFI : Connecting NETGEAR attempt #0
187 : EVENT: System#Boot
240 : EVENT: Control_bomba#Relay0=0.00
243 : EVENT: Control_bomba#Relay1=0.00
246 : EVENT: Control_bomba#Relay2=0.00
248 : EVENT: Control_bomba#Relay3=0.00
1523 : WD : Uptime 0 ConnectFailures 0 FreeMem 18616
4212 : EVENT: WiFi#Disconnected
4214 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 4028 ms
4967 : WIFI : Connecting NETGEAR attempt #1
8114 : EVENT: WiFi#Disconnected
8116 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3146 ms
8967 : WIFI : Connecting NETGEAR attempt #2
12113 : EVENT: WiFi#Disconnected
12115 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3146 ms
12967 : WIFI : Connecting NETGEAR attempt #3
16114 : EVENT: WiFi#Disconnected
16116 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3146 ms
16967 : WIFI : Connecting NETGEAR attempt #4
20113 : EVENT: WiFi#Disconnected
20115 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3146 ms
20967 : WIFI : Connecting NETGEAR attempt #5
24114 : EVENT: WiFi#Disconnected
24116 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3146 ms
24967 : WIFI : Set WiFi to AP+STA
25887 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
25887 : WIFI : Connecting NETGEAR attempt #6
29034 : EVENT: WiFi#Disconnected
29036 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3145 ms
29973 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
29973 : WIFI : Connecting NETGEAR attempt #7

and keeps for ever

Question :
Is there any setup on the ESPEasy to ignore what the local MCU sends to the ESP module?
Cheers,

martin

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#443 Post by TD-er » 24 Sep 2021, 21:18

Can you measure the voltage on the ESP when it is powered on the relay board?
Preferrably with a multimeter (or a scope) which may record the lowest voltage.

zenonmb
New user
Posts: 6
Joined: 10 Sep 2021, 18:45

Re: Serial MCU controlled relay/switch

#444 Post by zenonmb » 25 Sep 2021, 01:52

The voltage should be the same, since I taking the power from the relay module.
Take a look at the picture.
Attachments
IMG_5626.jpg
IMG_5626.jpg (1.76 MiB) Viewed 17472 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#445 Post by TD-er » 25 Sep 2021, 11:24

OK, I see.
Had to look hard to follow the wires, but it looks indeed like you're powering it from the relay board.
So this setup should even be worse, considering the possibility for voltage dips.

Just curious, have you tried it with this setup, but the TX of the board connected to the ESP's RX?

Let's assume your hypothesis of the event handling taking way more time to process and thus the WiFi timing out to be correct (I think it is plausible)
One thing you can do, is place the event that has to be handled at the top of the 1st rule file.
This will make handling that event much faster.

I noticed you're using quite an old build and there have been a lot of optimizations in the rules handling over the last years (I estimate that build is like 3 years old?)

zenonmb
New user
Posts: 6
Joined: 10 Sep 2021, 18:45

Re: Serial MCU controlled relay/switch

#446 Post by zenonmb » 27 Sep 2021, 03:21

Yes, I am taking power from relay module. Using the breadboard just to make the connections.
And yes, also measure the the RX/TX. What I posted up to now is what the module is sending to the local MCU and this is what the MCU is sending (in this case X3)to the ESP8266 and I am assuming it is ignoring these commands, right?

AT+CWMODE=2
AT+RST
AT+CIPMUX=1
AT+CIPSERVER=1,8080
AT+CIPSTO=360
▒▒▒▒▒▒AT+CWMODE=2
AT+CWMODE=2
AT+RST
AT+CIPMUX=1
AT+CIPSERVER=1,8080
AT+CIPSTO=360
▒▒▒▒▒AT+CWMODE=2
AT+CWMODE=2
AT+RST
AT+CIPMUX=1
AT+CIPSERVER=1,8080
AT+CIPSTO=360

Sorry, but I do not have any rule and honestly do not know what is that.
Regarding the fw, was not sure which one/where to get the latest. If you can , please tell me where to download it.
And last, but not least, THANK YOU VERY MUCH for helping me here. I do appreciate it.
Cheers,

martin

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#447 Post by TD-er » 27 Sep 2021, 08:19

If you can read logs, then the AT commands sent by the module will be parsed by the command interpreter of ESPEasy.
This parsing may cause delays, which may affect some time critical actions like connecting to WiFi.

The latest builds can be found here: https://github.com/letscontrolit/ESPEasy/releases
But be aware that 1M builds may be hard to update via WiFi as it simply won't fit.
So you might want to flash them using serial.

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Serial MCU controlled relay/switch

#448 Post by Dondolo » 28 Sep 2021, 09:17

The latest builds can be found here: https://github.com/letscontrolit/ESPEasy/releases
But be aware that 1M builds may be hard to update via WiFi as it simply won't fit.
So you might want to flash them using serial.
Hi TD-er,
is it even possible to install the Serial MCU on an ESP01 1M?
Have tried the ESP01 with
ESP_Easy_mega_20210802_test_C_beta_ESP8266_4M1M.bin
to flash.

After that, I can't get a connection to the ESP01 despite successful flashing.
Greetings Dondolo

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#449 Post by TD-er » 28 Sep 2021, 10:09

The build you flashed is for 4M flash, so not really strange to see it won't boot.

Currently there is no pre-build file for 1M using that plugin.
So we have to make a custom build for it.

What else do you need in that build?

zenonmb
New user
Posts: 6
Joined: 10 Sep 2021, 18:45

Re: Serial MCU controlled relay/switch

#450 Post by zenonmb » 28 Sep 2021, 16:52

TD-er wrote: 27 Sep 2021, 08:19 If you can read logs, then the AT commands sent by the module will be parsed by the command interpreter of ESPEasy.
This parsing may cause delays, which may affect some time critical actions like connecting to WiFi.

The latest builds can be found here: https://github.com/letscontrolit/ESPEasy/releases
But be aware that 1M builds may be hard to update via WiFi as it simply won't fit.
So you might want to flash them using serial.
TD- er,

Thank you . Were able to fix my problem.
BTW, was challenging to figure out which firmware to upload. Found one mentioning LC TEch X 2 relay and tried (ESP_Easy_mega_20210802_hard_LCtech_relay_x2_1M). Copy here my boot for future references.

INIT : Booting version: pygit2_not_installed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
72 : Info : INIT : Free RAM:35632
73 : Info : INIT : Cold Boot - Restart Reason: External System
74 : Info : FS : Mounting...
80 : Info : FS : Mount successful, used 75802 bytes of 113201
92 : Info : CRC : SecuritySettings CRC ...OK
95 : Info : WiFi : Start network scan all channels
123 : Info : INIT :rabled
130 : Info : SerSW : Init LCTech 115200 baud 4 btn
133 : Info : INFO : Plugins: 7 (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
134 : Info : EVENT: System#Wake
143 : Info : Webserver: start
144 : Info : EVENT: System#Boot
221 : Info : EVENT: TaskInit#=1,1
322 : Info : EVENT: #Relay0=0
429 : Info : EVENT: #Relay1=0
526 : Info : EVENT: #Relay2=0
624 : Info : EVENT: #Relay3=0
1483 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 27088 WiFiStatus 0 ESPeasy internal wifi status: DISCONNECTED
2309 : Info : WiFi : Scan finished, found: 18

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests