The edge node consists of a chibi and a Raspberry Pi. The Chibi forwards everything it receives on the radio to the raspi via a serial port, and the raspi parses the input and uploads the data to satoyama-api.
- Format the SD Card using SDFormatter.
- Download the latest NOOBS version. (You may find it here: http://www.raspberrypi.org/downloads/ )
- Insert the SD Card in the Raspberry Pi
- Connect HDMI cable, RJ45 network cable, keyboard and power supply cable to the raspberry pie
- Follow the installation instructions for Raspbian (The Raspberry OS). This is the first screen that you will see:.
- When the install process has completed, the Raspberry Pi configuration menu (raspi-config) will load. Here you are able to set the time and date for your region and enable a Raspberry Pi camera board, or even create users. Use TAB to go until Finish and press ENTER.
- The default login for Raspbian is username pi with the password raspberry.
- ifconfig. To make sure you are connected to the internet. If you are not... fix it.. it's probably your company's firewall ;)
- sudo apt-get update
- sudo apt-get install python-setuptools
- git clone https://github.com/DgFutureLab/satoyama-edge.git (If your NOOBs does not have git installed, install it before using apt-get)
- cd satoyama-edge
- git submodule update --init --recursive
- sudo easy_install pip
- sudo pip install -r requirements.txt
Upload aggregator.ino to the chibi and connect the chibi to the raspberry pi with a USB cable.
Before we wrote the sketches using the Arduino GUI, but now we use standard CMake to generate make files.
- Install CMake (e.g. brew install cmake on OSX)
- Change directory into satoyama-edge/aggegrator
- mkdir build (all the build files will be stored in this directory)
- Navigate to build directory: cd build
- compile source code and upload to the device: cmake .. -Wno-dev && make && make upload (make sure that the build directory is empty, as CMake will complain otherwise)
- Use screen to monitor output from the serial device (e.g. tty.usbserial-A501K9HW): /dev/tty.usbserial-A501K9HW 57600,sc8
The run_edge.py script launches two processes. One constantly listens to the serial port and parses the data from the Chibi connected to the raspi. The other process uploads the information to a webserver with regular intervals.
- cd satoayama-edge
- python run_edge.py --help
- python run_edge.py --host <your.host.name> --port