Converting a sketch from 1.5.x to 2.0.x
-
@Yveaux rollercontainer pointed to this issue: https://github.com/mysensors/MySensors/issues/449, where hek asked him to add two lines of code, the first one being "if (presentation)".
-
Great work ! This version looks a lot cleaner and the support for the RFM69 is more integrated. Thanks for that. One thing I'm missing and that's the specification of the encryption key for the RFM69. This was done in version 1.5.x by a user defined 16 bytes string. Now i see only a #define MY_RFM69_ENABLE_ENCRYPTION.
How and where is the key specified ? How does this make my setup unique ?Thanks.
-
@Rolo6442u
If I remember well, it is handled by SecurityPersonalizer.ino It is sketch for signing options, and i think you can set/generate your rf aes key there. It store it in eeprom. Then you upload the new sketch with encryption define enabled. For me it's ok, as i use signing which needs to use the personalizer.
I think this works like this, not sure as i have not enabled encryption yet. Am I right @Anticimex ? -
Great work ! This version looks a lot cleaner and the support for the RFM69 is more integrated. Thanks for that. One thing I'm missing and that's the specification of the encryption key for the RFM69. This was done in version 1.5.x by a user defined 16 bytes string. Now i see only a #define MY_RFM69_ENABLE_ENCRYPTION.
How and where is the key specified ? How does this make my setup unique ?Thanks.
@Rolo6442u
@scalz is correct. Details are in the doxygen documentation for usage. Link is on the GitHub readme. Look under the signing module there. -
@Rolo6442u
@scalz is correct. Details are in the doxygen documentation for usage. Link is on the GitHub readme. Look under the signing module there.@Anticimex
@scalz
Thanks, I got it working. By setting it to "soft" this sketch writes all key's to eeprom and will not look for a hardware siging module. The RFM69 uses the EAS key for encryption. I defined my own key again in the sketch.
Nice solution ! -
@Anticimex
@scalz
Thanks, I got it working. By setting it to "soft" this sketch writes all key's to eeprom and will not look for a hardware siging module. The RFM69 uses the EAS key for encryption. I defined my own key again in the sketch.
Nice solution !@Rolo6442u precisely. Glad to hear that the docs are helping :) and thanks!
-
How can i call the process() inside a while in the loop() ?
Thanks
-
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?