My WIFI network is working perfectly and all my other devices connect 100%. SSID and password have been checked to be correct many times.
This from earlier in the log:
connecting to wifi network 'MyNetwork'
2023-12-29 18:15:06 [info / 134kB] - ip address: 192.168.0.44
2023-12-29 18:15:07 [info / 127kB] > uploading cached readings to Adafruit.io: XYZ
The “connection failed” is just WiFi being WiFi; I suspect it’s a combination of certain WiFi routers and the fact that applications like the weather station spend a lot of time dropping / reconnecting. Generally, it’s a transient error and you’ll get a good connection the next time it attempts it.
The “rate limited” sounds like you’re hitting the limits on your (free?) Adafruit.io account (which, again, will be a bit of a transient error but if you consistently hit it, you may have just outgrown the free offering)
Thanks for your response, but it won’t generally connect to my router at all. If it does actually connect once it just fails to connect again and again after that.
I’ve been struggling on and off for months to get this to work but am getting to the point I’d like to just bin it.
It’s either just sits on: 2024-01-02 12:16:52 [info / 121kB] > connecting to wifi network 'MyNetwork'
and will go no further or (on trying a different router):
I’ve tried everything I can think of with the 2 routers I have but maybe the Pico Pi is just not compatible with any of them in which case I’m not buying another new router just for the Pico.
I’m so tired of this…I had such high hopes…
Ahh, ok - my bad, I misread your first post as being an ‘occasional’ problem, rather than a wider “it won’t talk to my WiFi”…
So, a few possible things to explore - are you using 2.4GHz or 5GHz? IIRC the Picow is … happier with one or the other, so if you have the options within your router it might be worth trying that.
Next up, how close is your router? The Picow (obviously) doesn’t exactly have much of an arial, so a location that’s on the edge of reception for your phone might be a non-starter for the Pico.
The timestamps on some of your messages feel a bit off too; “going to sleep” at 18:42:59 but then trying to reconnect to your WiFi less than 8 seconds later seems odd. Is it powered via USB, or battery?
Ahh, the 5GHz thing might have been a red herring because you’re right, I don’t think it supports it (I might be thinking of instances where people had been trying to connect to 5GHz-only routers)
I notice on your latest runs you’re getting a much higher IP address assigned (.44 up to .171), which makes me wonder if all the connection attempts are causing your router to fill up it’s DHCP tables or something daft like that. Do you know what model your router is, there may well be a way to tell it to always assign the same address to the Picow’s MAC address to stabilize that.
Otherwise, we’ve ruled out most of the obvious things I can think of to check…
I would say no, not necessarily. My experience is that 5m is sometimes already too much for the Pico W.
What you could do is to try to tweak the network connection code. Now I don’t run this Pimoroni MicroPython stuff, but with my own code (CircuitPython) I always do retries if the connection fails and it turns out that most of the time I need a second try - the chip seems to give up too early. The CircuitPython code does allow me to set timeouts, but they don’t seem to have any effect. Maybe it is the same on MicroPython.
Also now getting the following errors when my Enviro Weather tries to upload to Adafruit IO.
2024-02-11 07:35:47 [info / 108kB] > uploading cached readings to Adafruit.io: USER
2024-02-11 07:36:05 [debug / 116kB] - an exception occurred when uploading. Traceback (most recent call last):
File “enviro/destinations/adafruit_io.py”, line 31, in upload_reading
File “urequests.py”, line 184, in post
File “urequests.py”, line 91, in request
OSError: [Errno 103] ECONNABORTED
2024-02-11 07:36:05 [error / 114kB] ! failed to upload ‘2024-02-11T07_08_53Z.json’ to adafruit_io
Is this my error, an Adafruit error or something wrong with the code?
ECONNABORTED is telling you that the connection was initially established, but aborted before complete - in the absence of other information it’s hard to say much more, but it’s either
(a) your own network is dropping the WiFi connection, or your broadband
(b) Adafruit’s server falling over for some reason
(c) the internet between you and Adafruit falling over for some reason
All of these are likely to be temporary problems that should sort themselves out.
While it’s certainly possible to be something wrong with the code, if you haven’t changed anything I’m not aware of it showing up elsewhere.