Shop OBEX P1 Docs P2 Docs Learn Events
Esp8266 Stuck — Parallax Forums

Esp8266 Stuck

I think I bricked my adafruit hazzah. I uploaded a bad init.lua and now it is stuck rebooting.
I tried reflashing hoping it would reinitialize memory but no such luck.
Does anyone know how to recover from this or is it bricked?

Comments

  • MJBMJB Posts: 1,235
    edited 2016-01-13 23:02
    reflashing the LUA/NodeMCU firmware will help

    and then make sure your boot sequence has either a wait long enough to break, or check a pin for abort

    I learned it the hard way

    edit: here alink esp8266-nodemcu-interrupting-init-lua-during-boot

    here's what I do on ESP12
    1. check pin 14/5 for pulldown if low stop
    2. wait some time to allow for console command "tmr.stop(0)"
    --init.lua
    -- checking pin GPIO14 = (GPIOID = 5)for GND connection
    --    if GND then stop script
    gpio.mode(5,gpio.INPUT,gpio.PULLUP)
    if gpio.read(5) == 1 then 
        print("now is time for  tmr.stop(0) ")
        --[[
        tmr.stop(0)
        ]]
        cb = function()
            print("Setting up WIFI...")
            wifi.setmode(wifi.STATION)
            --modify according your wireless router settings
            wifi.sta.config("nwid","pw")
            wifi.sta.connect()
                tmr.alarm(1, 1000, 1, function() 
                   if wifi.sta.getip()== nil then 
                    print("IP unavaiable, Waiting...") 
                    else 
                    tmr.stop(1)
                    print("Config done, IP is "..wifi.sta.getip())
                    dofile("RealCode.lua")
                    end 
                end)
            end
        cb()
        tmr.alarm(0,1000000,1,cb())
    end
    
    
  • Thanks for the reply

    I seems flashing is not the answer since I've flashed twice now with no success
    I am using esp8266flasher.exe from the nodemcu team

    Ive seen the various rescue methods in other posts and you can be sure Ill use something next time
    around but its too late for this one. Im just happy they are so cheap.
  • I'd suggest flashing with a different firmware, such as the integer NodeMCU if you've been using the float one or vice-versa; this might force the flash to be reformatted.

    Every time I have flashed one of my modules with NodeMCU it has reformatted the flash file system without being asked.
  • @localrodger
    Flashing with the new image worked!!!
    Thanks for the help

    Lesson learned.. A fail safe will be included in all future init.lua experiments
Sign In or Register to comment.