Connecting and Managing Zephyr Devices Remotely Using LWM2M and Eclipse Leshan-1.pdf

編號:144792 PDF 36頁 2.14MB 下載積分:VIP專享
下載報告請您先登錄!

Connecting and Managing Zephyr Devices Remotely Using LWM2M and Eclipse Leshan-1.pdf

1、1Connecting and Managing Zephyr Devices Remotely Using LWM2M and Eclipse LeshanJulien Vermillard,EdgeIQvrmvrmhttps:/ of OMA Lightweight M2M Bootstrap Registration Object modelIntroduction to Eclipse LeshanZephyrs built in LWM2M clientWhen to use LWM2M and up&downsCoAP the Constrained Application Pro

2、tocol4Replace TCP/HTTP in a UDP based light protocolRESTful protocol designed from scratch URIs,Internet Media Types GET,POST,PUT,DELETETransparent mapping to HTTPAdditional features for M2M scenarios Observe Blockwise transferCoAP the Constrained Application Protocol5Binary protocol-Low parsing com

3、plexity-Small message sizeOptions-Binary HTTP-like headers0 8 Bytes TokenExchange handle for client4-byte Base HeaderVersion|Type|T-len|Code|IDOptionsLocation,Max-Age,ETag,Marker0 xFFPayloadRepresentationLightweight M2M6OMA Lightweight M2M7A standard device management Protocol on top of CoAPFirst pu

4、blished in 2017(v1.0)by the Open Mobile AllianceMean to replace OMA-DM for new LPWA networks(LTE-M,NB-IoT)Bootstrap phase8Flash bootstrap credentialsBootstrap phase9I only have bootstrap credentials or I cant reach final serverBootstrap phase10Give me key and my server(s)Bootstrap ServerBootstrap ph

5、ase11Bootstrap ServerNew key and server(s)URLsand ACLBootstrap phase12RegistrationRegistrationHome AutomationServerDevice Manag.ServerBootstrap ServerRegistration phase13POST/rd?ep=light1234<=300CREATED “XYZ”GET/3/0 Content-Format:lwm2m/TLVCONTENT binary encoded device objectPOST/rd/XYZ(extends th

6、e device registration)Registration&NAT14Queue Mode15Specified by the client as a registration mode parameter,Mean the Device will Register and disconnect after a given amount of time,to save powerPOST/rd?ep=light1234&mode=UQOKMax CoAP re-transmission timeOfflineObject Model16coap:/deviceip/object/in

7、stance/resourceExamples:/6/0 the whole location object(binary record)/6/0/1 only the longitude(degree)Object Model17Object Device18IPSO sensor objects19Objects model20Objects are defined in a central repository:https:/ GET where the response is sent again if the value changePOST/rdCREATED “XYZ”GET/6

8、/0?obsCONTENT binary encoded location objectCONTENT binary encoded location objectCONTENT binary encoded location objectTelemetry?22Send Operation:A POST on/dp by the clientPOST/dp Content-Format:application/senml+json n:/6/0/0,v:43.61092,n:/6/0/1,v:3.87723,n:/4/0/2,v:-49OKEclipse Leshan23Eclipse Le

9、shan24Java library for implementing servers&clientsFriendly for any Java developerSimple(no framework,few dependencies)But also a Web UI for discovering and testingBuild using“mvn install”Eclipse Californium based(CoAP/DTLS1.2)Eclipse Leshan25A public IPv4/IPv6 sandbox:https:/leshan.eclipseprojects.

10、ioBleeding edge:deployed on master commitLeshan v1 is now stable(LWM2M 1.0)Leshan v2 is under development(LWM2M 1.0&1.1.x)https:/ Server Sample26/Prepare LWM2M servervar builder=new LeshanServerBuilder();/create an Eclipse Californium based endpointvar cfBuilder=new CaliforniumServerEndpointsProvide

11、r.Builder(new CoapServerProtocolProvider(),new CoapsServerProtocolProvider();cfBuilder.addEndpoint(coap:/0.0.0.0:5683);cfBuilder.addEndpoint(coaps:/0.0.0.0:5684);builder.setEndpointsProvider(cfBuilder.build();/load the default object models(from the standard definition)var models=ObjectLoader.loadAl

12、lDefault();/add your own custom onesmodels.addAll(ObjectLoader.loadDdfResources(/models/,new String 27623.xml,27739.xml);/Create leshan server and start waiting for client connectionsvar server=builder.build();server.start();Zephyrs LWM2M client27/set base object valueslwm2m_set_string(&LWM2M_OBJ(0,

13、0,0),coaps:/myserver:5684);lwm2m_set_u8(&LWM2M_OBJ(0,0,2),0/*PSK MODE*/);lwm2m_set_string(&LWM2M_OBJ(0,0,3),my PSK identity);lwm2m_set_opaque(&LWM2M_OBJ(0,0,5),(void*)psk,psk_len);lwm2m_set_string(&LWM2M_OBJ(3,0,0),Acme Corp.);.lwm2m_rd_client_start(&client,ENDPOINT,0,rd_client_event,observe_cb);Zep

14、hirs LWM2M client28/sensor examplestatic struct k_work_delayable temp_work;static void temp_work_cb(struct k_work*work)const struct device*const hts221=DEVICE_DT_GET_ONE(st_hts221);struct sensor_value val;if(!hts221)LOG_ERR(%s:device not ready.,hts221-name);goto out;if(sensor_sample_fetch(hts221)LOG

15、_ERR(temperature data update failed);goto out;sensor_channel_get(hts221,SENSOR_CHAN_AMBIENT_TEMP,&val);lwm2m_set_f64(&LWM2M_OBJ(3303,0,5700),sensor_value_to_double(&val);sensor_channel_get(hts221,SENSOR_CHAN_HUMIDITY,&val);lwm2m_set_f64(&LWM2M_OBJ(3304,0,5700),sensor_value_to_double(&val);out:k_work

16、_schedule(&temp_work,PERIOD);void init_temp_sensor(void)if(lwm2m_create_object_inst(&LWM2M_OBJ(3303,0)=0&lwm2m_create_object_inst(&LWM2M_OBJ(3304,0)=0)k_work_init_delayable(&temp_work,temp_work_cb);k_work_schedule(&temp_work,K_NO_WAIT);LWM2M Up&Down29Lightweight!=Simple3031Firmware updates32Software updates(object9)3334Adoption&Scaling?35Omnipresent in Cellular IoT:-mandated for carrier certifications-multiple vendors for scalingMultiple millions of devices deployedQuestions&Answers36Thank you!https:/

友情提示

1、下載報告失敗解決辦法
2、PDF文件下載后,可能會被瀏覽器默認打開,此種情況可以點擊瀏覽器菜單,保存網頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站報告下載后的文檔和圖紙-無水印,預覽文檔經過壓縮,下載后原文更清晰。

本文(Connecting and Managing Zephyr Devices Remotely Using LWM2M and Eclipse Leshan-1.pdf)為本站 (2200) 主動上傳,三個皮匠報告文庫僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對上載內容本身不做任何修改或編輯。 若此文所含內容侵犯了您的版權或隱私,請立即通知三個皮匠報告文庫(點擊聯系客服),我們立即給予刪除!

溫馨提示:如果因為網速或其他原因下載失敗請重新下載,重復下載不扣分。
客服
商務合作
小程序
服務號
折疊
午夜网日韩中文字幕,日韩Av中文字幕久久,亚洲中文字幕在线一区二区,最新中文字幕在线视频网站