nodemcu-modules icon indicating copy to clipboard operation
nodemcu-modules copied to clipboard

PANIC: Attempt to index nil value

Open BorisBrock opened this issue 9 years ago • 3 comments

Neither version works for me. I always get the error:

PANIC: unprotected error in call to Lua API (dht22.lua:73: attempt to index global 'bit' (a nil value))

BorisBrock avatar Feb 13 '16 21:02 BorisBrock

Sorry, now I have abandoned LUA programming. But others have continued to develop my module, you can find the latest version in https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_modules/dht_lib

javieryanez avatar Feb 14 '16 13:02 javieryanez

@VanKurt You probably figured this out by now but you need to be running a nodemcu build with the "bit" module included.

That said, I can't get it to work either but that was step one :-)

wardg32 avatar Mar 25 '16 00:03 wardg32

Since I stumbled here, thought I'd share my solution with others:

I used nodemcu-build to build my firmware, and explicitly chose the "bit" option.

sasha42 avatar Jan 12 '17 06:01 sasha42