element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Upcycle It
  • Challenges & Projects
  • Design Challenges
  • Upcycle It
  • More
  • Cancel
Upcycle It
Blog Upcycled Clock - Reading out the weather using eSpeak
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: carmelito
  • Date Created: 30 Apr 2017 3:45 AM Date Created
  • Views 980 views
  • Likes 5 likes
  • Comments 3 comments
  • upcycledclock
  • upcycle_it
  • upcycleit
  • Espeak
  • weather station
  • iot
  • intel edison
Related
Recommended

Upcycled Clock - Reading out the weather using eSpeak

carmelito
carmelito
30 Apr 2017

If your a fan of Stephen Hawking's then this blog post is for you !!  As part of this blog post, we am going to setup eSpeak on the Intel Edison and have it read out today's weather condition via a speaker connected to the USB port of Edison Arduino breakout.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

eSpeak is a compact open source software speech synthesizer for English and other languages, for Linux and Windows and it runs perfectly on Yacto linux. To read more about eSpeak check out the documentation at sourceforge.net

For the getting the weather we are going to use pyOWM which is a python wrapper library for the OpenWeatherMap.

 

Connect the USB sound card to the Intel Edison and connect power to the Edison using the DC power jack as shown in the picture below.

image

 

Now SSH into your Edison and install ALSA using the following the commands

opkg install alsa-utils

To check if you USB sound card is detected run following command

lsusb

you should now see the name of sound card, in my case in the screenshot below it is the second entry.

image

Create a file under the /etc directory and add the following line in the file

vi /etc/asound.conf

pcm.!default sysdefault:Device

 

No to select your sound card and increase/decrease the volume, run the command

alsamixer

  • select the USB sound card by hitting F6 on the screen and selecting the option "USB PnP sound device"
  • Increase and decrease the speaker volume using up and down arrow keys.

image

Finally to check if you are able to hear sound from the speakers run the following command which will play a test file which was created as part of the alsa-utils intall

aplay /usr/share/sounds/alsa/Front_Center.wav

 

Now if you have heard sound from the speaker image , it is now time to install eSpeak by running the following commands

opkg install espeak

And also run the following to test if you can hear the text phrase on your speaker.

espeak "Hello from the Intel Edison"

image

 

Now to get weather data from openweathermap.org you will have to create an new account at , and run the following command to install pyOWM

Install PIP using the follow command

opkg install python-pip

in my case, as you see the screenshot below , I had installed python-pip a couple of days back. Once done install pyOWM using the command

pip install pyowm

image

 

 

Now you are ready to run the python program below, and hear the weather read out on your speakers as shown in the video above. As part of the python program, you will have to replace the API key and placeName and you can find the API key at - https://home.openweathermap.org/api_keys

 

#!/usr/bin/python
#create by Carmelito to use espeak to read out the weather on a speaker connected to the Intel Edison
#For more detials on pyowm https://github.com/csparpa/pyowm/blob/master/pyowm/docs/usage-examples.md
#Follow the blog on element14 to install espeak
import subprocess
import pyowm
APIKey = 'XXXXXXXXXXXXXXXXXXXXXXX'
placeName = 'Los Angeles,US'
owm = pyowm.OWM(APIKey)
observation = owm.weather_at_place(placeName)
w = observation.get_weather()

temp = w.get_temperature(unit='celsius')['temp']
status = w.get_status()
detailedStatus = w.get_detailed_status()
windSpeed = w.get_wind()['speed']
humidity = w.get_humidity()
pressure = w.get_pressure()['press']
print ('Temperature : '+ str(temp) + ' C')
print ('Weather Condition : ' + status)
print ('Wind Speed : '+ str(windSpeed) + ' m/s')
print ('Humidity : ' + str(humidity) + ' %')
print ('Pressure : ' + str(pressure) + ' hpa')
print ('Details Weather :' + detailedStatus)

#for the future, read out for the future weather condition
fc = owm.daily_forecast('Los Angeles,US', limit=3)
f = fc.get_forecast()
lst = f.get_weathers()
for weather in f:
      print (weather.get_reference_time('iso'),weather.get_status())
#text that will be spoken out using espeak
text = 'Rise and shine, Todays weather is ' + detailedStatus + ' and the Temperature is '+ str(temp) + ' degree celsius with humidity ' + str(humidity) + ' percent'
try:
    subprocess.check_output(['espeak', text])
except subprocess.CalledProcessError:
    print ("Errr something is not working..")

  • Sign in to reply

Top Comments

  • mcb1
    mcb1 over 8 years ago +1
    Very nice. This has given me a couple if ideas for other uses. Cheers Mark
  • sakthi.1260
    sakthi.1260 over 8 years ago

    was supposed to be my upcoming blog post Andrade , its good one probably I'll too use openweathemap image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    Nice post.

     

    I may have to check the software out.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago

    Very nice.

    This has given me a couple if ideas for other uses.

     

     

    Cheers

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube