NodeMCU is not booting due to Wixel holding GPIO15 high
Closed this issue · 13 comments
Having a problem with the NodeMCU+Wixel setup where it often will not start up the NodeMCU as GPIO15 is often 3.3V, which is TXD2 from the NodeMCU to the Wixel. This must be 0V at bootup of the NodeMCU for it to boot correctly, and sometimes it is not. Its like the Wixel is holding it at 3.3V sometimes.
When I plug in the USB to power the NodeMCU+Wixel, into the NodeMCU, I get 1 blink out of the NodeMCU and thats it. checking the serial traffic and its just dead, it hasnt booted up right. Have to look with 78800 baud, which is the default for the NodeMCU bootloader, and it just states the reason for the last reset, but thats it.
If I then short RST to GND on the Wixel and reset the NodeMCU with the reset button, the NodeMCU boots perfectly. I can then let go of the reset of the Wixel, and its away laughing.
Dont know if anyone else is having this problem or not, but it happens almost every time I try and start it up.
Its like we need 1 more wire from the NodeMCU to the Wixels RST line, as well as a pull down resistor maybe, so the Wixel is in reset to start with by default when the NodeMCU is trying to start up, then when the NodeMCU is ready, raise that pin high so the wixel can start up.
Thats what it seems like to me anyway.
I am not proficient in LUA, I have programmed the NodeMCU before but only with the Arduino core. I will look into this, but if you can provide some feedback that would be really appreciated.
Thanks
Hi,
I have noticed this on one of my 6 builds. What I did was to put a transistor between the NodeMCU and the Wixel, on the power wire. Then I open the transistor from the modInitialize.lua file that runs 10 seconds after boot. I have not yet uploaded the new schema and code, but plans to do it during the Christmas holiday.
Please let me know if you need any help implementing this and I can walk you through it.
Hey, I solved it by putting a pull down resistor between RST and GND on the Wixel, and then a wire from RST to D1 on the NodeMCU. So Wixel is held in reset normally, then in the init.LUA it sets the GPIO to output and drives D1 high.
Boots every time now! Cheap solution. Will test it for a day or so with random power cycles and see how it goes.
Never used LUA so did some quick googling and this seemed like the easiest way to do it. Unsure if init.lua is the most appropriate place but it seems to work as it just had to get to executing code.
`
-- Timers
-- Print - 0
-- Wifi connect = 1
-- Wifi monitor = 1
-- Led = 2
-- Delayed start = 4
-- Globals
--modPrintText = nil
require("modCompile").compileFiles()
modPrintText = require("modPrintText")
modPrintText.init()
-- set D1 high to allow the Wixel to boot up, held in reset with pull down resistor
resetpin = 1
gpio.mode(resetpin, gpio.OUTPUT)
gpio.write(resetpin,gpio.HIGH)
-- Start execution.
tmr.alarm(4, 10000, tmr.ALARM_SINGLE,
function ()
require("modInitialize").initialize()
end)
print("Starting NodeMCU Wixel in 10 seconds...")`
Using an older NodeMCU 0.9 that I had laying around.
Thanks
hmm, maybe this wont work and needs something more, as the Wixel is being held in reset so its not waking up to get the data. Some reason D1 is turning off.... any suggestions?
putting it in modinitialize.lua does the same thing. ESP goes to sleep, and so does the GPIO output... hmmm
Where abouts is the code which puts the NodeMCU to sleep? I cant see it...
I assume its going into deep sleep, which then the GPIO state is 'unchanged' but limited to 2uA only. Not enough to do bugger all. If it was changed to Light-Sleep instead, the GPIO state would be unchanged. Given NodeMCU+Wixel is likely to be powered off mains rather than battery (in my case anyway), how do I change the deep sleep to Light-sleep? Assuming of course that is what is going on. Thanks
It should not go into deep sleep, I think your problem is that you are using pin 1 which is used for the LED. Try a different pin.
oh right ok. ill try D2 then. So is the NodeMCU going to sleep at all at any point, or does it stay running all the time?
It stays running all the time. I have not looked into any power saving options yet.
Cool. D2 worked. Same code as above just changed to D2. Used a 5K resistor. Boots every time and stays running. Win. :)
Lines 16-19 of init.lua
-- set D2 high to allow the Wixel to boot up, held in reset with pull down resistor
resetpin = 2
gpio.mode(resetpin, gpio.OUTPUT)
gpio.write(resetpin,gpio.HIGH)
I finally had time to look at this and I went on your solution and updated the schema and code accordingly. Thanks for your suggestion.