Greetings"
I recently purchased a Pico Enviro + Pack and I am trying to use the Enviro_all_mqtt.py program to sensor data to Adafruit IO data logging/display site. I cannot seem to get the data to display on the Adafruit site. Has anyone out there tried to do this and be able to assist me?
In the enviro_all_mqtt.py --------- There are four lines that need to properly filled in.
I need some help with with placing the correct info in these places. I have tried putting my Adafruit username and key into the bottom two lines, but cannot get it work, and sure what to put line 2.
Any help would be greaqtly appreciated
thanks
Tom
Hello! Thereās some documentation here about what settings you need to post MQTT data into Adafruit.io here: Adafruit IO API Reference . Itās quite particular about formatting, so youād probably also need to tweak the example to format your MQTT data in the way it expects - Adafruit IO API Reference
I found the HTTP API easier to figure out than the MQTT one - hereās my (possibly hacky) code that posts data to Adafruit that way: Enviro + into adafruit.io Ā· GitHub
Thanks for the info.
I have some addition questions.
On the Pico enviro + pack, when I send using enviro_all_mqtt program developed by Pimoroni, I get an IP address, then it says wait minute. The LED above the display lights up red. Is this an error with the program? If so, the program must have some sort of problem, as there is also an error message displayed, I believe at line 275. Has the Enviro_all_ mqtt.py actually been tested by Pimoroni?
In the enviro_all_mqtt.py program should the Adafruit IO address line also include the group name?
Your program that you included at the end of the email.
Is that program for the Pico enviro+ pack?
I would like to try if out.
I ran the ā[enviroplus_into_adafruitio.pyā mentioned in you post to me.
I get an error message Error: 401 bāUnauthorizedā , at the same time the LED above the LCD displays in red while the program runs.
Should the LED display red?
What does the error mean?
I am so frustrated with this project!!!
tom
I wrote (and tested!) the MQTT example, but I wrote it for the purposes of sending data into Home Assistant, not Adafruit.io. MQTT is just a protocol for sending messages, different services will require data formatted in different ways to be able to accept it. The MQTT API documentation I linked to above will tell you the format in which the data needs to be sent if you want to adapt it to work with Adafruit IO.
Yes, the code I linked above is for Enviro + Pack. 401 bāUnauthorizedā suggests your login credentials might be wrong, did you add in your adafruit username and key on lines 25 and 26?
If youāre using a free Adafruit.io account you might want to grab the updated code from Enviro + into adafruit.io Ā· GitHub - Iāve reduced the number of feeds it sends as it was exceeding the data limits and giving me an āunprocessable entityā error.
I loaded your latest enviroplus_into_adafruitio.py into the Pico enviro + Pack.
With the addition support packages and I was successful in sending data to Adafruit IO. - yea
A few questions
I now need to be able to display all 9 data items at once - is that possible?
In your program - I assume you are still displaying pm1, pm2.5 and pm10 - I only saw zeros for those three items?
Is it possible to send some of the other pm data displayed in the simple pm5003.py demo?
Thanks so much for your help
I will now study the program and the Adafruit IO in more detail.
Thanks much
Tom
I now need to be able to display all 9 data items at once - is that possible?
You mean display your data on Adafruit.io? You can do that by setting up a dashboard - thereās some instructions on how to do that in the Enviro tutorial (scroll down to the section on āviewing your data in adafruit.ioā)
In your program - I assume you are still displaying pm1, pm2.5 and pm10 - I only saw zeros for those three items?
Is your Enviro+ inside? My particulates look to be reading in the 0-1 range most of the time if I donāt have the window open (unless Iām soldering something!).
Is it possible to send some of the other pm data displayed in the simple pm5003.py demo
Yep, the pms5003.read() grabs all the data from the particulate sensor, so you could edit or add more lines to the section that sends the data (under #format our data for adafruit.io) to send different data from this sensor.
Thereās a basic particulate sensor example here that should show you what other data is available.
Hel
I am getting more familiar with the Pico enviro + pack and data sending.
I have a question ā I got everything working pretty well now, i want to make the enviroplus_into_adafruitio.py program start automatically from a external battery on startup of the pico enviro+ pack. I changed the program name to main.py but that did not allow the program to start automatically? How can start the program automatically?
thanks
tom
Yep, saving your program as main.py should make it run automatically.
Some USB battery packs donāt start supplying power automatically when you plug something in, and some wonāt supply power if the current draw isnāt high enough - might be worth checking if thatās what is happening?