Transcription
Introduction to Informixand the Internet of ThingsMike Walkermike@advancedatatools.com1
Internet of Things (IoT) Webcasts1. Introduction to Informix and theInternet of Things2. Using Informix TimeSeries and the Internet ofThings – June 2nd3. Running an Informix Database Server on anARM Computer – June 23rd4. Installing and Configuring Informix on an ARMComputer – July 28th2
Introduction to Informix and theInternet of Things Brief overview of what IoT isIBM & IoTDemonstration of sensor data and IoTOverview of an IoT solution – how the pieces fit togetherMicrocontrollers – connect to the physical worldExample of reading a temperature sensor using an ArduinoUse an ARM-based computer as a low-power, low-cost gatewayBrief overview of installing Informix on a Beaglebone BlackWireless communication to/from ARM gateway using XBeeradios Receiving sensor data at the gateway3
Internet of Things (IoT) Connecting together the Physical andDigital World Network of objects, exchanginginformation4
Internet of Things - Examples Smart Meters– Real time power usage monitoring Virgin Atlantic– Use internet connected sensors on engines,flaps, landing gear, etc. Can generate 0.5 TBfrom a single flight (Computerworld UK) DisneyWorld– MagicBand : check into hotel room, buy lunch, gothrough the turnstiles at the amusement parks.Disney can collect data on visitor movement(ZDNet)5
Internet of Things –Consumer Examples LightbulbsThermostatGarage Door ControllerDoor LockPower StripWall SwitchPropane Tank GaugePiggybankAll connected and allaccessible with a smartphone6
Internet of Things (IoT)Nearly 26 billion devices on the Internet of Thingsby 2020Gartner, IncMore than 30 billion devices will be wirelesslyconnected to the Internet of Things (Internet ofEverything) by 2020ABI Research7
Why do we Care? Monitoring and control of all sorts of things Interaction through smartphones/tabletsanywhere in the world Enormous amounts of data8
IBM and IoT Informix is IBM’s database of choice for Internet ofThings implementations– Informix TimeSeries Very efficient storage of large volumes of sensor data– Informix on ARM and Intel Quark Run Informix on a small footprint, cheap hardware– Partnerships Example: Informix available as part of the Intel Gatewaydeveloper SDK– Informix Docker image available Try out Informix quickly and easily Internet of Things Foundation– Cloud based repository for storing IoT data Node-RED– Configure flows and events through a browser9
Demonstration10
That’s the WHAT Now the HOW 11
SensorsSensors for erRFIDReaderBarometricPressureTemperature12
Get Things owerHumidityController 3
TechnologiesSensorsMicro ControllerWired or WirelessRadioARMInformixTimeseriesWired Micro ControllerorWirelessRadioWeb/Cloud14
Where to Start?How do I go from this:To this:15
Microcontroller Boards Electronics board with a microcontroller Can bridge the gap between the physicalworld around you and computers Input and Output pins– Read values from the environment– Turn things on and off Programmable16
Microcontroller BoardsIntel EdisonTI LaunchPadBeagleboneBlackPickaxeArduinoRaspberry Piand many more 17
Arduino Electronics board & microcontroller Cheap ( 10-45 depending on version) Programming language (based on Wiring) Arduino is Open Source/Open Hardware Many different varieties and clones18
Arduino19
Arduino – Open HardwareArduino Uno R3Sparkfun Redboard20
Arduino – Connect to the PhysicalDigitalPinsPowerAnalogPins21
Arduino Programming Program the Arduino from a PC using theArduino IDE Free Download: http://www.arduino.cc/en/Main/Software Available for:– Windows– Mac– Linux22
Arduino ProgrammingUpload “sketch”(Arduino program)via a USB cable23
Arduino INPUT/OUTPUTvoid setup(){// declare the LED pinsas (5,OUTPUT);pinMode(6,OUTPUT);// declare the switchpin as an inputpinMode(2,INPUT);}OUTPUTINPUT24
Arduino Temperature Sensor25
SketchOutputOutput26
Step it up! Can expand the Arduino through “shields” Add more capabilities – WiFi, Bluetooth,etc or more sensors27
Next Step Now we’ve got a way read sensorinformation in a way we can understand it We can also drive devices in the sameway and interact with the environment –actuators, lights, etc. To make this really useful, we want to putall this together so we can make betterdecisions, keep a history, publish the dataand do stuff! Need a controller a hub/gateway28
Smart Gateway Somewhere to collect data, store data,make decisions, trigger other actions andpublish data Hardware depends on application29
ControllerFor home automation, a small Raspberry Pi,or Beaglebone Black is an ideal solution– Run linux– Small Footprint– Low power– Cheap ( 35–55)– Can run a database30
Beaglebone BlackRev C (latest version) - 55 ARM Cortex-A8 (ARMv7) 512MB RAM 4GB internal flash storage Expand storage with microSD card Ethernet HDMI No built in WiFi, no Bluetooth Requires 5V power (can be powered via USB) Now ships with Debian Linux installed Capable of running a full version of Informix!31
Beaglebone – Setup Ready out of the box– Connect via USB and ssh into it Additional steps:– Flash Beaglebone with the latest version ofDebian from a microSD card– Configure microSD card for additional storage– Set up networking (WiFi requires dongle)– Update packages– Set up user accounts32
Why Install a Gateway Database? Maintain a history Advanced local reporting Make more informed decisions locally Don’t need to wait to get information fromthe cloud Don’t need to rely on an Internet connection33
Why Informix? Over a 20 year historyFull support from IBMEnterprise class database softwareReliable & RobustScalablePerformanceEase of administrationFeatures– High Availability/DR– Full NoSQL support – built in JSON & BSON datatypes, MongoDB APIs– Many, many more 34
Why Informix for IoT?For all the same reasons, and Informix TimeSeries– Store large volumes of sensor data very efficiently Easily Embeddable– No administration – DBA free– Remote management through SQL Runs on low-cost hardware– Full version – no loss of features– Small footprint – disk and memory– OEM licensing options35
Beaglebone – Informix InstallDownload Informix for ARM from IBM websiteQuark, e.g. Intel GalileoARM v6, e.g. Raspberry PiARM v7, e.g. Beaglebone,Raspberry Pi 236
Beaglebone – Informix Install Install the ksh packageUpgrade javaCopy the Informix tar file to the BeagleboneUnpack the tar fileRun ./ids installPerform the normal (simple!) Informix install37
Beaglebone – OATRun OAT against Beaglebone instanceConfigure/monitor Informix from a desktop38
Informix Install - Docker Container Informix is available as a Docker Container forsimple rmix-innovator-c/ Innovator-C Edition– Free to use– Limited to 1-core, 2 GB memory Informix database n/informix-family39
Now we have Arduino reading sensor data Beaglebone, ARM-based, Linux computer,running an Informix database Want to wirelessly connect the Arduino to thehub40
Send/Receive InformationWirelessly Many options:– WiFi/Low Power WiFi– Cellular– Bluetooth Low Energy (Bluetooth Smart)– Other wireless protocols ZigBee Z-Wave41
Send/Receive InformationWirelessly ZigBee– IEEE 802.15.4 Standard– Personal Area Network– Low power– Mesh Capable Zigbee implementationwith XBee radios42
XBee RadiosNeed an XBeemodule on eachsensorNeed anXBee moduleon the hub43
XBee Radios Configure the modules to talk to each other– Can use AT commands ina terminal window– Set a PAN ID(like a network name)– Simple to set up each XBeeto echo output to the other(transparent/commandmode)– Use API mode for more advanced applications44
XBee Radios - ConfigurationX-CTUInterface to configureall the XBeeparameters and basictroubleshooting45
XBee Network Define an XBee as one of Coordinator,Router or End Point– Coordinator: Destination/Root node [connected to the gateway]– Router: Usually always on Can connect to any other node– End Device: May sleep – to save power Can connect to any router or coordinator46
XBee Network Routers will pass on traffic from End Device, allowingEnd Points to be situated further away Routers will store messages for End Points and deliverwhen they wake upEnd DeviceRouterEnd DeviceRouterEnd DeviceCoordinator47
XBee Mesh Network XBees will automatically re-route traffic if nodesare unavailable All done without any additional programmingEnd DeviceRouterEnd DeviceRouterEnd DeviceCoordinator48
XBee Network, with the new XCTUSee the XBeeMesh network inthe new XCTUapplication49
XBee Network, with the new XCTUConfiguredevicesremotely50
XBee CommunicationLibraries for Arduino, python, C, etc to giveprogrammatic control of the XBeeArduino – Sensor (Send)#include XBee.h XBee xbee XBee();XBeeAddress64 addr64 XBeeAddress64(0x00000000,0x00000000);Populate a “payload”:ZBTxRequest zbTx ZBTxRequest(addr64, payload,sizeof(payload));xbee.send(zbTx);51
XBee CommunicationPython – Gateway (Receive)from xbee import ZigBeePORT '/dev/ttyUSB0'BAUD RATE 9600ser serial.Serial(PORT, BAUD RATE)xbee ZigBee(ser,escaped True) response xbee.wait read frame()Parse response, e.g.sa hex(response['source addr long'][4:])52
XBees & Sending Simple Data XBee can be configured to send theanalog value on a particular pin– Allows us just to connect it to a simple sensorand send the voltage reading back to base Can also configure it to sleep for a setperiodSleepWake UpSend value on pin53
XBees & Sending Simple Data The sleep allows us tosave power Can run on batteries NOT always on – bestfor an End Device Simple setup – do notneed an Arduino54
Wireless Sensor Network55
Wireless Sensor Network56
Putting it togetherAdd a Coordinator XBee to the Beaglebone using a “cape”(could also use USB or wire directly to the headers)57
Receive Data from Remote SensorsOn the gateway (Beaglebone), read the datapackets from the 772.566.072.566.739.7H: 24.6L:83S: TrueD:61Hdg:72H: 24.5H: 39.8L:L:8395S: TrueS: FalseD:D:610Hdg:Hdg:720H: 24.3L:83S: TrueD:61Hdg:72H: 24.2L:83S: TrueD:61Hdg:72H: 39.9L:95S: FalseD:0Hdg:058
Doing Something We now have data from multiple sensorsstreaming to our base station– Can trigger alerts – emails, texts, etc– Can trigger other actions 59
Turning a Switch On/Off Remotely set a pin on the XBee to Low/High# D0 Digital Pin 0# parameter: 4 Low, 5 Highxbee.remote at(dest addr long '\x00\x13\xa2\x00\x40\xb3\x42\xbb',command 'D0',parameter '\x05') Use to control a relay to power a device60
Turning a Switch On/OffPin high/low can control a relay to power adevice61
Now we have Data from sensors (Arduino and “simple”) ARM based, Linux gateway, running Informix Sensor data sent/received wirelessly What are we going to do with this data?– Store it in the database using TimeSeries Keep a history Values accessible from multiple applications– Push to the cloud Access from anywhere62
Next WebcastUsing Informix TimeSeries and the Internet ofThings – June 2nd TimeSeries – what is it?How to set up a simple, regular TimeSeriesCreating a TimeSeries for sensor dataVirtual Table Interface and expression-based VTIExample of displaying sensor data on a web pagePublishing sensor data to the cloudView data in the cloudUsing APIs to pull data from the cloudExample of using APIs to display sensor data and graphs on awebsite63
WAIUGNext MeetingFree Informix Technical Workshop NewFeatures and Multi-tenancy – June 25 2015
Questions?Mike Walkermike@advancedatatools.com65
Download Informix for ARM from IBM website 36 Quark, e.g. Intel Galileo ARM v6, e.g. Raspberry Pi ARM v7, e.g. Beaglebone, . XBee Network, with the new XCTU 49 See the XBee Mesh network in the new XCTU application . XBee Network, with the new XCTU 50 Configure devices remotely.