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

User avatar
By VikingGuy
#21865 I don't know if this is a LUA issue. I have a LUA script that is called from lua.init. This script reads a discrete input that has a pullup resistor. The only way to get the board to not lock up at boot is to place the pullup resistor in place after the board has booted and started the script.

The board is flashed to: NodeMCU 0.9.5 build 20150214 powered by Lua 5.1.4
Other scripts work well. The issue comes when I boot with a pullup.

I am using an ESP-12 board with GPIO 8 to trigger an interrupt.
Here is the configuration portion of my script:

-- Door Detect
--GPIO for pin 8 is: IRQ and has internal pullups used.
gpio.mode(8, gpio.INT)
gpio.trig(8, 'both', onChangeDoor)

I pull up to 3.3V using a 5K Resistor

If I pull the discrete input to ground with the 5K resistor, the board works without issue (so far as I've seen).

I use ESPlorer V0.2.0 -rc1 to talk to the ESP-12
User avatar
By GeorgeIoak
#21904 Using "pin 8" in your code example maps to GPIO15 of the ESP8266 (see the mapping table at https://github.com/nodemcu/nodemcu-firmware/#gpio-old-table-before-build-20141212)

GPIO15 must be pulled low at boot so when you added your pull up to this pin the ESP will see a high at GPIO15 on boot and will not boot (sorry, I don't remember the exact mode of GPIO15 but it needs to be low at boot up). So change to a different pin and you should be fine.
User avatar
By VikingGuy
#22174 That was the fix! I am running with a 5K pullup on GPIO6 and the board consistently boots without issue (as expected).

I knew that I had to pay attention to GPIO0 and GPIO2 (as far a boot goes). Now I will also pay attention to GPIO15.

Many thanks guys!