element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 - Showing IP address and temperature on Grove LCD
  • 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: 22 Apr 2017 6:46 PM Date Created
  • Views 919 views
  • Likes 5 likes
  • Comments 4 comments
  • upcycledclock
  • upcycle_it
  • upcycleit
  • intel edison
Related
Recommended

Upcycled Clock - Showing IP address and temperature on Grove LCD

carmelito
carmelito
22 Apr 2017

I finally received my package image  a couple of days back on Thursday, after the package made couple of trips from Chicago to Los Angeles and back again. A big thanks to rscasny for helping me out, and quickly re-sending package.

 

As part of today's blog post I have managed to setup connect the Intel Edison on the Arduino base board to show the IP address assigned to the Intel Edison by my WiFi router and also show the temperature from the Grove temperature on the RGB LCD screen which came as part of the Grove Arduino sensor kit.

 

I started by downloading and  flashing latest Yacto image on the Intel Edison use the guide on intels website , which you can find at - https://software.intel.com/en-us/assembling-intel-edison-board-with-arduino-expansion-board. For flashing firmware I used Ubuntu 16.04 and you can find the documentation with the steps at - https://software.intel.com/en-us/flashing-firmware-on-your-intel-edison-board-linux  . Here are some screenshots of the flashing process

 

{gallery} Flashing latest version of Yacto

Iimage

Run the install_GUI.sh

image

Accept the Licence Agreement  and then hit the Flash Firmware button

image

Browse the folder you would like to download the latest firmware

image

Plug in you Edsion board, here are I used 2 USB and plugged it to my laptop. Don't forget to toggle the switch as shown in the picture above

image

Once you plugged in you USB cable to the computer the Edison will begin to flash

image

this can take about 5 to 6 mins

image

image

Setup your root password by hitting the Enable security button , which you will use to ssh into the Edison

image

Also connect to your Wifi router

 

 

From the terminal on you computer ssh into the Edison using

ssh root@ipaddress

 

And then run the following commands on the edison to get the latest version of MRAA library and UPM

echo "src mraa-upm http://iotdk.intel.com/repos/3.5/intelgalactic" > /etc/opkg/mraa-upm.conf

opkg update

opkg install mraa

opkg install upm

image

 

Now, connect grove shield to the Arduino breakout board and then connect the following grove sensors using the connectors

  • RGB LCD to one of the I2C
  • Pot to the A0
  • and Temperature sensor to A1

 

Using you favorite FTP tool, upload the python code to below to the Edison and run the python program

python checkIPaddressTempLCD.py

 

Now use the Pot to the check the temperature and IP address. And a big thanks to Element14 and the sponsors Intel.

{gallery} Using pot to test

image

IP address of the Intel Edision

image

Showing Temperature

image

 

Here is the python code to run after following the steps above

#!/usr/bin/python
# Create by Carmelito to show the IP address and temperature on the grove LCD based on
# Grove RGB LCD https://github.com/intel-iot-devkit/upm/blob/master/examples/python/jhd1313m1-lcd.py
# Grove rotary https://github.com/intel-iot-devkit/upm/blob/master/examples/python/groverotary.py
# Grove temp https://github.com/intel-iot-devkit/upm/blob/master/examples/python/grovetemp.py
# and for the ip address http://code.activestate.com/recipes/439094-get-the-ip-address-associated-with-a-network-inter/

from upm import pyupm_jhd1313m1 as lcd
from time import sleep
from upm import pyupm_grove as grove
import socket
import fcntl
import struct

def get_ip_address(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        s.fileno(),
        0x8915,  # SIOCGIFADDR
        struct.pack('256s', ifname[:15])
    )[20:24])


def main():
    #POT connected to AIO pin 0
    knob = grove.GroveRotary(0)
    #Temperature sensor connected to AIO pin 1
    temp = grove.GroveTemp(1)
    # Initialize Jhd1313m1 at 0x3E (LCD_ADDRESS) and 0x62 (RGB_ADDRESS)
    myLcd = lcd.Jhd1313m1(0, 0x3E, 0x62)
    # Loop indefinitely
    while True:
        # Read values
        abs = knob.abs_value()
        print("Abs values: " + str(abs))
        sleep(1)
        if abs <100:
            myLcd.clear()
            # Set background color to Blue
            myLcd.setColor(0, 0, 255) #RGB
            # Zero the cursor
            myLcd.setCursor(0,0)
            # Print the IP address for wlan0
            ip = get_ip_address('wlan0')
            myLcd.write("IP " + ip)
            sleep(1)
        elif abs >100 and abs <500:
            #Getting grove temperature value
            print(temp.name())
            for i in range(0, 10):
                celsius = temp.value()
                fahrenheit = celsius * 9.0/5.0 + 32.0;
                print("%d degrees Celsius, or %d degrees Fahrenheit" \
                         % (celsius, fahrenheit))
                sleep(1)
            myLcd.clear()
            myLcd.setColor(255, 0, 0) #RGB
            myLcd.setCursor(0,0)
            myLcd.write("Temp "+str(fahrenheit) + " F" )
        else:
            #Printing a big thank you!
            myLcd.clear()
            myLcd.setColor(0, 255, 0) #RGB
            myLcd.setCursor(0,0)
            myLcd.write("Thanks element14")
            myLcd.setCursor(1,0)
            myLcd.write("and Intel")
            sleep(1)

if __name__ == '__main__':
    main()

  • Sign in to reply

Top Comments

  • Workshopshed
    Workshopshed over 8 years ago +1
    Looking good, I did my last couple of projects in Python and find it easy to use. I swapped to Node to give myself practice with a different environment.
  • gpolder
    gpolder over 8 years ago +1
    Nice update, good to see that Python also is used in the challenge. I'm currently working with Node.js/Node-RED, but Python also was one of my candidates. Looking forward to your experiences.
  • carmelito
    carmelito over 8 years ago in reply to gpolder

    Thanks for the comment, look like I am also going to have to jump on the bandwagon soon and learn Node.js. While going though UPM library for python and doing a comparison to Node.js, there seems to be few more examples/libraries  for Node.js when compared to python. Looks like I am going to have to pick up some Node.js after the challenge..

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

    Nice update, good to see that Python also is used in the challenge.

    I'm currently working with Node.js/Node-RED, but Python also was one of my candidates.

    Looking forward to your experiences.

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

    Nice update.

     

    You are making very good progress.

     

    DAB

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

    Looking good, I did my last couple of projects in Python and find it easy to use. I swapped to Node to give myself practice with a different environment.

    • 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