https://github.com/mnsekh111/IOT-Projects/tree/master/Arduino/Sketch_Photo_diode
All IOT programming done as part of CSC591
Setting up Intel Edison on Linux (Ubuntu 14.04.3 Gnome)
-
Follow the steps provided in the below link to assemble intel edison and mount it on your computer https://software.intel.com/en-us/articles/assemble-the-intel-edison-board-with-the-mini-breakout-board
-
Open a Terminal window. To install dfu-util, which is an open source program that implements the USB DFU (USB Device Firmware Upgrade) protocol, enter the command:
sudo apt-get install dfu-util
-
Download the pre-built Yocto* complete image for your board. You can find the most recent version available on the main downloads page:
https://software.intel.com/iot/hardware/edison/downloads
e.g http://downloadmirror.intel.com/25384/eng/edison-iotdk-image-280915.zip -
Extract the zip ( run
sudo apt-get install p7zip-full
if you don't have plugins) -
Navigate into the extracted folder and enter the command to start flashing the device
./flashall.sh
(If the process doesn't initialte try to disconnect and remount the device). The flashing process might take 2 to 3 minutes) -
(alt) . If step 5 causes some problems, then download the Flash Tool Lite package from http://downloadmirror.intel.com/24910/eng/phoneflashtoollite_5.2.4.0_linux_x86_64.deb (download the latest tool)
- Install x86 c++ libs
sudo apt-get install gdebi libncurses5:i386 libstdc++6:i386
- Install the
.deb
using gdebi or using Ubuntu software center (Optional)
Navigate into the Mount directory and remove all the old filerm -rf *
- Search for "Phone Flash Tool" in your applications and run it.
- Select the edison-iotdk-image that was downloaded in step 3 and change the configuration from RNDIS to CDC
- Click Start to flash. Disconnect and then reconnect the device and the application will take care of flashing
###Setting up a serial terminal on a system with Link
- Install Screen shell session manager installed, open a new Terminal window. Enter the command:
sudo apt-get install screen
- To connect to the board, enter the command (where ttyUSB0 is your connected device):
sudo screen /dev/ttyUSB0 115200
- Press
Enter
twice. A login screen is displayed. At the login prompt, typeroot
and pressEnter
. PressEnter
when prompted for a password. - Now the root@edison terminal is open.
###Setting up Wifi
- Type
configure_edison --wifi
If you get an error saying configure_edison: not found, you need to update your firmware - Follow the steps which are straight forward. Once connected, try opening the ip address where Edison is hosted. If unable to access the site, then it means the device is not properly connected to the network.
- Change the password of the device using configure_edison --password
other options to look out:
- Install x86 c++ libs
-h, --help show this help message and exit --setup Goes through changing the device name, password, and wifi options --name Changes the device name --password Changes the device password --wifi Changes the wifi options --showWiFiIP IP address associated with the wireless interface --showWiFiMode Show current mode for the wireless interface --version Gets the current firmware version --latest-version Gets the latest firmware version --disableOneTimeSetup Disable one-time setup with WiFi access point and enable WiFi client mode Append --persist to retain this setting after reboot --enableOneTimeSetup Enable one-time setup with WiFi access point and disable WiFi client mode. Append --persist to retain this setting after reboot --toggleOneTimeSetup Switch between one-time setup with WiFi access point and WiFi client mode, and visa-versa. Append --persist to retain this setting after reboot --upgrade Downloads the latest firmware. Append --restartWithAP to reboot in WiFi access point mode after flashing --flash [ ...] Downloads and flashes an image Append --restartWithAP to reboot in WiFi access point mode after flashing --flashFile Flashes the given image (.zip). Append --restartWithAP to reboot WiFi access point mode after flashing --showNames Show device name and SSID
#Arduino Uno
####Understanding the anatomy https://www.arduino.cc/en/Guide/BoardAnatomy
https://www.youtube.com/watch?v=Iy7DY2UbHvM
##Setting up wifi in Arduino:
1: Mount the ESP6266 Wifi Shield over the arduino board
2. Learn more about the wifi shield here
https://learn.sparkfun.com/tutorials/esp8266-wifi-shield-hookup-guide
LED Indicators
The WiFi Shield includes two LED indicators: a simple red power indicator and a blue “status” LED. The red power LED should illuminate whenever power is being delivered from the Arduino to the ESP8266 Shield. If you need to debug anything, checking for this LED should be your first step.
LED indicator location
The blue status LED is tied into the firmware of the ESP8266. It’ll blink, be solid, or turn off depending on which state it’s in.
LED State | ESP8266 State |
---|---|
Off | WiFi disconnected. Not configured. |
Blinking | Station mode: ESP8266 attempting to connect to access point. AP mode: ESP8266 waiting for incoming connections |
On | Station mode: ESP8266 connected to access point. AP mode: Devices connected to ESP8266 AP. |
###Arduino Serial Comm Set up
-
Download the java rxtx libraray from
http://fizzed.com/oss/rxtx-for-java -
Extract the above zip and do the following
- Copy RXTXcomm.jar ---> <JAVA_HOME>/jre/lib/ext
- Copy librxtxSerial.so ---> <JAVA_HOME>/jre/lib/amd64/
- Copy librxtxParallel.so ---> <JAVA_HOME>/jre/lib/amd64/
-
Go to the following website and download the code
http://playground.arduino.cc/Interfacing/Java -
Install an IDE like netbeans and create a Java project and paste the code available in the above mentioned website.
-
(optional) In the
project properties
underLibraries
, add RXTXComm.jar and inRun , VM Options
add the location of the jni compatible .so file (Not necessary as you have already pasted that in /jre/lib/amd64) -Djava.library.path=/home/mns/Downloads/rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so -
Run Netbeans in root mode. Otherwise
CommPortIdentifier.getPortIdentifiers();
will return empty/null
####Rasberry Pi
Controlling GPIO pins using Java : http://pi4j.com/example/control.html