Presto upgrade bricked my Wi-FI

I updated the software on my Presto with the presto-v0.1.0-micropython-with-filesystem.uf2 and the result was that nothing that uses WI-FI will work.

I thought this deserved special attention from the thread where I was asking about using Bluetooth.

I appreciate that not many people will want to try it, but maybe @gadgetoid (having access to a few Prestos) might like to check this.

I have also updated Thonny to the latest version to see if it made any difference, but no.

Thanks

Mike

Do you have any more details, error messages or anything?

I just dropped v0.1.0 onto my presto and (once I’d updated secrets.py with my wifi details) everything looks to be working as normal?

Thanks.

Well running Word Clock I get the message

“unable to get time.”

“Check your network try again”

I have updated the secrets file, and reset my router, but my problem persists.

I am using a Mac by the way.

Looking through the code, “unable to get time” implies that the wifi has connected, but the NTP call has failed - may be a temporary error with your internet and/or whichever NTP server it picks

Well I have been trying to fix this for the best part of four days now so it seems unlikely it is just picking the wrong server all the time. I have repeated the process of memory up grade several times and nothing changes.

I am familiar with the UF2 method of upgrade as I have used in in other projects I have written for the MagPi magazine. Under my Mike Cook user name.

You’re right, if the problem has persisted for days it’s unlikely to be a temporary network blip. Clearly I need to improve my telepathy :-)

Unfortunately the error handling on that call is a simple “didn’t work, here’s an unhelpful error” so it’s hard to diagnose. You could add some better handling around the call to ntptime.settime() to extract more info from the exception it throws (I don’t know if your MagPi projects have done much of that, if not I’ll… try to remember how that works in micropython I guess?)

Yes that’s a good start.

The thing is before the update everything was working the word clock would show the time an hour slow. I even modified the code to add the extra hour to the time it showed. Now it says “connecting” before what I assume to be a time out period. then I get the “helpful” error messages I posted before.

So I am really at a loss to know what to do next.

As a work around you could go back to an earlier version.
Releases ¡ pimoroni/presto

On my Pico Plus 2W I do the following. I can see at a glance on my OLED if the WIFI connected. It does occasionally time out on me.

You can likely do something similar with the NTP connection. It still won’t tell you why, just that it didn’t connect.

    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    wlan.connect(WIFI_SSID, WIFI_PASSWORD)
    while wlan.isconnected() is False:
        print('Waiting for connection...')
        display.text("RP2350B", 30, 0, scale=2)
        display.text("RM2 WIFI", 25, 18, scale=2)
        display.text("PIFI24", 35, 36, scale=2)
        display.text("Connecting", 15, 54, scale=2)
        display.update()
        led.value(1)
        time.sleep(1)

    if wlan.isconnected() is True:
        display.set_pen(0)
        display.clear()
        display.set_pen(15)
        display.text("RP2350B", 30, 0, scale=2)
        display.text("RM2 WIFI", 25, 18, scale=2)
        display.text("PIFI24", 35, 36, scale=2)
        display.text("Connected", 18, 54, scale=2)
        display.text("WIFI OK", 30, 72, scale=2)
        display.update()
        led.value(0)
        time.sleep(5)
    
    else:
        display.set.pen(0)
        display.clear()
        display.set.pen(15)
        display.text("RP2350B", 30, 0, scale=2)
        display.text("RM2 WIFI", 25, 18, scale=2)
        display.text("PIFI24", 35, 36, scale=2)
        display.text("WIFI ??", 25, 54, scale=2)
        display.update()
        led.value(1)
        time.sleep(5)
        

Interesting I will try that.

However, something else just struck me which might be relevant, at least it is odd. The first time I did a download the secrets file was empty and I had to reenter the data there. Now when I try an upgrade the secrets file is untouched, that is it survives a memory update.

Which uf2 file is used can affect that. The “with file system” one will, as far as I know, wipe / replace everything. And the other basic one won’t.
It’s one of the reasons for the flash_nuke.py file. It erases everything on the Pico and leaves it completely blank, no file system, no nothing.

Updating the firmware does not touch the RM2. So I don’t think there is any chance of bricking it just by updating the firmware. The new firmware of course could contain some bugs, but that probably would have turned up already. And given the info in this thread, the wifi-connectivity does not seem to be the problem, but the networking (which is one layer above).

I went back to v0.08 and still got the “unable to get time Check your network and try again” error message

On the console I got:-

“Connection lost – read failed: [Errno 6] Device not configured”

So how would I fix that?

My network is working for my main computer. Here is a image of it with real values redacted.

I also ticked the Ask to join new networks but nothing changed.

I think, if it was me, I’d flash nuke it and start over from scratch. It may seem extreme but it’s bailed me out in the past.
Pico-series Microcontrollers - Raspberry Pi Documentation

To track down network errors, you don’t need to be a network guru, but a basic understanding of terminology and concepts helps. Otherwise, you can only try various things:

  • put the Presto near your router. The RM2 is not the strongest WIFI-chip, so this might help: My Pico-W devices also have a hard time connecting if they are far away from the router
  • check your router logs to verify connection attempts and possible connection errors. Sometimes you have to activate (connection) logging on your router first.
  • Restart the DHCP-server (usually the router). In theory this should not be necessary, but in practice it helps sometimes. When I am testing and doing a lot of restarts on Pico-W side, I sometimes reach the point where this is necessary.
  • Instrument your Python-code and dump network information (router-IP, network, netmask, IP, signal strength). This is well documented in the MicroPython docs. Compare these values to the ones you have on your main computer

Less than 1ft to the router - no change

It has been a long time since I did that and now Firefox keeps blocking access to it, claiming it is an insecure connection. I might have to buy a USB to Ethernet adapter, or find the one I think I had.

Already done that

I will look into that, but I feel it is not going to help because these problems only started when I updated the software.

I did that, and then downloaded the version v0.0.8-micropython-with-filesystem.uf2.

Made absoloutly zero difference. It still says:- “unable to get time check your network and try again”.

Is it “now” connecting to your network?
Might want to post your code (minus your SSID).
I don’t have a Presto, but I am expecting delivery of two Pimoroni RM2 modules some time today. And I have a Pico Plus 2W to tinker / test with.

No did you read what error message it gave.

The code is the standard word clock application.

That might explain things.

Good luck. But I notice that this is nothing to do with a Presto so I am not sure if it will help.

By the way I did try running this EzWiFi code once only. Maybe this screwed things up?

import ezwifi

ezwifi.connect(verbose=True)

If you’ve flash nuked and reloaded the firmware since, it doesn’t seem likely that ‘ezwifi’ has upset anything.

Given that the error suggests something within ntptime is failing, I would suggest you could enhance the call to ntptime to:

  • try a different NTP host, in case for some weird reason ntp.org isn’t playing nice
  • extend the timeout, in case something in your network and/or the wider internet is throwing some odd delays
  • try and get some more information out of the exception, as I suggested earlier

Something like this (around line 53ish of word_clock)

# Set the correct time using the NTP service.
try:
    ntptime.host = "time.google.com"
    ntptime.timeout = 5
    ntptime.settime()
except OSError as e:
    while True:
        show_message(f"Unable to get time ({e.errno}).\n\nCheck your network try again.")

@Grumpy_Mike
I did read the error message, its a bit vague IMHO. You might have a LAN connection but no WAN.
I don’t have a Presto, but its using the same RM2 module that I have here. I’ll hunt up the world Clock example your using and have a look see.
I know it gets old, but if you flash nuked, and reloaded the uf2, your secrets file will be blank.
Have a look at this:
pico-lipo/examples/wireless_test.py at main ¡ pimoroni/pico-lipo