I've been recently bumbling through the weather station setup tutorial. Had some issues with CIRCUITPY filling up, but have managed to clear out the drive, thanks to help from the forum. Have a couple more questions on getting set up.
1. Do the icons get loaded to the SD card? Should they be at the root of the card, or a folder?
2. What is needed to get the openweather token?
3. What is aio? Adafruit I/O? For the weather station application, what is aio used for?
4. What is used for location? Is there a look up for these locations? Unfortunately city name, country code is not unique enough. My city name is in multiple states, how is this resolved?
I am finally doing this project. I bought the Titano a while back, with high hopes, but realized I needed to make a housing for it. At the time of purchase, I didn't have access to a 3d printer. Now that I do, I'd like to get this going again.
At the moment, the display is showing retro weather on the display, but the code is looping trying to connect to Adafruit I/O. Since I don't have an account, it is failing. That's ok, for the moment, but inspecting code.py and openweather_graphics.py it's hard to tell what aio is used for.
Thanks for any additional insight.
Titano Weather Station set up questions
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
I have entered in the openweather token, and my aio username and key. Not sure about the location at the moment, so I left it as NY. I am getting the following output to the console.
I obviously need to burn the SD card with the icons - have to find a small one to use. Something is Unauthorized, but the error messages are not illuminating (to me).
Edit: I did find out that the weather api key was assigned but has not been activated yet... Seems I am too anxious to get started! Don't know if there's anything else wrong...
Code: Select all
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
No SD card found: no SD card
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Warning: The group property is being deprecated. User code should be updated to add the Button directly to the Display or other Groups.
Set icon to /weather_background.bmp
Getting time from internet!
Connecting to AP BANNED
Getting time from IP address
Retrieving data...Traceback (most recent call last):
File "code.py", line 172, in <module>
File "adafruit_pyportal/__init__.py", line 311, in fetch
File "adafruit_portalbase/network.py", line 553, in check_response
HttpError: Code 401: Unauthorized
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
Edit: I did find out that the weather api key was assigned but has not been activated yet... Seems I am too anxious to get started! Don't know if there's anything else wrong...
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
Formatted a SD card and copied the icons folder to it. Everything seems to work so far, except for buttons and stuff. Loaded the city, state and country and it seems to be the correct location according to the retrieved data. Upon start up, the ESP seems to have a problem finding my SSID, on the second try it finds it and connects.
I opened a file to look at it and the PyPortal rebooted. I hadn't changed the file. Hadn't expected that, but oh well. Looks like I can order some buttons and parts and print a case for this.
Maybe I can make some changes to the code to add more info. I'd like to add humidity, wind speed and "feels like" to the display. That should be fun. Interesting the temperature is in degrees Kelvin.
I opened a file to look at it and the PyPortal rebooted. I hadn't changed the file. Hadn't expected that, but oh well. Looks like I can order some buttons and parts and print a case for this.
Maybe I can make some changes to the code to add more info. I'd like to add humidity, wind speed and "feels like" to the display. That should be fun. Interesting the temperature is in degrees Kelvin.
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
Hmm, occasionally this error happens.
Is there some way to inspect these compressed mpy files? On my OS, they look like this:
CIRCUITPY/lib/adafruit_esp32spi/adafruit_esp32spi.mpy
I do not find this particularly readable. Are there human readable files available?
More to the point, is there a way to increase the timeout, or at least retry? This app should be tolerant to a missed read cycle, shouldn't it?
Code: Select all
Retrieving data...Traceback (most recent call last):
File "code.py", line 172, in <module>
File "adafruit_pyportal/__init__.py", line 307, in fetch
File "adafruit_portalbase/network.py", line 505, in fetch
File "adafruit_requests.py", line 820, in get
File "adafruit_requests.py", line 676, in request
File "adafruit_esp32spi/adafruit_esp32spi_socket.py", line 141, in recv
File "adafruit_esp32spi/adafruit_esp32spi.py", line 792, in socket_read
File "adafruit_esp32spi/adafruit_esp32spi.py", line 332, in _send_command_get_response
File "adafruit_esp32spi/adafruit_esp32spi.py", line 288, in _wait_response_cmd
File "adafruit_esp32spi/adafruit_esp32spi.py", line 197, in _wait_for_ready
TimeoutError: ESP32 not responding
Code done running.
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit PyPortal Titano with samd51j20
CIRCUITPY/lib/adafruit_esp32spi/adafruit_esp32spi.mpy
Code: Select all
C \87\Z\00Ladafruit_esp32spi/adafruit_esp32spi.py` \80((00P&\85A$$$$$$$$$$D&&$$$$$$$$$D$$$d@\00\80Qstruct\80Qtime\80\00H*\00s\00H\00HY\80SPIDevice*<adafruit_bus_device.spi_deviceY\80Direction*digitalioY
5.0.5__version__#\00__repo__\80SOCKET_CLOSED\81SOCKET_LISTEN\82SOCKET_SYN_SENT\83SOCKET_SYN_RCVD\84$SOCKET_ESTABLISHED\85"SOCKET_FIN_WAIT_1\86"SOCKET_FIN_WAIT_2\87"SOCKET_CLOSE_WAIT\88SOCKET_CLOSING\89SOCKET_LAST_ACK\8A SOCKET_TIME_WAIT"\81WL_NO_SHIELD"\81WL_NO_MODULE\80WL_IDLE_STATUS\81 WL_NO_SSID_AVAIL\82"WL_SCAN_COMPLETED\83WL_CONNECTED\84"WL_CONNECT_FAILED\85$WL_CONNECTION_LOST\86WL_DISCONNECTED\87WL_AP_LISTENING\88WL_AP_CONNECTED\89WL_AP_FAILED\80ADC_ATTEN_DB_0\81 ADC_ATTEN_DB_2_5\82ADC_ATTEN_DB_6\83ADC_ATTEN_DB_11T2ESP_SPIcontrol4Qcs?https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI.git\93x\94Ladafruit_esp32spi/adafruit_esp32spi.py\8C\86`$$d\8F\85\85\8F4\85\8A\85e`\8F#y\80\8A\8A\8A\8A
\85 \85\85\8A\85\85 e`e`e`e`e`e`e`\85j`j`\8A\8A j@\8A \8A e`e@\89\8A(e e@\85
\8B
\85
\89!\85e \89+\85 \85\89\85\8Ae`\85\85\85\85\85
\85\89\85\85\00\00\00\00\80TCP_MODE\81UDP_MODE\82TLS_MODEQ*,\00P
debugb3\002
reset2_wait_for_readyQ*,\00Pparam_len_16b3_send_command2_read_byte\80Q*S3_read_bytes2_wait_spi_char2_check_dataQ*,\00Pb3 $_wait_response_cmdQ*,\00\81reply_paramsbP"sent_param_len_16bP"recv_param_len_16b3
4_send_command_get_responseproperty24status24 firmware_version2
4MAC_address24$MAC_address_actual2&start_scan_networks2"get_scan_networks2scan_networks#\00*S3set_ip_config2set_dns_config2set_hostname2 wifi_set_network2&wifi_set_passphrase2(wifi_set_entidentity2(wifi_set_entusername2(wifi_set_entpassword2$wifi_set_entenable2(_wifi_set_ap_network2._wifi_set_ap_passphrase24ssid24
bssid24rssi2 4network_data2
More to the point, is there a way to increase the timeout, or at least retry? This app should be tolerant to a missed read cycle, shouldn't it?
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
I seem to have an issue with getting updated weather reports. The neopixel is showing blue, but the reports are not updating. It's kind of easy to see, when it says it is sunny out and the sun has set. Can someone make some suggestions on how to diagnose this? This is after running 12 hours or so. If I remove the power and start it again, it works fine for a while. Then the weather and temperature are not updated. Time seems to be locally updated, I have not seen the time drifts at all.
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
It seems the issue is with openweather. I tried manually exercising the api and it more or less is the same as the Weather Station. But openweather isn't matching reality that well. It's pretty sunny right now, blue sky with occasional clouds. Hardly what I would justify using Clouds / Broken clouds.
Norwegian Meteorological Institute is showing a sun with a couple of clouds, which is appropriate. Their temperature seems to be closer to reality as well.
Still have to figure out why the app is displaying Sunny at night... That's not right!
Norwegian Meteorological Institute is showing a sun with a couple of clouds, which is appropriate. Their temperature seems to be closer to reality as well.
Still have to figure out why the app is displaying Sunny at night... That's not right!
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
Openweather is not very good. It has been sunny all day and not once has the icon been sunny. It has only showed clouds all day.
Not only that, at 4:15PM, it is now showing light rain and 37F. The sky is clear and the sun is still up. Openweather must be serving me weather from some other location than what I gave it!
However, they are providing my location coordinates, but the weather is TOTALLY WRONG!
This is proving to be pretty frustrating and a totally unreliable gizmo. Certainly not worth wasting my time to print the housing... It's been a terrific sunny day with a few clouds in the sky, more than 80% of the time the sky was totally blue. Yet, the returned weather has been colder and far cloudier than actual. Not once was there a sunny or even partly sunny icon. Why my location yields wrong weather is beyond me. I don't really know how to diagnose this.
Seems that I'm babbling to myself here...
Not only that, at 4:15PM, it is now showing light rain and 37F. The sky is clear and the sun is still up. Openweather must be serving me weather from some other location than what I gave it!
However, they are providing my location coordinates, but the weather is TOTALLY WRONG!
This is proving to be pretty frustrating and a totally unreliable gizmo. Certainly not worth wasting my time to print the housing... It's been a terrific sunny day with a few clouds in the sky, more than 80% of the time the sky was totally blue. Yet, the returned weather has been colder and far cloudier than actual. Not once was there a sunny or even partly sunny icon. Why my location yields wrong weather is beyond me. I don't really know how to diagnose this.
Seems that I'm babbling to myself here...
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
Continuing this stream of consciousness. Weather report is Clouds, Overcast clouds. Maybe 30-50 miles west of here, but not here. Pale blue sky. Some clouds near the western horizon, but blue overhead. Man, this is the most pessimistic weather report, I've ever experienced. If you took the report to heart, you'd be depressed!
04d.bmp
It's been a lot nicer than that today. Don't have any idea why the report is "clouds": {"all": 94}, it is a lot sunnier than that. Now it says '"all":0, the next report just 10 minutes later. The weather hasn't actually changed in this location. So strange. Think this particular source of weather information has issues. I need to find a more reliable source.
04d.bmp
It's been a lot nicer than that today. Don't have any idea why the report is "clouds": {"all": 94}, it is a lot sunnier than that. Now it says '"all":0, the next report just 10 minutes later. The weather hasn't actually changed in this location. So strange. Think this particular source of weather information has issues. I need to find a more reliable source.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Titano Weather Station set up questions
When you go into Openweather and search your city is it more accurate?
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
I have tried search my city, using zipcode, and even lat, long. The main openweather app is either using lat long, or migrating to it. On the openweather website, it seems that they are pushing to use their own geolocation lookup. At the moment using the existing 2.5 api, all seem to yield weather reports. Curiously, they are at slightly different lat, long locations. Not by much, but slightly different. NOAA uses yet a slightly different location, so it's been frustrating. I might try sending the lat long of the NOAA location and see what happens.
I will check to see if the reports at your url are better. Will do some spot checks during the day. What makes this a bit confusing (but may be a red herring) is the fact that there are 7 places in the US with the same name. I have checked the lat long, and at least it's close, but it does give me pause. Perhaps this is just a pessimistic server, and I'm more of an optimist?
Adding to the befuddlement, occasionally, a report is missed. Don't know why - even when connected to a charging port. Could be some wifi problem with traffic related dead spots. Or maybe me moving stuff on my desk. When this happens, I have to reset the board. This happens maybe once every day or two. Whatever the cause, it adds to my "mistrust" of the appliance. It's a pity, since it is a pretty cool gizmo. If I can build up enough confidence in this running and serving weather that's believable, I will print up the enclosure. So far, that confidence has not been achieved.
I will check to see if the reports at your url are better. Will do some spot checks during the day. What makes this a bit confusing (but may be a red herring) is the fact that there are 7 places in the US with the same name. I have checked the lat long, and at least it's close, but it does give me pause. Perhaps this is just a pessimistic server, and I'm more of an optimist?
Adding to the befuddlement, occasionally, a report is missed. Don't know why - even when connected to a charging port. Could be some wifi problem with traffic related dead spots. Or maybe me moving stuff on my desk. When this happens, I have to reset the board. This happens maybe once every day or two. Whatever the cause, it adds to my "mistrust" of the appliance. It's a pity, since it is a pretty cool gizmo. If I can build up enough confidence in this running and serving weather that's believable, I will print up the enclosure. So far, that confidence has not been achieved.
- BDL
- Posts: 158
- Joined: Wed Jan 09, 2019 10:45 pm
Re: Titano Weather Station set up questions
The most annoying thing I find is the ESP32 is not responding. I am getting timeout errors. And then it quits. Is there some way to modify how long a timeout is? Or how many tries? For folks with perfect maintained internet and IT, this might work great, but here at home this unit won't function as an internet appliance because it doesn't keep trying to connect - it gives up. Can I change something somewhere to fix this? There's no reason this can't be more resilient!
Where can I find the source code? Not the mpy files which are not helpful at the moment!
Code: Select all
1:31 PM
Wed., Jan. 25, 2023
Retrieving data...Traceback (most recent call last):
File "code.py", line 172, in <module>
File "adafruit_pyportal/__init__.py", line 307, in fetch
File "adafruit_portalbase/network.py", line 505, in fetch
File "adafruit_requests.py", line 820, in get
File "adafruit_requests.py", line 676, in request
File "adafruit_esp32spi/adafruit_esp32spi.py", line 792, in socket_read
File "adafruit_esp32spi/adafruit_esp32spi.py", line 332, in _send_command_get_response
File "adafruit_esp32spi/adafruit_esp32spi.py", line 288, in _wait_response_cmd
File "adafruit_esp32spi/adafruit_esp32spi.py", line 197, in _wait_for_ready
TimeoutError: ESP32 not responding
Code done running.
Please be positive and constructive with your questions and comments.