Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent sleep and SetOption36 Conflict #4490

Merged
merged 2 commits into from
Nov 30, 2018

Conversation

andrethomas
Copy link
Contributor

Code change to set sleep = 0 when SetOption36 is > 0 is sent by command.

Reverse also, set SetOption36 = 0 when sleep > 0 command is sent.

Users have reported unusual results when a combination of the two is used.

Update settings.ino - set sleep=0 when SetOption36>0
Prevent sleep and SetOption36 being used concurrently
@arendst arendst merged commit 2969b29 into arendst:development Nov 30, 2018
@andrethomas andrethomas deleted the patch-1 branch November 30, 2018 18:40
@andrethomas
Copy link
Contributor Author

@arendst I'm missing something that needs to be done somehow.

SetOption36 50 works fine if sleep = 0

The idea is that if command SetOption36 50 is executed, it should set sleep to 0 but for some reason it only takes effect on reboot - until then it reports sleep like this:

21:04:23 CMD: sleep
21:04:23 MQT: stat/sonoff/RESULT = {"Sleep":"50 (0)"}

And the LoadAvg confirms that the previously set value of sleep still has an impact... this is fixed if device is restarted but can it be done without having to restart?

Thx

@arendst
Copy link
Owner

arendst commented Nov 30, 2018

Setting.sleep is the storage for sleep. There is another variable called sleep that does the actual sleep task.

If you set option 39 you will have to clear this sleep variable too.

@andrethomas
Copy link
Contributor Author

Thx!

gemu2015 pushed a commit to gemu2015/Sonoff-Tasmota that referenced this pull request Jan 27, 2019
Prevent sleep and SetOption36 Conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants