Giter Club home page Giter Club logo

pico-rgb-matrix-weather-clock's Introduction

Pico-RGB-Matrix-Clock

LED Matrix Clock with Open Weather Map enabled weather running on a Raspberry Pico W and a WaveShare Pico-RGB-Matrix-P3-64x32

NOTE: THIS PROJECT HAS BEEN UPDATED AND REQUIRES CircuitPython 9.0.0 or later

This project requires that you use circuitpython 9.x.x. If you still wish to use 8.x you will need to use an older release

Weather APIs

An account on Open Weather Map (OWM) is required to display the current conditions and the current condition icon.

Go to the OWM sign up and using the free subscription is enough to create a working Token for this project. Put the token from the OWM API Keys page into the settings.toml file in the OWM_API_TOKEN="" setting. OWM uses your geolocation which gets looked up via the Geolocation API, for this you need to provide your zip code and the Country under OWM settings listed below.

NTP Servers

You can define up to 3 NTP servers, one primary and two fallbacks, to use for time synchronization. The servers are separated by a "pipe" | character. You can find a list of NTP Servers to use if you need something closer.

Settings

Requires a settings.toml file with the following settings in settings file. A settings.toml.default file has been provided with the required settings for the application. Copy or rename the settings.toml.default file to settings.toml.

  • WIFI_SSID="your ssid"
  • WIFI_PASSWORD="yoursupersecretpassword"
  • NTP_HOST="0.adafruit.pool.ntp.org|0.us.pool.ntp.org"
  • TZ_OFFSET=-5
  • NTP_INTERVAL=21600 ie 21600 = 6hr, 43200 = 12hr, 86400 = 24hr
  • UNITS="imperial" ie imperial or metric

openweathermap.org Data Authorization

  • OWM_ENABLE_WEATHER=1 # 0 disables weather, removing or setting to 1 enables weather
  • OWM_API_TOKEN="Your Token"
  • OWM_ZIP="zip/post code"
  • OWM_COUNTRY="US" # Please use ISO 3166 country codes

Persistent Settings

To enable you must rename the _boot.py file to boot.py on your device.

With this setting enabled any changes to the in menu setting ( Buzzer/ Autodim / 12/24 hr clock / DST Adjust ) will persist when you turn the device off and turn it back on again.

Settings:

  • APPLY DST - Moves time ahead by 1 hour (you must manually turn it on and off) ** Only Works with NTP enabled **
  • BEEP SET - Turns the beeping for button presses on and off
  • AUTODIM - When the light sensor detects darkness it will dim the display (turn the LED display off).
  • 12/24 HR - Changes the clock between 12 and 24 hour display.

NOTE When boot.py is enabled the drive becomes read only for your computer, to make changes you must hold down the menu / KEY0 button (Bottom button) when you turn on the device. This setting is only read at boot and restarting will have no effect on this setting.

Board

This project requires the use of a Raspberry Pico W to use the WIFI for getting information for displaying on the screen such as updated time, and local weather.

CircuitPython 9.0.0

This project requires that you use circuitpython 9.x.x.

Libraries

Circuit libraries are included in the ./lib/src folder, just copy the ./src folder to the Pico. Most of the libraries are located on the CircuitPython libraries page. Notes:

  • The IR_RX library is located on github.

Clock

Connects to a Network Time Protocol server (0.adafruit.pool.ntp.org) and sets the onboard DS3231 RTC based on the time from the NTP response.

Images

figure 1 figure 2 figure 3 figure 4

Code Standards

This project moving forward will be converting changed code to loosely meet the google python coding standard.

pylint settings

To ignore the code.py overriding the std lib error add the following to your .vscode.json config file.

  "python.languageServer": "Pylance",
  [...]
  "python.analysis.diagnosticSeverityOverrides": {
      "reportShadowedImports": "none"
  },

pico-rgb-matrix-weather-clock's People

Contributors

jake1164 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pico-rgb-matrix-weather-clock's Issues

Stream api

The whole API call gets read into memory which limits the API feeds we can use. Switching to reading the stream and pulling out the fields we are looking for would allow us to use the better_weather API.

All weather info doesn't update

The numerical temperature, feels like, humidity and wind will only be correct if the unit is powered of and then back on. The current conditions seem to be correct but difficult to tell as it can be clear skies the whole day for example.

Reduce resync type if NTP fails to sync.

On startup sometimes the NTP call will fail to sync, we should not wait the full time to sync.. maybe resync in a set shorter time like 1 min after the network settles.

Create a wind speed gauge

I am thinking a circle with the direction colored and the wind speed in the center. Not sure how to indicate gusts yet.

Add dark mode

Instead of the current method of just turning LEDs off when its dark we could change the colors to red to emit less blue lights.

For first go round I am suggesting just using the dimmer and have three settings based on brightness.
The dimmer would enable turning off leds like it currently does.
Add setting for night mode that will turn on / off the red color.

Discussion welcome

Month on new date format

Not sure if it's happening to everyone, but my clock is displaying May 1st.

Maybe it's an April Fools joke?

Display the version

During build process create a .version file with the latest version that can be copied and read by the code.

Display the latest version somewhere:
Suggestions:

  • really small font
  • add to the scroll
  • press button to display
  • add to settings

New pico has memory issue

Purchased a new pico W and I am seeing constant messages:

free memory 6592
free memory after 3488
Exception memory allocation failed, allocating 256 bytes

Need to look into this and compare with previous pico.

Settings screen flashes

When in the set a specific setting.. like set light level or change time the display flashes on and off really fast.

Display some indication that wifi is not working (or internet)

Currently if the WIFI or Internet drops the clock continues to display the last reading. For an extended time that could be very misleading.

If an update has not happened in last n seconds or tries we should not display the setting anymore (ie Temperature).
If the WIFI is down we should also perhaps replace the temperature with a wifi symbol with a line though it.

Add unit tests

Project is way to big to not have unit tests. Needs to be a priority.

12 hour for the pico w as well

Thanks for fixing the pico 12 hour time, Iโ€™m using the pico w code de which I should have mentioned. Could you add it to that one as well? Thanks!

Open Weather not displaying.

This appears to be related to the autodim / on & off times. When the time is outside the settings it turns off the scrolling but the display does not turn off until the light is dim enough to activate autodim.

Add icon sprite for status

Add the following sprites to a new status bitmap:
*no WIFI connection
*Disabled weather
*No NTP update?

Weather clock

Just updated everything from the old code that just had the date, time, day. I'm using the latest weather src you added. I've added all needed information in the settings.toml file. Added the whole src to my pico w and ran the code. I have the splash screen (sun) then the display goes black.

Thonny shows correct output of all info supposed to be displayed, however nothing is being displayed.

I did however see for a brief moment the display did display the weather, time, conditions. But then it went back to a black screen.

Long API timeouts

Now that the temperature will go away API failures have become more evident. I now often see no temperature displayed and we probably need to try and investigate if its the API, Size related or the WIFI connection dropping.

Split repository into two separate projects

After much debate I think its better to have dedicated OWM and Tempest repositories. It will mean updating common bugs twice, however, it will make things more simple from an end user perspective.

Night mode (off / on) not working as expected

Having the display turn off at night and back on in morning works, but playing with the times it does not work for all combinations.

Turn off at 8am and on at 9 am for instance does not work.

Fresh install, can't get anything working.

I reinstalled all code from the zip file, edited the settings.toml with my api and wifi and I'm getting an openweather error. I created a new api and still won't load pas the sun icon and dev text. I'd like to get this working but ran out of time today to fiddle with it.

Also, do you think maybe we can get a code without weather, just date and time. May be an option to revert to until the weather can get sorted out. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.