I finally received my package 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 |
---|
Run the install_GUI.sh |
Accept the Licence Agreement and then hit the Flash Firmware button |
Browse the folder you would like to download the latest firmware |
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 |
Once you plugged in you USB cable to the computer the Edison will begin to flash |
this can take about 5 to 6 mins |
Setup your root password by hitting the Enable security button , which you will use to ssh into the Edison |
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
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 |
---|
IP address of the Intel Edision |
Showing Temperature |
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()
Top Comments