Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Mihini/EclipseCon2013 Tutorial"
(→Compile Mihini source code) |
(→Setting up the Arduino) |
||
Line 64: | Line 64: | ||
{{Note|TODO|Fritzing schematic of the blinking LED setup?}} | {{Note|TODO|Fritzing schematic of the blinking LED setup?}} | ||
+ | |||
+ | |||
+ | * Next is the instalation of the Modbus stack --> https://github.com/kartben/mihini-greenhouse-demo/tree/master/SimpleModbusSlaveExample | ||
=== Remote run/debug === | === Remote run/debug === |
Revision as of 06:45, 21 February 2013
Contents
Tutorial
EclipseCon 2013 Tutorial plan.
Goals
Show Mihini
- show key APIs such as logging, sched, airvantage, devicetree, (sms?)...
- show how it's easy to do I/O manipulation and wireless communication
Koneki for Mihini
- show how Lua is easy to edit thanks to LDT tooling
- show EE and remote development for Mihini
Key steps
Installation of Lua Development Tools
Download Lua Development Tools product (or get it from an USB stick provided to the participants), install the Remote Lua Development feature.
Hello World
- Write a first simple Lua application ("Hello World").
- Get familiar with the notion of Execution Environment, learn how to use Lua.
- Launch the application using the embedded JNLua VM
- Learn how to use the debugger
Installation of Mihini
Participants will compile and install Mihini on the Raspberry Pi based on the instructions available here
Compile Mihini source code
- Copy (git clone?) the sources of Mihini on the Raspberry Pi
- Compile Mihini (and its Lua VM)
- Brief presentation of the defaultconfig ; tweak the few settings that will simplify development
First Mihini launch
- Start Mihini on the target
- Open a telnet connection on port 2000 to play with the agent's shell
- a = 1
- print(a)
- :agent.config.get('shell')
Hello World REMOTE
- Configure a new Remote System corresponding to the Raspberry Pi inside LDT
- Launch the previously written Hello World using a remote launch conf
- Do a remote debug
Setting up the Arduino
- First step will be to setup the arduino with a blinking LED
- Next is the instalation of the Modbus stack --> https://github.com/kartben/mihini-greenhouse-demo/tree/master/SimpleModbusSlaveExample
Remote run/debug
Log hello on the module.
Interact with the device tree
Write a first application to control the hardware
Wireless code
Upload first data on internet using MQTT and AirVantage
Install application
Show how to install an application using mihini (and airVantage)
Hardware
The main hardware will be a Raspberry Pi connected to an Arduino ; the Arduino itself being connected to several sensors/actuators.
Suggested sensors
Attached to the Modbus-capable Arduino
- LED
- light sensor
- humidity sensor
- temperature sensor
Other?
A LED matrix (managed through another arduino module?)
An LCD screen
Another idea: it can be interesting to allow light spot to be in front of the light sensor, so user can check if their light is on or off.
Bill of materials
Item | Qty | Total Cost (USD) |
---|---|---|
Raspberry Pi | 1x | 40.00 |
Arduino Uno | 1x | 30.00 |
Grove kit | 1x | 40.00 |
Micro USB cable | 1x | 3.95 |
4GB SD card | 1x | 7.95 |
USB 1A power supply | 1x | 5.95 |
USB A-B cable | 1x | 1.95 |
Wifi dongle (Netgear WNA1000M-100FRS)* | 1x | 20.00 |
TOTAL | 150.00 USD |
- this might not be the best option for the US market (sounds look it is way more expensive than in Europe?)
Ordering everything from Adafruit would be:
- Raspberry Pi: https://www.adafruit.com/products/998 - 39.95USD
- Budget pack for Arduino: http://www.adafruit.com/products/193 - 49.50USD
- Sensors???
- SD card: https://www.adafruit.com/products/102 - 7.95USD
- Power supply: https://www.adafruit.com/products/501 - 5.95USD
- USB Micro???
- USB A-B: not needed
- WiFi dongle: https://www.adafruit.com/products/814 - 11.95USD
- TOTAL: 120USD