SlideShare a Scribd company logo
1 of 12
Download to read offline
Page | 1 9-Feb-12 JMLambert V1.0
IoT with OpenPicus Flyport :
Temperature/Pressure with BMP085
I2C LCD setup
Use case of Pachube and Paraimpu
Page | 2 9-Feb-12 JMLambert V1.0
Introduction
After the previous exercise with a Flyport Simulator connected to the web services, I will expose the experience and
solution of the following problem :
- Acquire Temperature & Pressure of a BMP085 device on a I2C bus
- Set the Real Time clock to the web time and use an alarm to acquire regularly the measurements
- Send the measurements to some Cloud storage, (I have integrated successfully NimBits, ThingSpeak, Paraimpu
and Pachube…)
- Display the curves of the measurements on the web page of the Flyport.
- Setup a LCD display HD44780 connected to the Flyport with I2C bus, thanks to I2C driver chip that is easy and
low cost and need less wires.
- Display some values on the local LCD as a “weather station”…
As explained above, I tried different Web Services to store the data, and Pachube seems quite good as it allows a very
easy graphing out of the data.
But Pachube is not able to process the Data and generate alerts (it seems) as easy as with ParaImpu
I chose to create a Pachube sensor in Paraimpu, and a connector inside Paraimpu that will tweet a message when an
alert is raised. We will see how.
I2C Bus & BMP085 acquision programming.
I connected the BMP085 directly on the Flyport, as it handles already on board the pullup.
I used the few libraries from the OpenPicus Download content :
- OP-LIB - i2c Helper rev1.0.zip
- LIB - BMP085 temperature sensor_rev1.0.zip
After some initial issue on the I2C reading, I fixed the soldering…
I just connected the required wires : GND+VCC + I2C Bus : SCL+SDA
Page | 3 9-Feb-12 JMLambert V1.0
Web time & RTCC Programming
The objective is to get the current time from an external web site (always included in a response), then set the time in
the RTCC and create alarms from the RTC at regular interval to perform the acquisition and sensor data transmission to
the storage (not too often)
Get the time from a web site header : www.google.com
In aim to get the time, the simpler is to make a POST request to a site, and analyses the header response.
Then you extract the fields and use them to initialize the RTCC.
Page | 4 9-Feb-12 JMLambert V1.0
Then, the time will be set in the RTCC and next steps :
Page | 5 9-Feb-12 JMLambert V1.0
I2C Bus & LCD HD44780
I used also the I2CHelper library as above, but I needed to create a new function :
New function : I2CSendString()
To handle the LCD, I added a new function in complement to the I2CHelper : I2cSendString()
This function is necessary to send messages to the I2C LCD and handles the split of messages within the max size of the
I2C buffer (generally 32, but it is a parameter)
LCD Display organization
In aim to put some flexibility in the way to create and eventually change the content of the display dynamically, I have
gone through some descriptions data.
Page | 6 9-Feb-12 JMLambert V1.0
This function is the one that will prepare the right strings in the display buffer for the iFieldNum field.
The above pointers are filled with Malloc to allocate the right size to the array.
I put 2 sets of strings, the one Requested, that is prepared with the above formatting elements and the one Content
that is filled after the LCD is updated.
This allows sending messages to the LCD only when a char has changed, and reduce the number of useless I2C message.
If we put the time HH:MM::SS, anyway, the update will be at least each second, but if you put only minutes, then the
message will only be sent every minute or if a displayed measure changes.
LCD I2C Controller BV4208
http://www.i2c.byvac.com/downloads/BV4208%20DataSheet.pdf
A set of commands is declared for this driver that is quite simple.
The LCD I2C Driver is also containing a EEPROM, that may be used for preset messages, but also to store your own
params independently of the OpenPicus file system.
Page | 7 9-Feb-12 JMLambert V1.0
We will use the I2CHelper library completed as described above to send long strings.
Note : I am preparing a library for that chip, but as I did not received the LCD from my order, I cannot test it…
This will be in the V2 of the document.
Page | 8 9-Feb-12 JMLambert V1.0
Pachube Setup & use
Pachube is a place to collect Sensor feeds, and allow their presentation in graphs.
Sensor declaration
You need to declare your sensor (Feed) that may contain several datastreams.
The feeds is at the url: /feeds/<feednumber> and you will have some access keys.
API Keys & Access control
You may have generic keys or specifics that have their own restrictions, (for example the key can be used to update only
one datastream, or you may allow only one IP address as origin, as well for getting the data, you have some access
controls.
For example : Here I create a key that would be able to UPDATE only the pressure datastream of the feed 47332
Then the Key provided will be put in the URL of access for the action (PUT/GET/DELETE etc) in the http header field
X-PachubeApiKey:
Page | 9 9-Feb-12 JMLambert V1.0
You may also regenerate the key, if you do not know if your key has been compromised.
The http requests are well documented in the API manual of Pachube here https://pachube.com/docs/
Once you have declared your feed, your datastreams (with an ID that will be used in the API call), and you have got the
key allowed to access the stream, you will need to put them in your program.
Web service format
What is interesting is that you may use several formats to update the streams : JSON, XML or CSV
For easy cases, it if obvious that the CSV is preferred.
The selection of the format is made at the URL level
http://api.pachube.com/v2/feeds/1977/datastreams/1.csv
For CSV the data string will contain one value per line (each line separated by “rn”)
Example : “1,20.5rn2,1013.0rn” means assign 20.5 to the datastream 1 and 1013.0 to datastream 2.
In this project, I construct this string that will be sent to the api.pachube.com url via a PUT request :
sprintf( tmpString,
"PUT %s HTTP/1.1rnHost: %srnAccept: */*rnContent-Type: text/csvrnX-PachubeApiKey:%srnContent-Length:
%drnConnection: closernrn%s", RemoteURL, ServerName, PachubeKey, strlen(buf), buf );
Page | 10 9-Feb-12 JMLambert V1.0
Pachube Graphing
By default, Pachube proposes a graph of all datastream like that :
You may tune the graphic by the parameter button and generate a URL of the result to include in your Flyport webpage.
Your browser will get the URL from the flyport, but will get the display from the Pachube site.
https://api.pachube.com/v2/feeds/47332/datastreams/1.png?width=730&height=250&colour=%23f15a24&duration
=1day&show_axis_labels=true&detailed_grid=true&timezone=UTC
The duration is a parameter that you may manually change or even put a dynamic field inside to change that
dynamically (~my_duration~) to replace the 1day above by a choice you may integrate in your web page. (eg: popup)
Triggers/ Alerts
You may have some triggers on some datastream, to generate alerts in twitter or SMS.
I have tested the SMS alert, but not the tweet.
There are several applications around Pachube that you may explore too.
Interface with Paraimpu
Paraimpu is competitor of Pachube (beta)
I have successfully connected my flyport to Paraimpu, but it is not featuring graphing yet.
So I choosed Pachube for data & graphing, and tried Paraimpu for the tweets management;
Identically to Pachube, you need to declare a sensor in Paraimpu and get a key to use the web service to publish your
sensor data.
There is an OpenPicus sensor template that you may use. This is in fact providing a piece of C code that can be the
starter to make your sensor. The API key is included in the C code, and is not available in the Web Page. I have
requested the change, as this seems not the best choice…
In this project, the Pachube is seen as a sensor itself, and data are gathered from Pachube.
Then I have declared a twitter Actuator with my twitter account.
Page | 11 9-Feb-12 JMLambert V1.0
And the last point is the connection that is making the link between the sensor data and the actuator :
You may have a message going to your actuator depending on the value received on the sensor.
Here I just put a message depending on the temperature.
You may create a message with smart content to have a script interpreted in your flyport for example.
Page | 12 9-Feb-12 JMLambert V1.0
Misc
I used the malloc/free to manage the dynamic memory allocation.
I just added the heap.s file in the project directory to create a heap of 2000bytes.
Then you just need to declare pointers and allocate memory that you assigned to that pointer.
Standard example :
This is quite useful for the http requests of body that do not need to be kept very longtime.

More Related Content

What's hot

PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesTatiana Al-Chueyr
 
Apache Flink Stream Processing
Apache Flink Stream ProcessingApache Flink Stream Processing
Apache Flink Stream ProcessingSuneel Marthi
 
Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)Timothy Spann
 
[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4Open Networking Summits
 
Networking and Go: An Epic Journey
Networking and Go: An Epic JourneyNetworking and Go: An Epic Journey
Networking and Go: An Epic JourneySneha Inguva
 
Openpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesOpenpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesIonela
 
20170925 onos and p4
20170925 onos and p420170925 onos and p4
20170925 onos and p4Yi Tseng
 
Apache Flink Training: DataStream API Part 1 Basic
 Apache Flink Training: DataStream API Part 1 Basic Apache Flink Training: DataStream API Part 1 Basic
Apache Flink Training: DataStream API Part 1 BasicFlink Forward
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with Ionela
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded wsmile790243
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...InfluxData
 
Maximilian Michels – Google Cloud Dataflow on Top of Apache Flink
Maximilian Michels – Google Cloud Dataflow on Top of Apache FlinkMaximilian Michels – Google Cloud Dataflow on Top of Apache Flink
Maximilian Michels – Google Cloud Dataflow on Top of Apache FlinkFlink Forward
 
Programmable data plane at terabit speeds
Programmable data plane at terabit speedsProgrammable data plane at terabit speeds
Programmable data plane at terabit speedsBarefoot Networks
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheuskawamuray
 

What's hot (15)

PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummies
 
Apache Flink Stream Processing
Apache Flink Stream ProcessingApache Flink Stream Processing
Apache Flink Stream Processing
 
Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)
 
[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4
 
Networking and Go: An Epic Journey
Networking and Go: An Epic JourneyNetworking and Go: An Epic Journey
Networking and Go: An Epic Journey
 
Openpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesOpenpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud services
 
20170925 onos and p4
20170925 onos and p420170925 onos and p4
20170925 onos and p4
 
Apache Flink Training: DataStream API Part 1 Basic
 Apache Flink Training: DataStream API Part 1 Basic Apache Flink Training: DataStream API Part 1 Basic
Apache Flink Training: DataStream API Part 1 Basic
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
 
Maximilian Michels – Google Cloud Dataflow on Top of Apache Flink
Maximilian Michels – Google Cloud Dataflow on Top of Apache FlinkMaximilian Michels – Google Cloud Dataflow on Top of Apache Flink
Maximilian Michels – Google Cloud Dataflow on Top of Apache Flink
 
Programmable data plane at terabit speeds
Programmable data plane at terabit speedsProgrammable data plane at terabit speeds
Programmable data plane at terabit speeds
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheus
 
Networking in java
Networking in javaNetworking in java
Networking in java
 

Similar to IoT with OpenPicus Flyport

Mobile applications using tcp (1)
Mobile applications using tcp (1)Mobile applications using tcp (1)
Mobile applications using tcp (1)Nainita Thakkar
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazineMax Kleiner
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Boris Adryan
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSanjay Kumar
 
An introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDAn introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDBoris Adryan
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18Max Kleiner
 
Weather data meets ibm cloud. part 3 transformation and aggregation of weat...
Weather data meets ibm cloud. part 3   transformation and aggregation of weat...Weather data meets ibm cloud. part 3   transformation and aggregation of weat...
Weather data meets ibm cloud. part 3 transformation and aggregation of weat...Einar Karlsen
 
ARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdfARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdfhakilic1
 
Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3Max Kleiner
 
Sap bpc Planning and consolidation
Sap bpc Planning and consolidationSap bpc Planning and consolidation
Sap bpc Planning and consolidationSreekanth Gogula
 
Arduino Teaching Program
Arduino Teaching ProgramArduino Teaching Program
Arduino Teaching ProgramMax Kleiner
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docxfelicidaddinwoodie
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...Andrey Karpov
 
Internet of Things: Vehicular Tracking System
Internet of Things: Vehicular Tracking SystemInternet of Things: Vehicular Tracking System
Internet of Things: Vehicular Tracking SystemPrasannPatel4
 
Node-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsNode-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsBoris Adryan
 
Socket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaSocket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaiDhawalVaja
 

Similar to IoT with OpenPicus Flyport (20)

Mobile applications using tcp (1)
Mobile applications using tcp (1)Mobile applications using tcp (1)
Mobile applications using tcp (1)
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
 
An introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDAn introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-RED
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18
 
Weather data meets ibm cloud. part 3 transformation and aggregation of weat...
Weather data meets ibm cloud. part 3   transformation and aggregation of weat...Weather data meets ibm cloud. part 3   transformation and aggregation of weat...
Weather data meets ibm cloud. part 3 transformation and aggregation of weat...
 
UDP Report
UDP ReportUDP Report
UDP Report
 
ARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdfARM Embeded_Firmware.pdf
ARM Embeded_Firmware.pdf
 
Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3
 
Sap bpc Planning and consolidation
Sap bpc Planning and consolidationSap bpc Planning and consolidation
Sap bpc Planning and consolidation
 
caQtDM_Argonne.pptx
caQtDM_Argonne.pptxcaQtDM_Argonne.pptx
caQtDM_Argonne.pptx
 
Arduino Teaching Program
Arduino Teaching ProgramArduino Teaching Program
Arduino Teaching Program
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 
Internet of Things: Vehicular Tracking System
Internet of Things: Vehicular Tracking SystemInternet of Things: Vehicular Tracking System
Internet of Things: Vehicular Tracking System
 
opnet lab report
opnet lab reportopnet lab report
opnet lab report
 
NodeJS @ ACS
NodeJS @ ACSNodeJS @ ACS
NodeJS @ ACS
 
Node-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsNode-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of Things
 
Socket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaSocket Programming by Rajkumar Buyya
Socket Programming by Rajkumar Buyya
 

More from Ionela

Flyport wifi webserver configuration page
Flyport wifi webserver configuration pageFlyport wifi webserver configuration page
Flyport wifi webserver configuration pageIonela
 
openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetIonela
 
Flyport openPicus datasheet
Flyport openPicus datasheetFlyport openPicus datasheet
Flyport openPicus datasheetIonela
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18Ionela
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...Ionela
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17Ionela
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01Ionela
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10Ionela
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29Ionela
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...Ionela
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08Ionela
 
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
Touchatag  un&#039;applicazione di internet delle cose   2010-11-10Touchatag  un&#039;applicazione di internet delle cose   2010-11-10
Touchatag un&#039;applicazione di internet delle cose 2010-11-10Ionela
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Ionela
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02Ionela
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03Ionela
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...Ionela
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...Ionela
 
Tastiere capacitive 2010-11-10
Tastiere capacitive   2010-11-10Tastiere capacitive   2010-11-10
Tastiere capacitive 2010-11-10Ionela
 
Supporto wi max toshiba introduce il supporto wimax nei notebook portégé r70...
Supporto wi max  toshiba introduce il supporto wimax nei notebook portégé r70...Supporto wi max  toshiba introduce il supporto wimax nei notebook portégé r70...
Supporto wi max toshiba introduce il supporto wimax nei notebook portégé r70...Ionela
 
Stm32 vl discovery recensione - 2010-11-11
Stm32 vl discovery   recensione  - 2010-11-11Stm32 vl discovery   recensione  - 2010-11-11
Stm32 vl discovery recensione - 2010-11-11Ionela
 

More from Ionela (20)

Flyport wifi webserver configuration page
Flyport wifi webserver configuration pageFlyport wifi webserver configuration page
Flyport wifi webserver configuration page
 
openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
 
Flyport openPicus datasheet
Flyport openPicus datasheetFlyport openPicus datasheet
Flyport openPicus datasheet
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
 
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
Touchatag  un&#039;applicazione di internet delle cose   2010-11-10Touchatag  un&#039;applicazione di internet delle cose   2010-11-10
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
 
Tastiere capacitive 2010-11-10
Tastiere capacitive   2010-11-10Tastiere capacitive   2010-11-10
Tastiere capacitive 2010-11-10
 
Supporto wi max toshiba introduce il supporto wimax nei notebook portégé r70...
Supporto wi max  toshiba introduce il supporto wimax nei notebook portégé r70...Supporto wi max  toshiba introduce il supporto wimax nei notebook portégé r70...
Supporto wi max toshiba introduce il supporto wimax nei notebook portégé r70...
 
Stm32 vl discovery recensione - 2010-11-11
Stm32 vl discovery   recensione  - 2010-11-11Stm32 vl discovery   recensione  - 2010-11-11
Stm32 vl discovery recensione - 2010-11-11
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

IoT with OpenPicus Flyport

  • 1. Page | 1 9-Feb-12 JMLambert V1.0 IoT with OpenPicus Flyport : Temperature/Pressure with BMP085 I2C LCD setup Use case of Pachube and Paraimpu
  • 2. Page | 2 9-Feb-12 JMLambert V1.0 Introduction After the previous exercise with a Flyport Simulator connected to the web services, I will expose the experience and solution of the following problem : - Acquire Temperature & Pressure of a BMP085 device on a I2C bus - Set the Real Time clock to the web time and use an alarm to acquire regularly the measurements - Send the measurements to some Cloud storage, (I have integrated successfully NimBits, ThingSpeak, Paraimpu and Pachube…) - Display the curves of the measurements on the web page of the Flyport. - Setup a LCD display HD44780 connected to the Flyport with I2C bus, thanks to I2C driver chip that is easy and low cost and need less wires. - Display some values on the local LCD as a “weather station”… As explained above, I tried different Web Services to store the data, and Pachube seems quite good as it allows a very easy graphing out of the data. But Pachube is not able to process the Data and generate alerts (it seems) as easy as with ParaImpu I chose to create a Pachube sensor in Paraimpu, and a connector inside Paraimpu that will tweet a message when an alert is raised. We will see how. I2C Bus & BMP085 acquision programming. I connected the BMP085 directly on the Flyport, as it handles already on board the pullup. I used the few libraries from the OpenPicus Download content : - OP-LIB - i2c Helper rev1.0.zip - LIB - BMP085 temperature sensor_rev1.0.zip After some initial issue on the I2C reading, I fixed the soldering… I just connected the required wires : GND+VCC + I2C Bus : SCL+SDA
  • 3. Page | 3 9-Feb-12 JMLambert V1.0 Web time & RTCC Programming The objective is to get the current time from an external web site (always included in a response), then set the time in the RTCC and create alarms from the RTC at regular interval to perform the acquisition and sensor data transmission to the storage (not too often) Get the time from a web site header : www.google.com In aim to get the time, the simpler is to make a POST request to a site, and analyses the header response. Then you extract the fields and use them to initialize the RTCC.
  • 4. Page | 4 9-Feb-12 JMLambert V1.0 Then, the time will be set in the RTCC and next steps :
  • 5. Page | 5 9-Feb-12 JMLambert V1.0 I2C Bus & LCD HD44780 I used also the I2CHelper library as above, but I needed to create a new function : New function : I2CSendString() To handle the LCD, I added a new function in complement to the I2CHelper : I2cSendString() This function is necessary to send messages to the I2C LCD and handles the split of messages within the max size of the I2C buffer (generally 32, but it is a parameter) LCD Display organization In aim to put some flexibility in the way to create and eventually change the content of the display dynamically, I have gone through some descriptions data.
  • 6. Page | 6 9-Feb-12 JMLambert V1.0 This function is the one that will prepare the right strings in the display buffer for the iFieldNum field. The above pointers are filled with Malloc to allocate the right size to the array. I put 2 sets of strings, the one Requested, that is prepared with the above formatting elements and the one Content that is filled after the LCD is updated. This allows sending messages to the LCD only when a char has changed, and reduce the number of useless I2C message. If we put the time HH:MM::SS, anyway, the update will be at least each second, but if you put only minutes, then the message will only be sent every minute or if a displayed measure changes. LCD I2C Controller BV4208 http://www.i2c.byvac.com/downloads/BV4208%20DataSheet.pdf A set of commands is declared for this driver that is quite simple. The LCD I2C Driver is also containing a EEPROM, that may be used for preset messages, but also to store your own params independently of the OpenPicus file system.
  • 7. Page | 7 9-Feb-12 JMLambert V1.0 We will use the I2CHelper library completed as described above to send long strings. Note : I am preparing a library for that chip, but as I did not received the LCD from my order, I cannot test it… This will be in the V2 of the document.
  • 8. Page | 8 9-Feb-12 JMLambert V1.0 Pachube Setup & use Pachube is a place to collect Sensor feeds, and allow their presentation in graphs. Sensor declaration You need to declare your sensor (Feed) that may contain several datastreams. The feeds is at the url: /feeds/<feednumber> and you will have some access keys. API Keys & Access control You may have generic keys or specifics that have their own restrictions, (for example the key can be used to update only one datastream, or you may allow only one IP address as origin, as well for getting the data, you have some access controls. For example : Here I create a key that would be able to UPDATE only the pressure datastream of the feed 47332 Then the Key provided will be put in the URL of access for the action (PUT/GET/DELETE etc) in the http header field X-PachubeApiKey:
  • 9. Page | 9 9-Feb-12 JMLambert V1.0 You may also regenerate the key, if you do not know if your key has been compromised. The http requests are well documented in the API manual of Pachube here https://pachube.com/docs/ Once you have declared your feed, your datastreams (with an ID that will be used in the API call), and you have got the key allowed to access the stream, you will need to put them in your program. Web service format What is interesting is that you may use several formats to update the streams : JSON, XML or CSV For easy cases, it if obvious that the CSV is preferred. The selection of the format is made at the URL level http://api.pachube.com/v2/feeds/1977/datastreams/1.csv For CSV the data string will contain one value per line (each line separated by “rn”) Example : “1,20.5rn2,1013.0rn” means assign 20.5 to the datastream 1 and 1013.0 to datastream 2. In this project, I construct this string that will be sent to the api.pachube.com url via a PUT request : sprintf( tmpString, "PUT %s HTTP/1.1rnHost: %srnAccept: */*rnContent-Type: text/csvrnX-PachubeApiKey:%srnContent-Length: %drnConnection: closernrn%s", RemoteURL, ServerName, PachubeKey, strlen(buf), buf );
  • 10. Page | 10 9-Feb-12 JMLambert V1.0 Pachube Graphing By default, Pachube proposes a graph of all datastream like that : You may tune the graphic by the parameter button and generate a URL of the result to include in your Flyport webpage. Your browser will get the URL from the flyport, but will get the display from the Pachube site. https://api.pachube.com/v2/feeds/47332/datastreams/1.png?width=730&height=250&colour=%23f15a24&duration =1day&show_axis_labels=true&detailed_grid=true&timezone=UTC The duration is a parameter that you may manually change or even put a dynamic field inside to change that dynamically (~my_duration~) to replace the 1day above by a choice you may integrate in your web page. (eg: popup) Triggers/ Alerts You may have some triggers on some datastream, to generate alerts in twitter or SMS. I have tested the SMS alert, but not the tweet. There are several applications around Pachube that you may explore too. Interface with Paraimpu Paraimpu is competitor of Pachube (beta) I have successfully connected my flyport to Paraimpu, but it is not featuring graphing yet. So I choosed Pachube for data & graphing, and tried Paraimpu for the tweets management; Identically to Pachube, you need to declare a sensor in Paraimpu and get a key to use the web service to publish your sensor data. There is an OpenPicus sensor template that you may use. This is in fact providing a piece of C code that can be the starter to make your sensor. The API key is included in the C code, and is not available in the Web Page. I have requested the change, as this seems not the best choice… In this project, the Pachube is seen as a sensor itself, and data are gathered from Pachube. Then I have declared a twitter Actuator with my twitter account.
  • 11. Page | 11 9-Feb-12 JMLambert V1.0 And the last point is the connection that is making the link between the sensor data and the actuator : You may have a message going to your actuator depending on the value received on the sensor. Here I just put a message depending on the temperature. You may create a message with smart content to have a script interpreted in your flyport for example.
  • 12. Page | 12 9-Feb-12 JMLambert V1.0 Misc I used the malloc/free to manage the dynamic memory allocation. I just added the heap.s file in the project directory to create a heap of 2000bytes. Then you just need to declare pointers and allocate memory that you assigned to that pointer. Standard example : This is quite useful for the http requests of body that do not need to be kept very longtime.