Skip to content

Conversation

@itbeyond
Copy link
Contributor

@itbeyond itbeyond commented Apr 1, 2017

This update replaces the goGetValveTimes function with a timed receiver that works 100% of the time. Other changes to make the VALVE_TIMES_RELOAD a variable with comments at the top and adjustments to the Setup to call this updated method.

Fix issue where the status of the system was NOT sent to the controller on a manual button operation due to the lastState being updated to a new state in the displayMenu. The displayMenu was called just before the lastState = state; line which meant the state was never iterated with the changed value from the displayMenu. The relays would click but the status was never transmitted.

Also added some minor 50ms delays on the status updates to reduce radio saturation. Changed some DEBUG messages to show the Zone names on time change and made the VAR_3 display consistent with other VAR debug displays.

itbeyond added 2 commits April 1, 2017 15:29
The goGetValveTimes functions was sending 3 requests to the controller without pause or waiting for response - thus the receive code was rejecting the replies and the sender was NACKing some sends. This update replaces the goGetValveTimes function with a timed receiver that works 100% of the time. Other changes to make the VALVE_TIMES_RELOAD a variable with comments at the top and adjustments to the Setup to call this updated method.
This mod fixes an issue where the status of the system was NOT sent to the controller on a manual button operation due to the lastState being updated to a new state in the displayMenu. The displayMenu was called just before the lastState = state; line which meant the state was never iterated with the changed value from the displayMenu. The relays would click but the status was never transmitted.

Also added some minor 50ms delays on the status updates to reduce radio saturation. Changed some DEBUG messages to show the Zone names on time change and made the VAR_3 display consistent with other VAR debug displays.
@itbeyond itbeyond closed this Apr 1, 2017
@itbeyond itbeyond reopened this Apr 1, 2017
@itbeyond
Copy link
Contributor Author

itbeyond commented Apr 1, 2017

Sorry I closed this accidentally but I can see that the goGetValveTime method may now loop if the controller goes down - I will address this and update again but the manual button bug resolution is very solid and makes the project work as expected.

Having said this about the goGetValveTimes it will not really matter if this loops around on a wait as the unit will not operate without backend controller connection anyway, the display will just have the water drop icon visible until connection is made back to the controller. I did just change the delay times to 50 instead of 500 and it works better/faster.

Reduced the delay in the method improves performance in case you are using this node as a relay or have other sensors connected.
@itbeyond itbeyond changed the title Irrigation - goGetValveTimes() spamming controller Irrigation - goGetValveTimes() update + Manual button operation fix Apr 2, 2017
Final updates to goGetValveTimes() added timeouts for the controller variables system, reduced code to use new allVars int array declared at the top, reduces code base to smaller than the original 2.0 code.
@henrikekblad henrikekblad merged commit df5e379 into mysensors:master Apr 18, 2017
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