As the title says... Chat on...

User avatar
By NullPointer
#61831 Right :geek:

Little background, I have around 10 nodes around the house monitoring and switching an immersion heater, electric heaters, lights and what not. I completely rely on these. My Arduino nodes are sort of stable lasting for months on end but when they go down they don't come back without a reset. So I turned to Lua.

Initially, the up time for the Lua nodes was awful *however* they always bounced back with the interpreter panicking and resetting the node, invariably because of low heap space. Learning to use local variables and modularising my code where possible mitigated this issue a good deal, also avoiding ROM modules that leak (looking at you http and cjson). I've found the Lua nodes at this stage look like they'll stay up forever. At least while the heap is stable.

Now, I'm not hating on the Arduino implementation here it has served me well. Just want to say that after an initial struggle I find myself preferring the Lua approach. The interpreter does a great job of keeping the node running (albeit with a soft reset on panic), Arduino not so much, it just locks up.

You absolutely can, with Lua, have a full fat application without baking it into the ROM as long as you are careful with the heap and localise your variables.

Moving my other nodes to Lua.