"require" not working?
Posted: Fri Feb 13, 2015 2:17 pm
I'm new to Lua, but my understanding is that require() returns an object table. After flashing the latest pre-build (nodemcu_latest.bin), I get the following behaviour:
I'm using Javier Yanez' DHT22, but this seems to be true with other Lua modules I've tried. This all worked fine with the 2015-01-27 build. Does this have something to do with node.compile()? I have not compiled any of the modules.
EDIT: I just tried downgrading to nodemcu_20150212.bin, and everything is working as expected again:
Code: Select all
>PIN = 5 -- data pin, GPIO14
> dht22 = require("dht22")
> dht22.read(PIN)
stdin:1: attempt to index global 'dht22' (a boolean value)
> print(dht22)
true
>
I'm using Javier Yanez' DHT22, but this seems to be true with other Lua modules I've tried. This all worked fine with the 2015-01-27 build. Does this have something to do with node.compile()? I have not compiled any of the modules.
EDIT: I just tried downgrading to nodemcu_20150212.bin, and everything is working as expected again:
Code: Select all
> dht22 = require("dht22")
> dht22.read(PIN)
> print(dht22)
table:
>