当前位置:网站首页>Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
2020-11-06 22:01:00 【Huawei cloud developer community】
Abstract : Try to use the bear pie to develop the board (E53_SC1、NB35) The real device replaces the simulator to complete the construction of intelligent street lamp application experiment experience .
Intelligent street lamp is an important part of the city intelligent road , The implementation of smart street lamp can save energy consumption of public lighting 、 Reduce traffic accidents caused by lighting and other social significance . Street lamp is also a public facility that we can feel strongly in our daily life , It's easier to understand the intelligent scene .
Physical network based solutions , We can realize the remote monitoring and control of street lamps , Realize remote control 、 On demand lighting and other functions , Reduce the cost of street lamp operation .
Experience 《 Sandbox experiment : be based on IoT Platform to build smart street lamp application 》 After the experiment , Some partners always feel that the simulator experience is not as good as the real device , So I try to use the bear pie development board (E53_SC1、NB35) Real devices replace simulators to complete the experimental experience . among , Most of the procedures are the same , This article only lists the need to modify and pay attention to the place .
Platform side :
1、 Create products :
- Simulator : Agreement type is MQTT
- Real devices : Agreement type is LwM2M/CoAP, And need to develop and deploy codec plug-ins .
2、 Configure smart streetlight applications ( Register device ):
- Simulator : The device identification can be customized , Such as 123456789f.
- Real devices : The equipment identification should be filled in as NB35 Communication module IMEI, You can use the serial port tool +AT Instructions (AT+CGSN=1) Query access device IMEI.
Application side :
1、 Compiling and constructing smart streetlight application :
After creating the code repository , Need to modify part of the code to fit the real device .
① modify src/main/java/com/huawei/service/RegisterDirectConnectedDevice.java, Add the following code .
paramReg.put("device_name", deviceInfo.getVerifyCode());



② modify src/main/java/com/huawei/service/CreateDeviceCommand.java, Change and add the following code .

③ modify src/main/java/com/huawei/controller/PushReceiver.java, Change and add the following code .

2、 Complete the above modification , Recompile to build the package ; Based on the newly built package, the streetlights are deployed to ECS The server .
Equipment side :
1、 Resources to prepare :
- Simulator :HubSimulator.jar
- Real devices : Cubs development board (E53_SC1、NB35)
2、 Real devices need end-to-side development , The code to compile 、 burn . recommend IDE:VS Code+IoT Link plug-in unit
3、 Create based on the example project :oc_streetlight_template

4、 modify Demos\oc_streetlight_template\oc_streetlight_template.c, Fill in the docking IoT The reality of the platform IP、 port .
#define cn_endpoint_id "BearPi_0001"
#define cn_app_server "119.3.250.80"
#define cn_app_port "5683"
5、 Complete the above modification , Compile and burn .
The results verify that :
1、 Please turn the development board dial switch to AT+MCU Side , And pass USB Connect PC Access to electricity , Report data .
2、 wait for 1-2 Minutes to view the application interface , The page should show “ Ambient brightness ” Report values for the device ,“ Light status ” by toggle state .
3、“ Street light control ” choice “ Terminal joint control mode ”, Switch selection “ open ”, single click “ Set up ”.
- Check the development board streetlights status , The light should be on .

4、“ Street light control ” choice “ Auto dimming mode ”, Set the brightness threshold to 100.
- If the light intensity reported by the equipment is greater than 100, The app will automatically issue a light off command , The street lights are off .
- Cover the light intensity sensor on the street lamp expansion board by hand , To make the intensity of light less than 100, If the streetlights are off , The application will issue a light on command , The street lights are on .

5、“ Street light control ” choice “ Segmented timing mode ”, Set the light off time period to 06:00-18:30.
- If the current time of the system is in the off time period , And the streetlights are on , The app will automatically issue a light off command , The street lights are off .
- If the current time of the system is outside the turn off time period , And the streetlights are off , The app will automatically issue a light on command , The street lights are on .

Sum up , Through the streetlight development board as a real device access experience is completed .
Click to follow , The first time to learn about Huawei's new cloud technology ~
版权声明
本文为[Huawei cloud developer community]所创,转载请带上原文链接,感谢
边栏推荐
- Python basic data type -- tuple analysis
- Method of code refactoring -- Analysis of method refactoring
- 迅为iMX6开发板-设备树内核-menuconfig的使用
- The role of theme music in games
- The isolation level of transaction and its problems
- Road to simple HTML + JS to achieve the most simple game Tetris
- ES中删除索引的mapping字段时应该考虑的点
- How much disk space does a file of 1 byte actually occupy
- ES6 learning notes (2): teach you to play with class inheritance and class objects
- 【涂鸦物联网足迹】物联网基础介绍篇
猜你喜欢

2020-08-15:什么情况下数据任务需要优化?
![[byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!

Mongo user rights login instruction

Introduction to Huawei cloud micro certification examination

JVM memory allocation - xms128m - xmx512m - XX: permsize = 128M - XX: maxpermsize = 512M
![[self taught unity2d legendary game development] map editor](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[self taught unity2d legendary game development] map editor

Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing

Some operations kept in mind by the front end foundation GitHub warehouse management

ES6 learning notes (4): easy to understand the new grammar of ES6

Count the number of project code lines
随机推荐
2020 database technology conference helps technology upgrade
Elasticsearch database | elasticsearch-7.5.0 application construction
Es create a new index database and copy the old index library, practice pro test effective!
The method of local search port number occupation in Windows system
2020-08-14:数据任务的执行引擎用的哪些?
Application insights application insights use application maps to build request link views
How to manage the authority of database account?
An article takes you to understand CSS3 picture border
Message queue - Analysis
2020-09-03:裸写算法:回形矩阵遍历。
STM32F030C6T6兼容替换MM32SPIN05PF
2020-08-19: what mechanism does TCP ensure reliability?
Junit测试出现 empty test suite
C and C / C + + mixed programming series 5 - GC collaboration of memory management
An article will take you to understand CSS3 fillet knowledge
All the way, I was forced to talk about C code debugging skills and remote debugging
高速公路二维码定位报警系统
How much disk space does a file of 1 byte actually occupy
The role of theme music in games
2020-08-29:进程线程的区别,除了包含关系之外的一些区别,底层详细信息?