David Gascon, Libelium CTO, keynote talk in DevOSS Azure Days, Dec. 2014, Madrid - Spain

42
David Gascón - CTO [email protected] @DG_David_Gascon

Transcript of David Gascon, Libelium CTO, keynote talk in DevOSS Azure Days, Dec. 2014, Madrid - Spain

David Gascón - [email protected]@DG_David_Gascon

2

3

4

Waspmote: Open platform for the Internet of Things

5

Waspmote: Open platform for the Internet of Things

6

Waspmote: Open platform for the Internet of Things

7

Extreme Wireless Links for Sensor Nodes

+21km line of sight

8

Extreme Wireless Links for Sensor Nodes

+2km non line of sight (through buildings) → Urban Environment

9

10

Plug & Sense! Models

11

Smart Agriculture

12

Smart Agriculture

13

Smart Parking

14

Smart Parking

15

Smart Water

16

Smart Water

17

Nuclear Radiation Sensing

18

Nuclear Radiation Sensing

19

Forest Fire Detection

0

20

Sensors to the Space

21

Sensors to the Space

22

Sensors to the Space

23

IoT for Makers

eHealth Sensor Platform - Any Biometric Parameter

24

IoT for Makers

eHealth Sensor Platform - Any Biometric Parameter

25

IoT for Makers

Open Garden (Hydroponics)

26

IoT for Makers

Open Aquarium (Aquaponics)

27

Meshlium: Internet of Things Gateway

28

Meshlium: Internet of Things Gateway

29

- S.O: Debian + APT management package tools

- Run Time Environments: Java, PHP, Python, C++, Ruby,... [Any]

- 8GB – Compact Flash storage system

- Web Management System + MySQL for Data Storage

- CPU: 500MHz (x86)

- RAM: 256MB

- Power Over Ethernet

- Radio Interfaces:

+ WiFi (2.4GHz / 5GHz)

+ 3G (Quadband)

+ ZigBee / 802.15.4 / Sub GHz bands

+ Bluetooth

Meshlium: Internet of Things Gateway

30

Meshlium: Internet of Things Gateway

31

- Frames estructure sent by Waspmote:

ASCII-382540406-trackertest-128-194-,TIME:20141207134218+0100,GPS:41.647240;-

0.905457,SOILT:8.92,TCB:15.90,HUMB:44.6,BAT:0,RSSI:-77,IN_TEMP:17.42

ASCII-382540406-trackertest-128-195-,TIME:20141207134518+0100,GPS:41.647240;-

0.905455,SOILT:9.07,TCB:16.14,HUMB:44.4,BAT:0,RSSI:-71,IN_TEMP:17.65

ASCII-382540406-trackertest-128-196-,TIME:20141207134818+0100,GPS:41.647243;-

0.905450,SOILT:9.23,TCB:16.44,HUMB:44.0,BAT:0,RSSI:-71,IN_TEMP:17.77

Meshlium: Internet of Things Gateway

32

- A Java application reads the Frames coming from the Wireless Interfaces

(ZigBee, WiFi, 3G, 868/900MHz, etc) and parse them. Then they are

inserted in a MySQL DB:

CREATE TABLE IF NOT EXISTS `sensorParser` (

`id` int(11) NOT NULL auto_increment,

`id_wasp` text character set utf8 collate utf8_unicode_ci,

`id_secret` text character set utf8 collate utf8_unicode_ci,

`frame_type` int(11) default NULL,

`frame_number` int(11) default NULL,

`sensor` text character set utf8 collate utf8_unicode_ci,

`value` text character set utf8 collate utf8_unicode_ci,

`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,

...

PRIMARY KEY (`id`)

)

Meshlium: Internet of Things Gateway

33

- Sensor ID's:

ID ASCII ID Fields Type

0 CO 1 float

1 CO2 1 float

2 TMP 1 float

3 HMD 1 float

...

53 GPS 2 float

...

63 ACC 3 int

67 MWIFI 1 string

Meshlium: Internet of Things Gateway

34

1º – Get a namespace + credentials (ACS authentication)

2º – Needed to start the program

public static void AzureSetup(){

config = ServiceBusConfiguration.configureWithWrapAuthentication(

AZURE_NAMESPACE,

AZURE_OWNER,

AZURE_KEY,

".servicebus.windows.net",

"-sb.accesscontrol.windows.net/WRAPv0.9");

service = ServiceBusService.create(config);

}

Connecting Meshlium to Azure Bus Service

35

Connecting Meshlium to Azure Bus Service

36

3º – Get from Azure service the queues already created in the

namespace. We store this queues in order to avoid creating an already

existent queue.

public static void AzureGetQueues(){

try {

queue_list_result = service.listQueues();

queue_list = queue_list_result.getItems();

...

}

}

Connecting Meshlium to Azure Bus Service

37

4º – Then we read from our internal Data Base (MySQL) the sensor data

bufferized. e.g: 100 registers

SELECT id,id_wasp,id_secret,sensor,value,timestamp,sync FROM LOCAL_TABLE WHERE

sync^SYNC_MASK ORDER BY timestamp DESC LIMIT 100;

Connecting Meshlium to Azure Bus Service

38

5º – Then we create the JSON files with the next format

{

"id_wasp": "SmartWater",

"id_secret": "366360762",

"sensor": "ORP",

"value": "0.380",

"datetime": "02/12/2014T12:18:57+0000"

}

Connecting Meshlium to Azure Bus Service

39

6º – Just send each file to the opened queue

public static int AzureSendToQueue(String queuename, String data) {

try{

appendToLogFile("Sending message to queue: "+queuename, 1, 2);

appendToLogFile("Data: "+ data, 1, 2);

message = new BrokeredMessage(data);

message.setProperty("Queue", queuename);

service.sendQueueMessage(queuename, message);

...

}

catch (ServiceException e){

...

}

}

Connecting Meshlium to Azure Bus Service

40

Connecting Meshlium to Azure Bus Service

41

Libelium: we were in the IoT seven years ago...

42

David Gascón - [email protected]@DG_David_Gascon