2014-Kein Titel-Gerrit Grunwald
Total Page:16
File Type:pdf, Size:1020Kb
SENSOR NETWORKS JAVA RASPBERRYEMBEDDED PI ABOUTME. CANOOENGINEERING Gerrit Grunwald | Developer Leader of JUG Münster JavaFX & IoT community Co-Lead Java Champion, JavaOne RockStar JAVA ONE 2013 canoo canoo canoo canoo MONITORING canoo IDEAS canoo ๏ Measure multiple locations ๏ Store data for analysis ๏ Access it from everywhere ๏ Use Java where possible ๏ Visualize the data on Pi canoo ๏ Create mobile clients ๏ Display current weather condition ๏ Measure local environmental data ๏ Use only embedded devices canoo QUESTIONS ???canoo ๏ How to do the measurement ? ๏ Where to store the data ? ๏ Which technologies to use ? ๏ What is affordable ? ๏ Which hardware to use ? canoo TODO canoo 1 2 MONITOR STORE DATA 9 ROOMS 3 4 VISUALIZE ON OTHER RASPBERRY PI CLIENTS canoo MONITOR 9 ROOMS canoo BUT HOW canoo SENSOR NETWORK canoo SENSOR NETWORK ๏ Built of sensor nodes ๏ Star or mesh topology ๏ Pass data to coordinator ๏ Sensor nodes running on batteries canoo POSSIBLE SENSOR NODES canoo RASPBERRY PI canoo RASPBERRY PI ๏ Cheaper ๏ Power supply ๏ Support ๏ Size ๏ Flexible ๏ Overkill ๏ Connectivity ๏ limited I/O's canoo ARDUINO YUN canoo ARDUINO YUN ๏ Cheaper ๏ Power supply ๏ Support ๏ Oversized ๏ Flexible ๏ I/O's ๏ No Java ๏ Connectivity canoo ARDUINO + XBEE canoo ARDUINO + XBEE ๏ Cheap ๏ Power supply ๏ Support ๏ Oversized ๏ Flexible ๏ I/O's ๏ No Java ๏ Connectivity canoo XBEE canoo XBEE ๏ Cheap ๏ No Java ๏ Support ๏ Flexible canoo XBEE canoo XBEE ๏ 2.4 GHz at 2mW ๏ Indoor range up to 40m ๏ Outdoor range up to 120m ๏ 2.8 - 3.6 Volt ๏ -40 - 85°C operat. temp. ๏ Point to point, Star and Mesh support ๏ Programmable via AT cmd ๏ ZigBee standard canoo XBEE VCC AD0 DOUT AD1 DIN AD2 DO8 AD3 RST RTS PWM0 AD5 PWM1 VREF RSV ON DTR CTS GND AD4 canoo canoo 36 TMP SETUP VCC AD0 DOUT AD1 DIN AD2 DO8 AD3 RST RTS PWM0 AD5 PWM1 VREF RSV ON DTR CTS GND AD4 XBEE XBEE SETUP Wake up Measure AD3 Transmit AD3 value 5min ∆ sleeping and supply voltage Go to sleep canoo SENSOR NODE canoo SENSOR NODE 5 cm canoo SENSOR NODE 35 € canoo POSSIBLE TOPOLOGIES canoo SENSOR NODE MESH COORDINATOR SENSOR + ROUTER NODE LARGE-RANGE NETWORKS canoo SENSOR NODE STAR COORDINATOR SHORT-RANGE NETWORKS canoo SENSOR NODE STAR COORDINATOR canoo COORDINATOR Slice of Pi canoo SENSOR NODE STAR COORDINATOR RASPBERRY PI canoo RASPBERRY PI SETUP ๏ Debian Wheezy Linux ๏ JDK 8 ๏ Collect all current Xbee data via Java xbee-api ๏ Store every 5 min to database ๏ Populate live Xbee data via MQTT canoo MONITOR 9 ROOMS ๏ Xbee based Sensor Nodes ๏ Raspberry Pi as Coordinator ๏ Use Java 8 on the Raspberry Pi canoo 1 2 MONITOR STORE DATA 9 ROOMS 3 4 VISUALIZE ON OTHER RASPBERRY PI CLIENTS canoo STORE DATA canoo ๏ Which database ? ๏ Which hardware ? ๏ Where to store the data? canoo WHICH DATABASE…? canoo MONGO DB canoo MONGODB ๏ Flexible ๏ Developer friendly ๏ Free ๏ Java driver available ๏ ARM port available canoo WHICH HARDWARE…? canoo CUBIEBOARD2 ๏ DualCore ARM A7 1GHz ๏ Mali-400 MP GPU ๏ 1 GB RAM ๏ 1 Micro SD ๏ 1 SATA 2.0 ๏ Ethernet ๏ I2C, SPI, LVDS canoo CUBIEBOARD2 SETUP ๏ Debian Wheezy Linux ๏ JDK 8 ๏ Act as mongodb server ๏ Collect Xbee data of last 7 days every 5 minutes ๏ Allow communication over MQTT canoo STORE DATA ๏ Use mongodb ๏ Use CubieBoard2 as server ๏ Use Java 8 on the CubieBoard2 canoo 1 2 MONITOR STORE DATA 9 ROOMS 3 4 VISUALIZE ON OTHER RASPBERRY PI CLIENTS canoo VISUALIZE ON RASPBERRY PI canoo VISUALIZE ON PI ๏ Show current weather condition ๏ Show environmental values ๏ Show live measured data ๏ Show history of last 7 days ๏ Show sensor voltage history ๏ Show daily temperature distribution canoo 1. APPROACH canoo GOING "BIG" canoo 10" TOUCH LCDcanoo THE INTERFACE canoo WEATHER canoo ENVIRONMENT canoo LIVE XBEE DATA canoo 7 DAY HISTORY canoo 7 DAY HISTORY canoo 7 DAY RADAR canoo THE "BIG" APPROACH ๏ JavaFX 8 based ๏ Simple touchable interface ๏ Get data via MQTT subscription ๏ Optimized for low cpu performance canoo 2. APPROACH canoo GOING "SMALL" canoo 2.8" TOUCH LCDcanoo THE INTERFACE canoo WEATHER canoo WEATHER canoo ENVIRONMENT canoo ENVIRONMENT canoo ENVIRONMENT canoo LIVE XBEE DATA canoo 7 DAY HISTORY TOO SMALL canoo THE "SMALL" APPROACH ๏ JavaFX 8 based ๏ Simple touchable interface ๏ Get data via MQTT subscription ๏ Portable ๏ Optimized for low cpu performance canoo 1 2 MONITOR STORE DATA 9 ROOMS 3 4 VISUALIZE ON OTHER RASPBERRY PI CLIENTS canoo OTHER CLIENTS canoo POSSIBLE JAVAFX PLATFORMS ๏ Desktop (Windows, OS X, Linux) ๏ Cubox-i (i.MX6) ๏ iPad (iOS) ๏ Nexus 7 (Android) ๏ SmartWatch (Android) canoo DESKTOP canoo DESKTOP canoo DESKTOP canoo Cubox-i (i.MX6) 5 cm canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo Cubox-i (i.MX6) canoo 1 2 MONITOR STORE DATA 9 ROOMS 3 4 VISUALIZE ON OTHER RASPBERRY PI CLIENTS canoo FINAL SETUP canoo canoo canoo SensorNetwork canoo SensorNetwork Database Server canoo SensorNetwork Database Server MQTT Broker canoo SensorNetwork Database Server MQTT Broker Raspberry Pi Visualization canoo SensorNetwork Database Server MQTT Broker Raspberry Pi Other Visualization clients canoo SensorNetwork Database Server MQTT Broker Raspberry Pi Other Visualization clients canoo CONCLUSION canoo ๏ One can create a "cheap" sensor network based on Xbee's ๏ One could safe money by using embedded technology ๏ One could run nearly all of the systems on standard Java canoo DEMO iOS & Android canoo KEEP CODING…canoo.