Post your best Lua script examples here

User avatar
By rutierut
#12386
chadouming wrote:
rutierut wrote:Have you save the dht22.lua file to the esp?


The problem is that the device ran out of memory, not that the file was not found. He would need to compile (node.compile("dht22.lua")) the module so that it use less ram.


Ok tnx, funny how some people experience problems like these and others don't
User avatar
By chadouming
#12389
rutierut wrote:
chadouming wrote:
rutierut wrote:Have you save the dht22.lua file to the esp?


The problem is that the device ran out of memory, not that the file was not found. He would need to compile (node.compile("dht22.lua")) the module so that it use less ram.


Ok tnx, funny how some people experience problems like these and others don't


Indeed, seems like not all the modules are made equally.
User avatar
By bakicc
#12394 Thanks, compiling the dht22.lua worked. Be sure to have the firmware version where the node.compile method is implemented!

It's working now, great!

Why do we need to do the calculation "((temp-(temp % 10)) / 10).."."..(temp % 10)" to get the right temperature?
Why doesn't the method dht22.getTemperature() just return the right value?