Introduction: Raspberry Pi Internet Weather Station

Picture of Raspberry Pi Internet Weather Station

This Instructable will show you how to build a really cool Raspberry Pi Internet-based weather station. Actually, to call this build a "weather station" is a bit of an under statement. This build could easily be extended to provide much more than simply the weather. However, it's a good start and it looks really cool on my desk.

Our family (OK, mostly me) has enjoyed having the family iPad on the kitchen counter, when not in use, quietly showing the current outside weather conditions. However, it's a pain to load and unload the iPad in and out of the arcade cradle case. Plus, just when I go to look at the weather, I discover someone has taken the iPad / weather display. What's needed is a permanent counter-top display that the kids are not going to swipe like the iPad.

Step 1: Gen 1 - the Lunchbox Pi Weather Station

Picture of Gen 1 - the Lunchbox Pi Weather Station

My first thought was to use a little composite video display. I picked up the one in the picture on Ebay for $22 bucks - simply search on "4.3 Inch TFT LCD Car Rear View Monitor Car Monitor". The display has a reported resolution of 656 by 416 pixels which defiantly makes displaying a lot of useful information a challenge! The display requires 12Vdc as the supply voltage. The Raspberry Pi, of course, needs 5Vdc as the supply voltage. To resolve this, I bought a cheap USB car charger from Amazon. For around $6 bucks I found a 5Vdc by 2 Amp car changer. Therefore, the lunchbox has an external 12Vdc wall wart power supply. The 12Vdc powers the display directly. The 12Vdc also goes to the USB car charger which steps the voltage down to a regulated 5Vdc. As a final hack, I soldered a pair of wires directly between the car charger and the Raspberry Pi - not my best idea.

While it all kinda worked I was not really satisfied with the quality of the video on the composite display. The small font on the display was more fuzzy than I would like. Plus, while the lunchbox at first seemed cute later it seemed kinda cheesy.

Step 2: Gen 2 - HDMI Monitor + Laser Cut Plexiglass Arcade Case

Picture of Gen 2 - HDMI Monitor + Laser Cut Plexiglass Arcade Case

Back on eBay I found a nice looking $54 dollar HDMI open frame monitor with a resolution of 800x600. By definition, an open frame anything needs a frame to mount in. Since the cuteness of the lunchbox was long over it was time for some laser cut acrylic. My local hacker space i3Detroit has a really nice 150 watt cutter that can make mince meat of 4.5mm acrylic.

I loosely based my arcade enclosure on the iPad arcade box. If I ever make a Gen 3 design it would defiantly include a removable / slide out tray for the Pi. Turns out, it's a major pain in the neck trying to plug things in and out of the Pi since there is not much room between the Pi and the side walls.

The HDMI monitor also requires a 12Vdc feed. So, I used the same trick of using a USB car charger again. This time, however, I chopped up an old USB cable so soldered wires on the Pi was not required.

If anyone is interested in the arcade case post a comment below and I'll upload the DXF files. Or, the files are on my web site at ph-elec.com.

Step 3: Pi Setup

Picture of Pi Setup

To setup a new Raspberry Pi with the needed software is not that hard. All the software is written in Python with just one added Python module. The extra Python module is called "pywapi". Here is a link where you can download the module. This module makes it easy to get real-time weather from either Yahoo, Weather.com, or NOAA.

First things first, here is a checklist to setting up a raw Raspberry Pi:

  1. Download the latest Raspbian (Debian Wheezy). Unzip to obtain a .img file.
  2. Write the to a SD card with "dd bs=4M if=2014-09-09-wheezy-raspbian.img of=/dev/sdb"
  3. The dd command takes about five minutes. When complete, run "sync" to flush the pipes.
  4. Install SD card in the Pi and reboot. Make sure there is an Ethernet connection to the Pi.
  5. Using the "Attached Devices" page on the router, find the IP address of the new Pi.
  6. Login to the Pi using "ssh pi@192.168.1.???" where ??? is the IP number from above. Password will be "raspberry".
  7. On the Pi, use the command "raspi-config" to setup defaults.
    1. Turn on automatic boot into the GUI.
    2. Set the host name to something like "MyPi".
  8. Install VNC on the Pi with "sudo apt-get install tightvncserver".
    1. Run "tightvncserver" which sets the password.
  9. Back on the big Linux box, use "Remote Desktop" to view the Pi GUI desktop.
    1. Set Protocol to "VNC" and IP number to "192.168.1.???:1". Note the ":1" on the end of the IP number.
    2. Hit the connect button and supply the VNC password.
    3. Bingo, remote GUI Pi desktop!
      1. This saves dragging out a monitor, keyboard, and mouse to connect up to the new Pi.
    4. On the desktop, run the WiFi setup icon. Setup the new Pi / USB WiFi to connect to the network.
    5. Close the VNC connection - we're now done with remote desktops.
  10. Back in the ssh window, reboot the Pi with "sudo reboot". Disconnect the Ethernet cable since the WiFi is now setup.
  11. Back on the home router, find the new IP number the Pi is using with WiFi.
  12. Using ssh, log back in using the new IP number. This time the connect will be over WiFi.
  13. Using the Files Manger on Linux, connect to the Pi using the "connect to server" command.
    1. The server address is "sftp://192.168.1.???/home/pi".
  14. Basic setup complete.

Next, the pywapi needs to be downloaded and installed. Again, this is not too hard with the following steps:

  1. Download the latest from here. Extract the archive into a new directory.
  2. Using File Manger, copy the directory to the Pi home directory.
  3. Using ssh, do the following on the Pi:
    1. cd pywapi-0.3.8
    2. sudo python setup.py build
    3. sudo python setup.py install
  4. Done.

Update, I forgot two mention two other things:

  1. On the Pi run the following command:
    1. sudo apt-get install avahi-daemon
      1. This allows connecting to the Pi by name. So, on your main computer you can connect as "ssh pi@MyPi.local" instead of using IP numbers. With multiple Pi's on the network it's easy to get them confused unless called out by name.
    2. sudo raspi-config
      1. Look for and run the 4th option called "Internationalisation Options" and set your timezone.
      2. With the timezone set and ntpd (network time protocol daemon) running the Pi will always display the correct time to within a couple milliseconds! Gotta love it.
  2. OK, now we're done again.

Step 4: Source Code

Picture of Source Code

All the source code for this little weather display is based on Python, PyGame, and Pywapi. All open source / free software.

PyGame is used to do all the GUI stuff. Really amazing stuff. Using PyGame, the entire display is rebuilt once per second. Near the top of my source code you'll find a section that allows tweaking for different display sizes. There is one section for the small composite video display and a second section for the larger HDMI display. I simply comment out one of the two sections based on the display size I need.

To get my source code running just unzip the attachment and copy the whole directory onto the Pi using File Manage. Once copied, start the code use the following ssh commands:

  1. cd Weather
  2. sudo python weather.py

The sudo command is needed so that Python can control / read the GPIO pins. There is probably some way around this restriction but it eludes me.

Once everything gets working using ssh it's time to get weather to start automatically on a reboot. This is also really easy to do.

  1. Using ssh, run "sudo vi /etc/rc.local"
  2. Just before the last line, which says "exit 0", add the following to lines.

    1. cd /home/pi/Weather
    2. sudo python weather.py &> err.log

This will automatically start the weather application on the Pi after a reboot. If later you want to turn this off, just use ssh to edit the file and add the comment character "#" in front of both lines and reboot.

Note, my source code is a big hack and I'm not very proud of it. However, if I waited until it was presentable it never would be presented. So, take it or leave it just don't cry about as I have a very thin skin.

A couple of other things to note about my code. Buried down in there you'll notice some code to talk to an X10 device. This was my attempt to control my outside pole lights that are on address A3. I simply wanted the lamps on at dusk and off at dawn. Seems easy enough and I thought I had it working. Using a USB-to-RS232 dongle on the Pi I had connected a CM11A X10 module. The CM11A is an old X10 macro module. The CM11A also has a RS232 port that allows control over the X10 bus. Seems there are still some bugs because the lamp pole lights aren't getting the message!

Also of note, on the larger display there is a nice open gap along the right hand side of the display. My plan is add some status lamps in that area. I'm playing with some IEEE802.15.4 radios and their outputs will one day show up in that open spot.

For the latest and greatest updates please visit my web site at ph-elec.com.

Well, let me know in the comments section below any questions you may have.

Thanks, Jim.

Oh, and don't forget to vote for me! Thanks again.

BTW: There is always more info on my web site: www.ph-elec.com

Step 5: Metric Update

Attached is a new version that allows the display of either metric or imperial.

Hope this helps,

Jim

Comments

dario.maxall made it! (author)2015-04-05

I like your projects, it is a cool on and I have it working. I will soon upload photos as soon as I finish it.

Now, how can I change from Fahrenheit to Centigrade?, how do I add my zip code the weather?, right now I am pulling the information from the east cost. And I have like 10 degrees difference from where i live.

Thank you for your time and Awesome work !!!

jimk3038 (author)dario.maxall2015-04-18

Wow! Very cool to see someone getting it working too. Sorry for the long delay getting back to you.

I'm afraid the code is rather a hack. Really needs a rewrite. However, it does work for me.

I've recently patched up the code enough to run on the Adafruit SPI LCD. The SPI LCD, without an analog signals, looks really sharp and clear even for a small display.

To answer your question, look for the following line (around line #100):

w = pywapi.get_weather_from_weather_com( '48085', units='imperial' )

Change the units to 'metric' and the zip code to where you live. Of course, this should be in a config file that is loaded on startup.

Hope that works for you,

Jim

By the way, I'll attach the new code in an updated step in this instructable. There are some bug fixes for other stuff too.

jimk3038 (author)dario.maxall2015-04-18

Wow! Very cool to see someone getting it working too. Sorry for the long delay getting back to you.

I'm afraid the code is rather a hack. Really needs a rewrite. However, it does work for me.

I've recently patched up the code enough to run on the Adafruit SPI LCD. The SPI LCD, without an analog signals, looks really sharp and clear even for a small display.

To answer your question, look for the following line (around line #100):

w = pywapi.get_weather_from_weather_com( '48085', units='imperial' )

Change the units to 'metric' and the zip code to where you live. Of course, this should be in a config file that is loaded on startup.

Hope that works for you,

Jim

By the way, I'll attach the new code in an updated step in this instructable. There are some bug fixes for other stuff too.

Kalmat made it! (author)2017-11-08

UPDATE: I would like to upload the code so everyone can use it, but I don't know how to do it. Jim, I can send you an e-mail with the code so you can upload it if you want to.

Awesome. Great work!

I was playing with the idea of making a Weather Station on my pi for some time, but I didn't decide until I found this. Thank you so much for sharing, Jim

First off, I am an absolute noob in python. I have never used it before nor anything similar (except C, a long time ago). I say this because it is more than probable that things could be done better, shorter, or smarter... but it works (I tested it on various resolutions: 1024x600, 1920x1080 and 800x600... you can use/adapt your own, just setting the resolution on the Display section).

I made some minor changes that I wanted to share with you (the main core is still Jim's work):

- Removed all code I didn't need (I just wanted weather, so I removed calendar and X10 related code).

- Translated everything into spanish (should you want english back, just remove TranslateD() and TranslateT() functions, and change "Current Condition" literals. You can also remove elimina_tilde(), which will not be necessary)

- Added a "current conditions" section, including current conditions icon and descriptive text (in addition to the current outside temp which was there before).

- Current conditions will now take into account if it is day or night (aprox), and will show the Sun/Moon icon when suitable.

- Changed icons to (IMO) more fancy ones. I put additional icons as well, to cover more weather condition cases. Do not worry, icons are free for non-comercial purposes (special thanks to VClouds http://vclouds.deviantart.com/. See Readme file on icons folder)

- Set some colour-alarms for current temp: if it is higher than 32ºC, it will be shown on orange. If it is lower than 18ºC, it will be shown on blue. Otherwise, it will show on regular colour (very light grey). You can set your own limits (specially for Farenheit values), or disable it.

- Also set some colour-alarms for precipitation probability: 0%: white, 1-30%: orange, > 30%: red. You can also set your own limits or disable it (I am a biker, so this part is very important to me).

I bought a small 7" monitor and I love how it looks in my sitting room. My pi 3 now has Alexa, mpd/icecast2 music streaming station over Internet... and this brand-new Weather Station!

I hope this might be useful for all of you as well and, again, thanks Jim!

wborrelli (author)Kalmat2017-11-11

I changed the icons on my Pi, but I have no clue about coding in Python. I would love it if you could share your code around the look of your display. You could put it on a Google Drive share, or DropBox.

Your display looks really good.

I finally got mine running, after I found Jim's TFT version of the weather.py script. I had to comment out line 19 to get it to work.

https://cdn.instructables.com/ORIG/FYB/IHMN/IIXF89EI/FYBIHMNIIXF89EI.py

Kalmat made it! (author)wborrelli2017-11-11

Thank you for your comment and the tip to share the file... I didn't realize I could do that!

Here is the code (contact me again in you find any trouble to download)

https://drive.google.com/file/d/1YfAnbRbm92CIoPAfm...

Change disp_units and lang at the very beginning to switch to imperial and english.

I attach last version images in english and spanish (I don't think I will modify it any more).

PS: Again, I am a complete noob in python, so excuse me if my code is not very "nice"... As mentioned before, help/suggestions/comments are welcome

wborrelli (author)Kalmat2017-11-12

Thank you for sharing.

Out of the box, it does not work with my TFT display connected to the GPIO. So, I think a bit of code comparison is in my future.

You may be a noob in python, but that is still more advanced than I in python. I have never coded in python.

wborrelli made it! (author)wborrelli2017-11-12

Figured it out, mostly. The data text next to the time is a little small on the 3.5" screen.

Around line #190, an additional """ (triple quotes) is required.

Then at line #209 I added:

print 'Driver Used:', driver

devices = map(InputDevice, list_devices())

eventX=""

for dev in devices:

if dev.name == "ADS7846 Touchscreen":

eventX = dev.fn

print eventX

"""

os.environ["SDL_FBDEV"] = "/dev/fb1"

#os.environ["SDL_MOUSEDRV"] = "TSLIB"

#os.environ["SDL_MOUSEDEV"] = eventX

pygame.init()

screen = pygame.display.set_mode((480, 320), 0, 32)

tiger3000 (author)wborrelli2017-12-30

Hi there,

I've installed the latest Raspbian image but when I run weather.py, I get "Driver failed" for all three drivers:

drivers = ['fbcon', 'svgalib', 'directfb']

I've also ran the apt-get update and apt-get upgrade and all packages are up to date.

Any ideas??

Kalmat made it! (author)wborrelli2017-11-12

So happy this was useful to you. Looks really nice!!!

This is my first Python program as well!!!

Perhaps you want to take the forecasts icons a little bit up on the screen. If so, you have to modify line #561 (subwindow 1)

Try changing this:

CURRENT LINE:

self.screen.blit( icon, (xmax*wx-ix/2-xmax*0.015,ymax*(wy+gp*1.2)+yo+ymax*0.05) )

CHANGE TO:

self.screen.blit( icon, (xmax*wx-ix/2-xmax*0.015,ymax*(wy+gp*1.2)+yo+ymax*0.01) )

Note that I changed "ymax*0.05" by "ymax*0.01". I'm just guessing... Try different values between 0.01 and 0.05, and check how it looks like on your monitor.

When you have the right position for the icon, change the same line in Subwindows 2, 3 and 4 (lines #591, #621 and #651).

Besides, you can also change the font for the location and last update time (the text in the upper right side of the screen), if it is un-readable. Try changin this at line #265

self.lSmTh = 0.01

by

self.lSmTh = 0.02

Again, just guessing. Try different values, including 0.015.

Finally, thank you for your feedback!! I will include your code in my program so it is prepared for TFT as well.

Now I'm "playing" with weather and Magic Mirror... Still learning, but with some interesting results as you can see.

hometownnerd (author)Kalmat2017-12-07

Hello, kalmat. I really like your display! I grabbed your code, and was curious, where do you grab the news and display it, I am looking through the code and do not see it. I would love for my display to do this too. And I am sooo "borrowing" your icons!!!! Thanks for sharing!!

Kalmat made it! (author)hometownnerd2017-12-10

Hi There! My apologies since I didn't upload the new code. This is why you can not find news and other stuff.

Since then, I have added some other things (backgrounds for every weather condition, reduced significantly the CPU waste, more parameters to play with and some bug fixes...). Find all new code here:

https://drive.google.com/file/d/1POtGljtA8MCMTMgwi...

Note that now you will have to run it using "python wthrnews.py".

Before modifying the code, take a look to all new parameters to modify appearance and behaviour (at the very beginnig of the program and in the __init__ function as well)... You may find what you need without having to code it! (you can turn on / off the background, set all colors and sizes, change the news sources, determine when the news will be shown or if they should altern between sources,...)

In order to get the news working you will have to get your own API-Key at < https://newsapi.org/ > (not needed if you manage to connect directly to the source API as I did, without using newsapi).

I am using rtve (Spain's source) and BBC News (UK source) to get the latest news. Now you can even altern between both, showing one or the other every 15 minutes... You can easily change this behaviour with just one parameter. Should you want other sources, I'm affraid you will have to struggle a little bit with the .json structure... For instance, now I'm trying to use Yahoo! as weather source, but still in progress.

I hope you like it and find it useful. Should you have any question, do not hesitate to ask!

Kalmat (author)Kalmat2017-12-12

One more thing in case a real python-expert (unfortunately I'm not... yet!) can help us.

In the ScrollText() class I get an error when trying to render the News
text if it is "too large". I'm not sure what is "too large" to render,
which is the limit and if there could be a workaround. The only solution
I found at the moment is to reduce the text length, cutting the final
10%... but it is not very "ellegant".


One alternative I was considering is to "slice" the text, recursively
rendering parts of it, while maintaining the scroll of the whole thing,
but I didn't get to know how to do that in a smooth way (without
noticeable interruptions while scrolling the whole text, I mean).

Any ideas?
hometownnerd (author)Kalmat2017-12-11

I have to say, that is really amazing!! I really like what you have done here, may make it necessary for me to get a bigger display, this is awesome! I will be taking a long look at your code, have a lot to learn I think.

Thanks again, have a great day

Kalmat (author)hometownnerd2017-12-12

So happy to hear it has been useful to you!!! Again, any comment, doubt or suggestion is more than welcome.

I strongly recommend you get a larger display... it looks really nice in my sitting room! I got a 7"... it is a little bit expensive (50 euros), but it is worth for me since it has a quite good resolution (1024x600), built-in speaker (ideal for Alexa), AC/DC adapter that you can directly plug (not with loose wires like many others intended to be connected to the car power), remote control, base and HDMI input (which is much much easier to handle than the GPIO)... Seing the results, I would like it was even larger!!!

Kalmat made it! (author)Kalmat2017-11-19

Well, I was wondering (just for the sake of) how to include News on the screen. After trying many other options, I eventually decided to directly use APIs in my program. It's been hard to me to get it working as I wanted, but I finally got it running.

I use RTVE (Spanish TV) and BBC as News sources, so you may have News in both English and Spanish. Using a different source I believe is not straight thru, since the resulting .json will be slightly different, but you can try!

The News are shown every 15 minutes, for a period of 5 minutes. You can modify this to your needs.

I'm affraid that small screens will not be suitable since the font will be too small. You can blacken, or dim the whole screen (dimmer class is included in the code), then printing the News font bigger,. Ask me if you need help!

I also re-shaped the information on the screen to let more room to the clock. Now it is bigger, thus much more readable.

I hope you like it!

wborrelli made it! (author)Kalmat2017-11-14

I made some other font size modifications, and I am liking the look of this a lot more on a Waveshare 3.5" screen.

Thank you so much for the guidance.

Now, if I can only figure out how to use the touch screen so that I can change screens to display different data sets with just a tap. :)

Kalmat (author)wborrelli2017-11-15

Looks really nice in deed! Congrats!

I would suggest to take the current conditions icon a little bit down (just a little)... I'm a perfectionist, sorry.

Unfortunately I don't have even a clue about touch-screens in python/pygame. Besides, I don't have a touch-screen for testing... some Googling is in your near future ;)

tiger3000 (author)2017-12-30

Hi Guys,

I've installed the latest Raspbian image but when I run weather.py, I get "Driver failed" for all three drivers:

drivers = ['fbcon', 'svgalib', 'directfb']

I've also ran the apt-get update and apt-get upgrade and all packages are up to date.

Any ideas??

tiger3000 (author)2017-12-30

Hi guys,

I have the latest version of Raspbian installed on my Raspberry Pi:

Raspbian Stretch with desktop
Image with desktop based on Debian Stretch
Version: November 2017
Release date: 2017-11-29
Kernel version: 4.9

I've also ran apt-get update and apt-get upgrade. All packages are up to date.

When I run the weather.py, it fails for every single driver:

drivers = ['directfb', 'svgalib', 'fbcon']

Any ideas why??

ebar23 (author)2017-12-29

I made this Weather stations display and love it. I was wondering if there was a code or plug in hardware/button pad to make it so I can change the displays without a keyboard.

EnriqueH7 made it! (author)2016-12-30

Here the result, traducido al español ^^

ThomasK222 (author)EnriqueH72017-12-20

Hi Enrique, could you please send me your weather.py? I would like to set up my weather report in German. Somehow the months do not work in German .... Do you know how to omit AM and PM? My email is: dodas2277@gmail.com Thanks! Greetings Thomas

EnriqueH7 (author)ThomasK2222017-12-21

file sent, i haven't got enough time for verifying it,

ThomasK222 (author)EnriqueH72017-12-22

Thanks for mailing the file. Unfortunately, there is no information
about the language in it ... :-(

ThomasK222 (author)2017-12-19

Hello Jim,

I followed your instructions (hopefully) ?! I have not programmed any Raspberry Pi GPIO pins. Do you have a manual or a new (simple) weather.py without GPIO commands? Unfortunately, the following message appears for me:

Frame buffer Size: 656 x 416
New Weather Update: 12/19/17 12:00 PM CET
Icon Index: 5 11 12 11
Traceback (most recent call last):
File "weather.py", line 754, in <module>
GPIO.add_event_detect (4, GPIO.RISING, callback = btnNext, bouncetime = 400)
RuntimeError: Failed to add edge detection

Many greetings
Thomas

hometownnerd made it! (author)2017-01-02

I really liked everything about this and made my own and added some code to it as well. I have a weather station and I generate a clientraw.txt file every 15 seconds or so and wanted to actually display info from that. I will never claim it is perfect code but it does do the job fairly well. I display both the wind chill and the heat index as well as rain info, I had some issues with placement since this is my first python code but it is pretty close. I use this as a remote display for my Acurite weather station. Hope it helps some others

mthompson7 (author)hometownnerd2017-10-13

Hi do you have the code

wborrelli (author)mthompson72017-11-11

I also would like the code to grab data from my WeeWx weather data. I like that this grabs the forecast, but would like the actual temperature from my weather station in the back yard.

hometownnerd (author)wborrelli2017-12-07

Ok, sorry just saw these requests. Remember, I am not a python programmer, more of a hack. I am including the code here

https://1drv.ms/u/s!AvblfGHJ3aAy1_1LjkpGzB4QcMig7g
you do not need a one drive account or even sign in to see it just
click "No Thanks take me to the view" and it will show it to you and if
you have questions about please let me know. hopefully that helps
someone grab their own clientraw and parse it....the meat of it is in UpdateWeatherMine function. Just change the url to match yours, not sure about grabbing local files but should be similar.

hometownnerd (author)mthompson72017-12-07

Ok, sorry just saw these requests. Remember, I am not a python programmer, more of a hack. I am including the code here

https://1drv.ms/u/s!AvblfGHJ3aAy1_1LjkpGzB4QcMig7g
you do not need a one drive account or even sign in to see it just
click "No Thanks take me to the view" and it will show it to you and if
you have questions about please let me know. hopefully that helps
someone grab their own clientraw and parse it....the meat of it is in UpdateWeatherMine function. Just change the url to match yours, not sure about grabbing local files but should be similar.

Techninja2143 (author)2017-09-27

I have a question: I made this a few days ago and i was wondering how can remove the wind speed and barometer to make the time bigger? my girlfriend is having trouble looking at the time from the distance. I was looking at the source code but couldn't find a way to adjust the time size and remove the other 2.

Kalmat (author)Techninja21432017-11-14

Take a look to my design. Time is bigger. If not, I could try to explain how to make it even bigger.

ginop11 (author)2017-10-14

  1. cd Weather
  2. this command doesnt work on my rasp
  3. it says no such file or directory
  4. help please
Kalmat (author)ginop112017-11-09

After download the Weather.zip file

1. Unzip downloaded Weather.zip file

2. Copy unzipped "Weather" folder (not the file) to your /home/pi/ folder

3. Now "cd Weather" should work on your terminal (be sure you are located at /home/pi folder when executing the command)

ShelbyB32 (author)2017-10-04

Nice tutorial and cool project. I got it working pretty quick. Had more problems learning how to use vi/editing weather.py than I did setting up using your instructions. Thanks for your contribution!

ShelbyB32 (author)ShelbyB322017-10-04

I noticed that ctrl+c changes the display to a calendar which appears to be not fully programmed. Any plans on fleshing that out? Any other commands that are built into the program?

Techninja2143 made it! (author)2017-09-24

GF loves it, thank you!!! great tutorial.

MrD32 (author)2017-09-09

Can i use it on Raspberry Pi Zero,if i can't please tell me which Raspberry i need to use :)

tbenton520 (author)2017-09-06

Very Awesome, My raspberry pi now has a full time job.. dedicated weather station.. The wife loves it ! She pokes that cute little head into the office gets her info and Leaves to do other things :-)

gary.reardon2 (author)2017-04-17

This is just what I have been looking for!! I looked at another one called PiClock. but this seems a lot easier to setup. My question for you how hard is it to ssh from a MacBook into the raspberry pi? I am still a noob with the raspberry pi. I have it connected to the offical 7" screen. but I think to set it all up it would be easier to use the screen on my MacBook.

LorenzoB (author)gary.reardon22017-05-29

Hi!

I found it really difficult too setting up the RPi with SSH, so I decided to use RealVNC. It's really easy to set up and it works quite well on my Pi 3.

Also, it doesn't require internet connection, as long as your Pi and laptop are on the same network.

Hope that helps you.

Elá23 (author)2017-04-05

Excellent tutorial, thank you for the time!

Only problem is I can't see where to change the "F" to "C" now that I've changed the units to metric. It's displaying centigrade units followed by an "F". Where do I find this in the code? I'm relatively new to this python stuff!

Once again, thanks for tutorial. Was good fun to replicate!

jimk3038 (author)Elá232017-04-06

Strange, I just looked at the code and the default units were already metric. On 62 you should have: disp_units = "metric" This should take care of displaying the degree C symbol for you.

To display degree C or degree F I'm using a single unichar character. So, for example, the degree F one character that is both the little open dot plus the F character. It was a cute programming trick, using unichar, that I now regret. Makes it hard to understand the code.

Anyway, if you set the "disp_unit" variable to the string "metric" then near lines 60 to 78 should take care of setting up the correct unichar symbol for metric.

Hope that helps,
Jim

Elá23 (author)jimk30382017-04-06

Thanks for your reply! I may not be using the most up to date code, where would I find this? Line 62 is a get.icon command and I can't find a disp_units command anywhere in the code.

While I have you, which section of the code would I adjust to make use of the whole screen (i.e. remove the black space to the right).

Best wishes,

Alex

Hinschar (author)2017-03-21

​Hi Jim!
I would really like to thank you for all the wonderful things you are doing and for sharing your vast knowledge with us, I tried to send you a private. Message over here but it doesn't seem to be going through, is it possible for you to send me an email address where I can contact you?


My email address is hinschar2@gmail.com.


With much appreciation,


Hinschar

mkerth (author)2017-03-08

Really cool project! I got it working through regular HDMI out but when I add my 3.5'' lcd I get a graphic that says to toggle the shutdown switch. Any idea whats up with that?

jimk3038 (author)mkerth2017-03-08

At one point I added a push button to cause the Pi to go into shutdown mode. The idea was to shutdown before yanking the power so the SDCard doesn't get corrupted. Well, I stop using the switch long ago and the power gets yanked all the time with any trouble.

So, I'm guessing your GPIO is causing the Pi to think you want to shutdown. Simple answer is to just hack the Python code to disable that feature.

mkerth (author)jimk30382017-03-09

Thanks that got me to where I needed to go. I removed all references to GPIO in the weather.py except for one instance where it was part of a giant (looked like the main) IF statement and replaced it with a false statement so whatever it wanted to do with the GPIO wouldn't run.

rbischoff1 made it! (author)2017-02-11

Thanks a lot! This project was my main inspiration for a version I put together. I plan to add sensor data to mine as well..Keep an eye on my repo. Excellent Instructable.

https://github.com/rbischoff/pyweather

About This Instructable

139,698views

283favorites

License:

Bio: Founder of Powerhouse Electronics. For more info goto: www.ph-elec.com
More by jimk3038:Easy ESP8266 WiFi Debugging with PythonRaspberry Pi Internet Weather StationMake Your Own Laser Cut Standoffs for Electronic Projects
Add instructable to: