ESP Easy Mega - Config partly lost after reboot

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

ESP Easy Mega - Config partly lost after reboot

#1 Post by jopare » 31 Oct 2018, 13:03

Hi from Frankfurt. I've a Wemos D1 mini pro with a relay shield and a RCWL-0516 radar sensor. The radar sensor triggers my D1 to switch the relay.
So I configured 2 devices (radar sensor + Relay) as a normal switch and made the correspondig rule like this.

Code: Select all

on Radar#Switch do
if [Radar#Switch] = 1
GPIO,5,1
else
GPIO,5,0
endon
so far so good, this works until the device is rebooted. After a reboot the relay switches permanently on and off, independent of the radar sensor signal.
When i open then the ESPEasy config, open the edit dialog for each device, submit it without any change, everything is running well again.
Any idea what i do wrong with this. I've spend a lot of time to find the trick without success.
Thanks in advance for any comments, Jo :)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy Mega - Config partly lost after reboot

#2 Post by grovkillen » 31 Oct 2018, 15:38

Have you tried using the "taskrun" command for each task/device?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: ESP Easy Mega - Config partly lost after reboot

#3 Post by jopare » 31 Oct 2018, 16:35

Yes i did, but nothing has changed.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy Mega - Config partly lost after reboot

#4 Post by grovkillen » 31 Oct 2018, 17:12

So you may need to do a check after System#Boot is triggered? We need more info about the setup to be able to help.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: ESP Easy Mega - Config partly lost after reboot

#5 Post by jopare » 31 Oct 2018, 18:13

OK, i have setup only 2 devices
and the rule above, thats it.
ESPEasy version is v2.0-20180322
Unfortunately i don't understand what you mean wiht "check after System#Boot is triggered".
Device1.jpg
Device1.jpg (29.35 KiB) Viewed 4577 times
Device1.jpg
Device1.jpg (29.35 KiB) Viewed 4577 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy Mega - Config partly lost after reboot

#6 Post by grovkillen » 31 Oct 2018, 18:19

If you look in the wiki you'll see that you can do stuff when things (events) are triggered.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: ESP Easy Mega - Config partly lost after reboot

#7 Post by jopare » 31 Oct 2018, 20:46

Thanks for your the reference to the wiki. I read it already but i have heared more noise but not a clear statement regarding my problem.
I also read the ESPEasy documentation pdf. Events are here unknown. Maybe an insider may be able to understand this vague brief description
but not someone new with ESPEasy.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy Mega - Config partly lost after reboot

#8 Post by grovkillen » 31 Oct 2018, 20:50

By the looks of the screen shots it seems like you're running an old version. Later versions have more events at its disposal. You can then have rules trigger on these events. Something like this might help you in this instance:

Code: Select all

on System#Boot do
 GPIO,2,1
endon
That rule will run when the system is boot(ed) and it will set GPIO 2 to the state 1 (high). You can tweak this example to work with your relay ports.

https://www.letscontrolit.com/wiki/inde ... .29_events
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: ESP Easy Mega - Config partly lost after reboot

#9 Post by Domosapiens » 01 Nov 2018, 00:51

When i open then the ESPEasy config, open the edit dialog for each device, submit it without any change, everything is running well again.
Sounds like a race condition: A spike by the Relay triggers the RCWL-0516. With that action you breack the race.
independent of the radar sensor signal.
Your version shows only after a browser reload the latest state of the RCWL-0516
The latest versions show it automatic in your browser.

Some remarks:
- Your post shows 2 times Device1.jpg .. the relay..., so I don't know your RCWL-0516 settings
- You use GPIO 5, did you switch off the preferred I2C interface for GPIO-5 (see hardware tab)
- RCWL-0516 needs a pull-up resistor internal or external (as far as I understand the scare doc's it is an open collector output with 100 Ohm current limitation resistor)
- RCWL-0516 is extreme sensitive for power fluctuation (like relay on/off), did you add a "power bank" capacitor of around 47uF close to the RCWL-0516 ?
- RCWL-0516 is sensitive for the ESP WiFi transmissions (rather close to the RCWL-0516 frequency), use a 100nF capacitor as spike bypass capacitor as close as possible to the RCWL-0516
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: ESP Easy Mega - Config partly lost after reboot

#10 Post by jopare » 02 Nov 2018, 14:03

Thanks for all of your support. Obviously there was nothing wrong with my config. After upgrading to mega-20181101 Build Nov 1 2018 03:23:09
everything works as expected. Seems there was a code problem.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 113 guests