pimoroni / enviro

MIT License
101 stars 79 forks source link

Weather board bricked after running for ~36 hours with v0.0.9 #121

Open peter-mount opened 1 year ago

peter-mount commented 1 year ago

I upgraded my Enviro Weather board to v0.0.9 on Friday evening and it worked perfectly until early Sunday morning when it went unresponsive. Brought it inside and found that it wouldn't appear at all on USB.

Unlike pimoroni/enviro#117 even holding the Poke button for any amount of time would make it responsive.

I tried reflashing v0.0.9 and that didn't work either, although I did managed to get it into provisioning once after multiple attempts I cannot reprovision now.

I tried flashing a standard microPython build and that worked, I can boot the PicoW but when I then tried the Pimoroni build it wouldn't boot nor appear as a USB device. I even tried an earlier v0.0.7 build which had previously worked and that one wouldn't boot either.

This makes me think that the board is now in some weird state that is causing the Pimoroni microPython build to hang before the USB stack can start.

If I try running it on Battery only it powers up with both red & white leds showing but after a while the white goes off but the red is still on but dim.

I'm going to try to dig into this further but raising this issue incase anyone else has the problem.

dave-ct commented 1 year ago

@peter-mount I had a simialr issue when upgrading on the enviro-indoor where I could not load the new image. I followed this to clear the flash and then it installed fine. https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#resetting-flash-memory

peter-mount commented 1 year ago

@dave-ct unfortunately that doesn't help in this case as it's not a flash problem. I've tried flash_nuke as well as trying a recent standard micropython build and they both work as expected.

That's why I'm thinking it's some state on the board confusing the pimoroni micropython build so it's not booting.

helgibbons commented 1 year ago

I got mine out of a similar stuck state (activity light illuminates immediately when reset, can't communicate via USB) by installing a non-Enviro variety of MicroPython so I could talk to the board with Thonny, deleting main.py, reinstalling Enviro MicroPython and then reinstalling main.py by running it through Thonny - don't know if that helps?

peter-mount commented 1 year ago

I've just tried that:

Once provisioned it then failed again.

However, by putting the base pimoroni-picow-v1.19.10-micropython.uf2 firmware back on I was able to get at the log file and saw this:

2000-01-01 01:44:11 [debug    / 115kB] > performing startup
2000-01-01 01:44:11 [exception / 112kB] ! Traceback (most recent call last):
  File "main.py", line 32, in <module>
  File "enviro/__init__.py", line 403, in startup
  File "enviro/__init__.py", line 255, in get_wake_reason
ImportError: no module named 'wakeup'

2000-01-01 01:44:11 [info     / 109kB] > going to sleep
2000-01-01 01:44:11 [debug    / 124kB]   - clearing and disabling previous alarm
2000-01-01 01:44:11 [info     / 122kB]   - setting alarm to wake at 01:45am

I'm going to try some other combinations later just incase that ImportError was down to how I managed to get it working this time around.

dave-ct commented 1 year ago

@peter-mount I got the same error previosuly, had to install this one to get 0.0.9 working correctly (has the 0.0.9 at the end of the file name): https://github.com/pimoroni/enviro/releases/download/v0.0.9/pimoroni-picow_enviro-v1.19.10-micropython-v0.0.9.uf2

peter-mount commented 1 year ago

@dave-ct That's the one I originally had running for 36 hours before it then died. I'll try that one again later in case there's a difference between it and the way I just done

ZodiusInfuser commented 1 year ago

@peter-mount Wakeup is a special module that is only included in the Enviro flavour of our Micropython build, hence you seeing that exception in your log. Incidentally that logging is a new addition to the v0.0.9 firmware, so I'm glad I added that!

peter-mount commented 1 year ago

Ok, I've managed to get it working - now to see how long it lasts.

First I ended up running:

  1. flash_nuke.uf2
  2. pimoroni-picow_enviro-v1.19.10-micropython-v0.0.9.uf2
  3. pimoroni-picow-v1.19.10-micropython.uf2

That got it to boot, although fail with the wakeup issue, so then put pimoroni-picow_enviro-v1.19.10-micropython.uf2 and it went through provisioning but it immediately crashed when it first rebooted.

So I then flashed rp2-pico-w-20221128-unstable-v1.19.1-721-gd5181034f.uf2 which got it booting again and reflashed pimoroni-picow_enviro-v1.19.10-micropython.uf2 and now it's running.

I'll monitor it to see how long it lasts as it did take a few attempts to get it running again.

Pedro-vk commented 1 year ago

I'm having similar problems. To be honest, I'm confused, my first enviro arrived today and I tried to setup it up with stock firmware and was unable. I updated to v0.0.9 and was failing in very wired ways and not being able to connect to Thonny (that never used before). Tried with v0.0.8 and works better, but Adafruit is not working. Should I wait for a new update or do you think that is it possible to fix it in any way? Thanks for your help :)

ZodiusInfuser commented 1 year ago

@Pedro-vk Sorry to hear about your issues, especially with the stock firmware 😢 I very much hope that we will be able to fix the issues. These are becoming hard to diagnose on my end though, as some of my Enviros having worked fine for weeks, and others fail to last a few hours.

With your v0.0.8, in what way was Adafruit not working? Does the log.txt say anything? Annoyingly, only v0.0.9 gives useful logging information to help diagnose Adafruit.io issues 😢

Pedro-vk commented 1 year ago

I have good news :) After trying with v0.0.9 several times I saw some logs that helped me fix the Adafruit issue. Was a bit hard, because on v0.0.9 it stops logging at some point and it doesn't recover without flashing (and using nuke).

ZodiusInfuser commented 1 year ago

@Pedro-vk Glad to hear it! Could you share what you did, as it may be worth me including additional logging, or clarifying the current logging to help others in the future.