Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By rudy
#78576
Now I just need to understand how to make homie accepting messages for variable setting (e.g. light on/off).


That was as far as I got. Trying to understand the structure. I did get it, but have since forgotten.
User avatar
By technerdchris
#78578
btidey wrote:Now for new projects I don't start with a blank sheet, I just copy a previous project, delete any specific application routines, and add on the new stuff.


grhhm wrote:Sounds like a perfect code reuse.
Can you share your base, please?


Actually, this is not good practice at all. Proper "code reuse" is to use version control and "check out" the reused code individually for each project. And then when it is updated, all the projects benefit from the upgrade. And all the projects break if the code is bad. :)

I worked at a company which essentially had an embedded OS which they copied from one to the next. These branched remarkably by the teams. One was transmit equipment and the other receive. What a person would think are the "same OS" were tweaked far beyond reuse between the teams.

I do not do enough embedded programming to follow best practice, so I copy old work, make copious comments, date things a lot, and save old versions along the way.

:) Chris
User avatar
By grhhm
#78600
grhhm wrote:Now I just need to understand how to make homie accepting messages for variable setting (e.g. light on/off).


Finally, got it. The hint is buried in Homie convention. Homie reports status to the broker under topic:
homie/kitchen-light/light/power

However, to set the settable parameter the following topic to be sent to the broker:
homie/kitchen-light/light/power/set

Changing in initial configuration base of the topic from homie/ to anything else stop the MQTT subscription of remote device.

Next challenge: How to split the flash to have enough space for OTA? Where the OTA image is stored before burning into flash? What's minimal size of Flash needed if the bin-image is about 410kB?