💬 MySensors Library - v2.x
As noticied by @AWI in https://forum.mysensors.org/topic/4612/where-does-mysensor-store-in-eeprom/ there are not 256 bytes to play with on an AtMega328.
Also, it seems like the amount gets smaller for every version of MySensors. And the position is changed. So using saveState(20) on one MySensors version and loadState(20) on another version will result in the "wrong" byte being read back.
Can we handle this in a nice way? Preferably without limiting the use to 512 bytes, since some mcus have more. Should macros be provided to check the maximum size? Should we add a pragma compile warning if saveState is used with a too large address?
I've had some thought of letting the user-part of the eeprom grow from the end of the EEPROM. This would allow user storage to be unaffected when we add more internal stuff.
Not sure how this would be done with different sizes of eeprom in mind.
@hek That would at least keep the addresses same between versions, as long as the address is within the "free" space of the eeprom. (except that it would break compatibility one "final" time :))
save/readState should then check the address at runtime and make sure it doesn't overwrite MySensors' own data. Adding a compile-time warning is possible as well, but won't detect if the sketch developer uses a non-static variable for the address.
would break compatibility one "final" time
Allowing more that the 256 bytes we do today would absolutely complicate things.
Not bad, I even did an issue back then...
cimba007 last edited by
@hek: Could you change the part with "Here is a quick summary of the config options available. NOTE: This table will be updated with more information shortly" to be collapsed at the beginning and a + to exapand? Currently this section takes a lot of space and as it is essential for beginners might frighten new users
We talked about splitting up this page in more use-case based pages.
cimba007 last edited by
Nice to hear, keep the good work up!
ileneken3 last edited by
In the "Create Repeating Nodes" section, could you please change:
I wasted a lot of time trying to figure out why my repeater node wasn't working.
Thanks for a great product!
Thanks for reporting, updated.
(long unrelated discussion moved to https://forum.mysensors.org/topic/5079/the-basics-of-mysensors/ )
Reza last edited by Reza
what is difference between MY_PARENT_NODE_ID and MY_PARENT_NODE_IS_STATIC ?
when i add "MY PARENT NODE ID" to sketch of end node , so end node dont connect to controller directly ? and dont connect to other repeaters node? even when parent node is fail ?
edit : i test this features but dont work ! i want the my end node connect to controller with for example parent with node id 3 ! node 3 is a repeater.... but every time (with move and reset) end node choose a new parent...
Hi, I could not find a setCommand() message Api to chose between SET or REQ, is this done on purpose? I think it may be legitimate for a node to send a REQ command instead of the default SET.
Looks like mSetCommand(msg, C_SET) works but I'd avoid using not standard API calls.
void request(uint8_t childSensorId, uint8_t variableType, uint8_t destination);
See "Requesting data" here:
@martinhjelmare Thanks, I've completely missed it expecting it somehow in the message constructor section, my bad! Thanks again