• Ingen resultater fundet

PLATFORM FOR THE INTERNET OF THINGS

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "PLATFORM FOR THE INTERNET OF THINGS"

Copied!
31
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

www.nabto.com

PLATFORM FOR

THE INTERNET OF THINGS

(2)

AGENDA

• What is Nabto

• Architecture

• Devices as web servers

• Programming a micro web server

• Client API

• Live examples

(3)

PROBLEM?

Devices Internet

User

Firewalls and security

• Server bottlenecks

• Complex development

• HTML design for different purpose

(4)

CONNECT – SIMPLE AND SECURE

Nabto’s vision: Develop a communication platform for the

“Internet of things”. The platform should at least solve the following issues:

• Connect: Remote (browser) access

– Increase end-user value of your product by offering remote access

• Simple: Simple platform

– Lower development and maintenance cost of your firmware

• Secure: Maximal security

– Nabto is build upon state-of-the-art security

(5)

NABTO – THE PRODUCT

UDP stack System On Chip

Nabto uServer Client

Cloud service:

Basestation

Direct interactive P2P connection Nabto

Client API

A software platform for the ”Internet Of Things”

With a peer-to-peer interactive client pull focus

Connect Request

- Identification - Data-push - Awareness

(6)

EXISTING DESIGN

Device Software

Vendor Client API

Cloud service:

Relay

Compared to existing design

HTTP - Data-push

- Awareness

Notice:

All data relayed through the cloud service (performance, security issues)

No internet = no interface and access

All HMI computing is central

Latency is suboptimal

HMI computing is not (necessarily) encapsulated modular

(7)

NO INTERNET – NO PROBLEM

Browser

Nabto Browser

Plugin

Nabto uServer

Embedded Logic

PC Nabto device

2. I’m here : IP address

3. nabto:// connection

NB: LAN can be just a net-cable from Laptop to device 1. Broadcast :

are you on LAN?

(8)

WEB SERVERS

What they got

Standard Internet-platform:

Expensive Complex

What they need Nabto platform:

Inexpensive Simple

NB: HTTP was created a CERN for another problem type

Ardunio, ColdFire, FreeRTOS, GainSpan, Microchip, RTX4100, ...

(9)

MOVE THE COMPLEXITY TO THE CLIENT

Browser

Nabto Browser

Plugin

Nabto uServer

Embedded Logic

PC Internet aware device

Complexity is moved from Device to Client platform by installing a protocol plugin on the client

Complexity

(10)

HTML DEVICE DRIVER

Browser

Nabto Browser

Plugin

Nabto uServer

Embedded Logic

PC Internet aware device

English HTML-DD

Spanish HTML-DD

French HTML-DD

German HTML-DD

Company HTML-DD

OEM1 HTML-DD

OEM2 HTML-DD

OEM3 HTML-DD

(11)

MICRO WEB SERVER EXAMPLE

• Web server running on 8 bit Atmel AVR CPU with 2 kB of RAM, 32 kB flash

(12)

REAL LIFE EXAMPLE: DANFOSS

Freescale MCF52255 – 64kb RAM 512kb flash

(13)

NABDUINO

http://nabduino.com

(14)

NABDUINO BOARD

DEMO - http://demo2.nabduino.net

(15)

Klaus Bay Madsen Developer • kbm@nabto.com • www.nabto.com

BREAK

15 minutes break

(16)

DEVELOPMENT TOOLS

http://nabduino.com/download

• Download and install MPLAP X IDE

• Download and install MPLAB C18 compiler

• Don’t download the XC compilers (when asked to)

• Only build bootloader_release with free compiler

• Goto Microchip Application Libraries

• Download and install Microchip Libraries for Applications

• Download Nabto Updater

• Copy NabtoUpdater.exe to location for easy drop’ing

• Download and unzip the Starterkit

• cd unabto_starterkit\unabto\external

• mklink /J Microchip "C:\microchip_solutions_v2013-02-15\Microchip"

(17)

DELIVERY

Client

Nabto Client

API

Nabto Framework

Product logic

Nabto Base station Closed source - Client API

Source available - Starter Kit ($)

Closed source ($)

Chip and Hardware modules ($)

Nabto Interface

Product logic

(18)

1. IMPLEMENT FUNCTIONS

nabto_init_socket nabto_close_socket nabto_read

nabto_write nabto_random

… Nabto

Framework

Platform Interface Device platform

UDP/IP stack

Implement 14 platform functions (or use an existing implementation)

Implement the application event handler (see later)

Implement the main loop (loop or event driven) main

application_event Application Interface

#define NABTO_DEVICE NABTO_DEVICE_PIC18

(19)

2. IMPLEMENT MAIN LOOP

int main() {

nabto_main_context_t nmc;

nabto_init_default_values(&(nmc.nms));

nmc.nms.id = "foo.u.nabto.net";

nabto_main_init(&nmc);

while (true) {

nabto_main_tick(&nmc);

sleep_ms(10);

}

nabto_main_close(&nmc);

return 0;

}

(20)

3. IMPLEMENT EVENT HANDLER

application_event_result_t application_event(

application_request_t* req, buffer_read_t* ibuf, buffer_write_t* obuf) { switch (req->query_id) {

case 0x0a: {

uint16_t sensor_id;

uint8_t filter;

uint16_t temperature;

buffer_read_uint16(ibuf, &sensor_id);

buffer_read_uint8(ibuf, &filter);

temperature = readTemperature(sensor_id, filter);

buffer_write_uint16(obuf, temperature);

return AER_REQ_RESPONSE_READY;

} }

return AER_REQ_INV_QUERY_ID; }

(21)

4. IMPLEMENT HTML-DD

Client Client API

Nabto Framework

Embedded Logic

Client Internet aware device

“HTML-Device driver” encapsulates GUI and defines specific data transport interface of the device

HTML Device

Driver

Compact nabto protocol

(22)

HTML DEVICE DRIVER

Just a simple .zip file

• /static

– Static content = jpg, png, css, javascript, etc.

• /nabto

– HTML templates (old style)

• /nabto/unabto_queries.xml

– Mapping : Request URL -> Binary format

– Mapping : Response -> JSON response

(23)

EXAMPLE : GETTEMPERATURE

<query name="getTemperature" id="0x0a">

<request>

<parameter name="sensorId" type="uint16"/>

<parameter name="filter" type="uint8" default="0"/>

</request>

<response format=“json">

<parameter name="temperature" type=“uint16"/>

</response>

</query>

(24)

EXAMPLE : GETTEMPERATURE REQUEST

Nabto Browser

Plugin

Nabto Framework

Embedded Logic Internet aware device

Browser

User input - via a nice menu

nabto://5924.nabduino.net/getTemperature?sensorId=3

0x0a | 0x00 0x03 | 0x00

Buf[0] : GetTemperature request identifier Buf[1,2] : Sensor identification

Buf[3] : Filter identification

(see former slide for XML definition) Request buffer:

application_event(0x0a, &Buf[1], 3) C call

(25)

EXAMPLE : GETTEMPERATURE RESPONSE

Nabto Browser

Plugin

Nabto Framework

Embedded Logic Internet aware device

Browser

0x16 0x80

function queryDevice(request) {

jQuery.getJSON(request, null, function(response) { var response = response["response"];

$(”button”).val(response[”temperature"]) });

}

Response buffer: application_event() function returns response buffer

The temperature is:

22,5 User GUI

Respone in JSON format Handled by JavaScript:

(26)

BUILDING AND BURNING

• Start MPLAB.X IDE and open project

– unabto_starterkit/unabto/demo/nabduino/MPLAB.X

• Set Nabduino as main project (in Projects window)

• Edit src/application.c (application_event)

• Build main project

• Open an Explorer

– Go to dist/bootloader_release/production in MPLAB.X

• Drag MPLAB.X.production.hex to NabtoUpdater.exe

• Reset the nabduino board

• Documentation:

– unabto_starterkit/doc/starter_kit/unabto_starterkit.html

(27)

CLIENT API

Customer Client Software

Nabto

Protocol Adapter PC / Smartphone

TCP Port

On demand

TCP-Portforwarding

Nabto Protocol

Adapter

IP interface Virtual On demandVPN-forwarding

Network card

Browser

On demand

HTTP-proxyforwarding

Nabto Browser Plugin APP

On demand

Low-footprint HTTP

Nabto Client API

Programatic Remote Procedure Calls

Or JSON requests

(28)

NABTO – CLIENTAPI - PROGRAM CONNECTION

UDP stack System On Chip

Device Nabto Framework Program

Basestation

PC

Cloud service

P2P connection

Data connection

Nabto Client

API Discovery services

(29)

CLIENT API

• Configuration and initialization API

• nabtoStartup

• nabtoShutdown

• Session API

• nabtoOpenSession

• nabtoFetchUrl

• nabtoAsyncFetch

• nabtoCloseSession

• Streaming API

• nabtoStreamOpen

• nabtoStreamRead

• nabtoStreamWrite

• nabtoStreamClose

• Tunnel API (next release)

• nabtoTunnelOpenTcp

• nabtoTunnelInfo

• nabtoTunnleClose

(30)

TUNNELING

Device n.demo.net

Nabto Framework Client

client.home.net nabto Nabto

Client API

Server 192.168.

TCP/IP 1.34

Port 80

Port 5555

nabtoTunnelOpenTcp(..., 5555, ”n.demo.net”, ”192.168.1.34”, 80);

Some application TCP/IP

Connect to port 5555 on client.home.net, for instance:

% wget http://client.home.net:5555/some-file

Firewall

(31)

THANK YOU FOR LISTENING

Klaus Bay Madsen Developer • kbm@nabto.com • www.nabto.com

Referencer

RELATEREDE DOKUMENTER

usually cited as a main reason why the Internet is unregulable, or resistant to State regulation is only the result of specific protocol design choices Internet Protocol..

Energinet.dk allows that the Horns Rev 3 platform is sourrounded by wind turbines if a cone around the platform and a coorridor along the export cable is kept free of turbines,

z On binding to a remote object, the client imports an object proxy from the server.. z Remote references specify server name and path to the object (or to the

Table 2: Revenue models of personal data platform operators... the platform operator or a third party on the platform would be charged from the individual or the service

Establishing whether the relation between the platform and the peer-provider is an employment relationship is of course relevant only when the platform is a

• Client language should shift toward more change talk and less sustain talk only in the MI+ group.. Overall Impact of Training on

By conceptualizing smart cities as a platform of platforms, this paper uses the business model approach to develop a platform governance framework in the smart city context..

It allows client programs to call procedures in server programs running in separate processes and generally in different computers from the client....