Enviro Indoor (Pico W Aboard) Wifi connection always failing

Hello everyone!

Yesterday I received my new enviro indoor and so I started with the provisioning of the device. I tried to connect it to my local 2,4G WIFI network, but my attempts were not successful. Everytime I was done with the configuration, I ended up with a red blinking LED on the enviro.

I upgraded to the most recent enviro software und also updated to the newest version of MicroPython.

This is how the startup of the enviro looks now in the log.txt file:

2000-01-01 00:01:50 [info     / 127kB] > performing startup
2000-01-01 00:01:50 [debug    / 125kB]   - running Enviro 0.0.10, MicroPython v1.21.0, enviro v1.21.0 on 2023-10-06
2000-01-01 00:01:50 [info     / 134kB]   - wake reason: usb_powered
2000-01-01 00:01:50 [debug    / 132kB]   - turn on activity led
2000-01-01 00:01:50 [info     / 131kB] > clock not set, synchronise from ntp server
2000-01-01 00:01:50 [info     / 128kB] > connecting to wifi network 'Macroglossum stellatarum 2,4G'
2000-01-01 00:01:51 [error    / 123kB] ! failed to connect to wireless network Macroglossum stellatarum 2,4G
2000-01-01 00:01:51 [error    / 121kB] ! failed to synchronise clock
2000-01-01 00:01:51 [info     / 119kB] > going to sleep
2000-01-01 00:01:51 [debug    / 117kB]   - clearing and disabling previous alarm
2000-01-01 00:01:51 [info     / 115kB]   - setting alarm to wake at 00:10am
2000-01-01 00:01:51 [info     / 113kB]   - shutting down
2000-01-01 00:01:52 [debug    / 111kB]   - on usb power (so can't shutdown). Halt and wait for alarm or user reset instead

I double and triple checked my WIFI password, but somehow it is still not working. I also tried to copy the password directly from the webpage of my router into the provisioning webpage of the enviro. After that I tried to copy the WIFI password to the config.py file with thonny. But I always end up with a red blinking LED.

This is how the network access details look in the config.py file:

network access details

wifi_ssid = ā€˜Macroglossum stellatarum 2,4Gā€™
wifi_password = ā€˜82935757410902622532ā€™

My only guess is, that the wifi_ssid is somehow too long or not compatible? But Iā€™ve never had any problems with many other different clients in my network. Is there any way to get a more verbose log why the connection to the wifi network is not possible? Do you have any further ideas?

Thank you and best regards,
Alex

Should that maybe be,
Macroglossum stellatarum 2.4G

Thatā€™s a good idea! I checked again, but the SSID is really ā€œMacroglossum stellatarum 2,4Gā€.

What security is it using, WPA, WPA2 etc?

Iā€™m using WPA/WPA2 Personal in this network. This is the standard configuration of my router.

Ok, I donā€™t think thats the issue then. I have a tone of Piā€™s using WIFI, but I havenā€™t setup a Pico. If I get a chance, later on today Iā€™ll grab a spare Pico W and try and connect it to my ISP supplied WIFI. It uses a long password like yours does. Mine has capital letters in it, and that caught me out, I had typed in lower case.

Thank you for your reply! In my case the password is a twenty-digit number. If you find something out, please let me know.

1 Like

I ran the code below on my Pico W. It was Flashed with the Pimoroni PicoW uf2 file. It timed out on the first run, but connected just fine on any subsequent run.

You could try running it and see what happens?

import time
import network

ssid = 'Wireless Network'
password = 'The Password'
 
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
 
# Wait for connect or fail
max_wait = 10
while max_wait > 0:
    if wlan.status() < 0 or wlan.status() >= 3:
        break
    max_wait -= 1
    print('waiting for connection...')
    time.sleep(1)
 
# Handle connection error
if wlan.status() != 3:
    raise RuntimeError('network connection failed')
else:
    print('connected')
    status = wlan.ifconfig()
    print( 'ip = ' + status[0] )
>>> %Run -c $EDITOR_CONTENT
connected
ip = 192.168.2.29
>>> 

Connecting to the Internet with Raspberry Pi Pico W

I had the same problem. Turns out the set up interface was truncating the password. You can see this if you rerun the setup, it will show truncated password.

The flash version that came with the Enviro hangs up trying to make the wifi connection. This prevented Thonny from connecting to the device.

I flashed the latest Enviro version which did not fix the problem but did allow access via Thonny. Edited main.py to fix the password and the wifi connected.

1 Like

Thanks Curt, I was hoping somebody that had a Pico Enviro would chime in.

I have a Pico Enviro+ but itā€™s not running the custom Enviro firmware. It doesnā€™t even have a Pico W attached, just a Pico. I flashed it with the Pimoroni Pico uf2. It displays the senor readings, but doesnā€™t upload anything to the cloud. Very basic setup.

Hello alphanumeric, I flashed ā€œpimoroni-picow-v1.21.0-micropython.uf2ā€ to a second Pico HW and uploaded your code with Thonny. This worked without any problem. :-)

After that I flashed ā€œpimoroni-picow-v1.21.0-micropython.uf2ā€ to my Enviro indoor and the code worked again. :-)

At last I flashed ā€œpimoroni-enviro-v1.21.0-micropython.uf2ā€ to my Enviro indoor. I copied the exact same code to the device but no luck this time.

Iā€™m getting the following error:

MPY: soft reboot
waiting for connection...
Traceback (most recent call last):
  File "<stdin>", line 22, in <module>
RuntimeError: network connection failed

I guess itā€™s not the Picos fault, but it has something to do with the Enviro indoor.

Hello Curt, thank you for your advice. After the initial setup, I edited the config.py file via Thonny and inserted my Wifi password. Unfortunately, this is not working here. How did you edit the main.py to insert ssid and password there?

Thank you and best regards,
Alex

Sonyfreak

I actually modified config.py to get the wifi working:

# enviro config file

# you may edit this file by hand but if you enter provisioning mode
# then the file will be automatically overwritten with new details

provisioned = True

# enter a nickname for this board
nickname = 'dev'

# network access details
wifi_ssid = "My SSID"
wifi_password = "Way too Long password"

# how often to wake up and take a reading (in minutes)
reading_frequency = 15
#reading_frequency = 1

# how often to trigger a resync of the onboard RTC (in hours)
resync_frequency = 24

# where to upload to ("http", "mqtt", "adafruit_io", "influxdb")
destination = ''

# how often to upload data (number of cached readings)
upload_frequency = 5

# web hook settings
custom_http_url = ''
custom_http_username = ''
custom_http_password = ''

# mqtt broker settings
mqtt_broker_address = ''
mqtt_broker_username = ''
mqtt_broker_password = ''
# mqtt broker if using local SSL
mqtt_broker_ca_file = None

# adafruit ui settings
adafruit_io_username = ''
adafruit_io_key = ''

# influxdb settings
influxdb_org = ''
influxdb_url = ''
influxdb_token = ''
influxdb_bucket = ''

# grow specific settings
auto_water = False
moisture_target_a = 50
moisture_target_b = 50
moisture_target_c = 50

# compensate for usb power
usb_power_temperature_offset = 4.5

main.py was modified to a custom UDP interface. This is the display:

Curt

I flashed the ā€œpimoroni-enviro-v1.21.0-micropython.uf2ā€ to my Pico W and the code i posted above worked OK.

 >>> %Run -c $EDITOR_CONTENT
waiting for connection...
waiting for connection...
waiting for connection...
waiting for connection...
waiting for connection...
connected
ip = 192.168.2.29
>>> 

Next step is to look up how that provisioning etc is done. I think Iā€™ll do that on my Pico Enviro+. I have my current main.py saved to my PC so no big deal setting it back up when Iā€™m done.

EDIT: All flashed and ready to provision, this PC doesnā€™t have any WIFI, lol.
Will have to go find a WIFI dongle, or boot up my Laptop or my Pi 400.

Will have to wait until after my morning walk though.

Mine isnā€™t showing up in my list of Wireless networks?
Pico W & Pico Enviro+ Pack
pimoroni-enviro-v1.21.0-micropython.uf2

Maybe because I donā€™t have a Poke button?