Converting a sketch from 1.5.x to 2.0.x
-
How can i call the process() inside a while in the loop() ?
Thanks
I think the function "wait()" might be useful. It is like a sleep, but now it calls "process()"
-
I think the function "wait()" might be useful. It is like a sleep, but now it calls "process()"
@nielsokker said:
I think the function "wait()" might be useful. It is like a sleep, but now it calls "process()"
I was thinking of using it with wait(0) but I was wondering if there was any way to call the process directly.
-
@nielsokker said:
I think the function "wait()" might be useful. It is like a sleep, but now it calls "process()"
I was thinking of using it with wait(0) but I was wondering if there was any way to call the process directly.
I'm not sure. I think the developers will know.
-
@pascalgauthier why do you need to call process ? It's already done internally by the lib. Or is it for inside some longtime loop? you still can use process but now it's _process()
Wait is not the same as sleep.
Wait : wait for a time and call _process
sleep: does not call _process. it sleeps. for a time if set -
@pascalgauthier why do you need to call process ? It's already done internally by the lib. Or is it for inside some longtime loop? you still can use process but now it's _process()
Wait is not the same as sleep.
Wait : wait for a time and call _process
sleep: does not call _process. it sleeps. for a time if set@scalz
Because i have while() that increment motion detected in a 30sec timeframe. And i would like to be sure that i'm not missing any cmd from the gateway. Do i need to define any additional library to use the _process() ? -
@scalz
Because i have while() that increment motion detected in a 30sec timeframe. And i would like to be sure that i'm not missing any cmd from the gateway. Do i need to define any additional library to use the _process() ?@pascalgauthier I would recommend making your while loop non-blocking i.s.o. hacking into a MySensors function.
-
@pascalgauthier
yes it's better non blocking. for non blocking it's better to use "if" like. for beginning, I advise you to look at "blink without delay" concept. then learning a bit how a state machine works etc...could be useful to you. but it's a bit more advanced, or not.. -
@pascalgauthier
yes it's better non blocking. for non blocking it's better to use "if" like. for beginning, I advise you to look at "blink without delay" concept. then learning a bit how a state machine works etc...could be useful to you. but it's a bit more advanced, or not.. -
Little bit confused. reading through the release notes...
Deprecated variables: V_DIMMER (use V_PERCENTAGE), V_HEATER (use V_HVAC_FLOW_STATE), V_LIGHT (use V_STATUS)Now back to the API page for 2.0...
S_DIMMER 4 Dimmable device of some kind V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATTWHICH ONE TRUST?!
-
And if my loop statement consists only of
void loop() { gw.process(); }Rewrite like
void loop() { }or exclude loop completely?
-
And if my loop statement consists only of
void loop() { gw.process(); }Rewrite like
void loop() { }or exclude loop completely?
-
Little bit confused. reading through the release notes...
Deprecated variables: V_DIMMER (use V_PERCENTAGE), V_HEATER (use V_HVAC_FLOW_STATE), V_LIGHT (use V_STATUS)Now back to the API page for 2.0...
S_DIMMER 4 Dimmable device of some kind V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATTWHICH ONE TRUST?!
-
Dear all, I'm a bit lost.
I upgraded the library in Arduino to 2.0.0 and now I am having big problems.I downloaded the sketch for the relay from the MySensors website:
https://www.mysensors.org/build/relay
but I suppose this is still for 1.5I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino
There must be something fundamentally wrong in my code, can anyone help?
-
Dear all, I'm a bit lost.
I upgraded the library in Arduino to 2.0.0 and now I am having big problems.I downloaded the sketch for the relay from the MySensors website:
https://www.mysensors.org/build/relay
but I suppose this is still for 1.5I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino
There must be something fundamentally wrong in my code, can anyone help?
@Maurizio-Collu the examples for 2.0 are included in the library. They can be opened directly fromthe Examples menu in the Arduino IDE. It is also possible to fetch the examples from github, see https://github.com/mysensors/MySensors/tree/development/examples/RelayActuator For the relay example.
-
Dear all, I'm a bit lost.
I upgraded the library in Arduino to 2.0.0 and now I am having big problems.I downloaded the sketch for the relay from the MySensors website:
https://www.mysensors.org/build/relay
but I suppose this is still for 1.5I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino
There must be something fundamentally wrong in my code, can anyone help?
You have a few mistakes in your sketch, Download the V2 sketch that @mfalkvidd has pointed you to and compare the two side by side. you will soon see where you have gone wrong. don't forget you will need to update your gateway to V2 as well, a version 1.5 gateway will not connect with a version 2 node.
-
@Maurizio-Collu the examples for 2.0 are included in the library. They can be opened directly fromthe Examples menu in the Arduino IDE. It is also possible to fetch the examples from github, see https://github.com/mysensors/MySensors/tree/development/examples/RelayActuator For the relay example.
Thanks a lot, I knew I was missing something basic. For the newbies like me, it would be good to mention this somewhere (if you have not done so already and I missed it).
In the Home Assistant website it is mentioned that they only support 1.4 and 1.5. I'm trying with 2.0.
Thanks Again
-
Thanks a lot, I knew I was missing something basic. For the newbies like me, it would be good to mention this somewhere (if you have not done so already and I missed it).
In the Home Assistant website it is mentioned that they only support 1.4 and 1.5. I'm trying with 2.0.
Thanks Again
2.0 should work with home assistant, but all new features of 2.0 are not supported yet. WIP.
-
I'm trying to upgrade my gateway to 2.0, but every time I go to upload, I get a 'error' not in sync.
I'm using just a standard nano w/ NRF24.
Note, my hardware profile is set properly to nano, 328p and proper com.
I restart app, and switched to my APM hardware profile and loaded my new 2.0 sensor code into my new APM node (DHT11 + motion) and was able to upload no problem.
Is there something i'm missing for the gateway?
Idon'tunderstandwhatwouldcauseittostopbeingabletocommunicate,
-
Just for clarification. V2.0 gateway (MQTT client esp8266) - will it work with the 1.5/1.6 sensors? Or everything needs to be flashed as soon as possible?