I am very very new to python and thorny and Pico. As a Geography department, we have brought a Pico 2 wireless and enviro+ and want to send air pollution data to sensor community.
We have a username for Sensor community all set up, but I can’t seem to get the Pico serial number that we need, and then the code to update to sensor community.
I have got the enviro+ up and running.
If there is a better website to upload data then I am happy to try it out.
I don’t think Picos have a convenient serial number like Raspberry Pi computers do, but when I had an Enviro Urban posting into Sensor Community a few years ago I did this to generate a unique text string to use as an ID:
import machine
import ubinascii
id = "raspi-" + ubinascii.hexlify(machine.unique_id()).decode()
Here’s the link to my modified http.py - as you’re using a Enviro+ Pack the code probably won’t be too useful to you as is, but the formatting of the request might be:
Looks like I also wrote some code to post data from Enviro+ Pack into Adafruit IO:
The Pico does not have a unique serial number, but the flash-chip has. You can see it e.g. when you plug in a Pico in the logs (at least with a decent operating system). There is also an API in the C-SDK (see hardware_flash).
From MicroPython you could try machine.unique_id() and see if this is the flash-number. The docs aren’t very specific, it could also be the MAC.