The previous article briefly described the path for embedded developers and Internet developers to seamlessly enter the Development of the Internet of Things through Alibaba Cloud IoT platform products, and many developers expressed their desire to try. This article provides a practical development for Internet developers reference, yes, the whole process only you are familiar with Javascript, C&JAVA, all out of the way.
I. Overview of Demo
This example uses the Developer Kit that has been transplanted to AliOS Things as the development hardware to report onboard temperature and humidity sensors to the Link Develop cloud and display them through a Web App.
Ii. Development process
0. Configure the environment
AliOS Things is a highly scalable Internet of Things operating system under The IoT of Alibaba Cloud for the IoT field. It has a built-in JavaScript engine for the needs of Internet developers — BoneEngine@Lite, The development of the Internet of Things that previously depended on C/C++ can also be done with Javascript language. At the same time Tinyengine has simplified the syntax, so that the embedded devices with relatively tight resources can also run JS applications.
Using Tinyengine for device development, the first step is to configure the environment.
- Install Node.js (version >= 6.4.0, front-end development involved, recommended >= 8.9.0)
-
Install the BE-CLI tool. App. bin: NPM I be-cli -g -p supports serial port and network update
If the command cannot be found after running 'be', run the following command to get the Nodejs module installation pathCopy the code
NPM prefix -g adds the output global installation Path to the Path entry of the environment variable.
- Windows users only: Install Python, Visual Studio, and AliOS plug-ins, and then install the hardware USB driver.
- Install Git and download AliOS Things
git clone [email protected]:alibaba/AliOS-Things.git
After the environment configuration, we officially entered development:
1. Cloud development
First of all, apply for an Aliyun account and log in to Link Develop one-stop development platform: linkdevelop.aliyun.com
After that, new project (any project name) — equipment development — new product — category select “Other”, communication mode select WiFi, data format select Alink — complete.
Then select “Add Custom Function” in the product details and add the following function Settings:
Click the Device Development TAB to add a debugging device and record the device triplet.
2. Device side development
Use the compiler to open AliOS Things the source directory, open the AliOS – Things/framework/tinyengine/samples/app/lcd_shtc1_mqtt/device. Js file, Change the device Three Elements to Device Triplet obtained in the previous step and save the Settings.
Compile the sample app using a terminal: be -p samples/app/ lCD_shtc1_MQtt
Connect the development board to the computer and execute: Be Connnect
Finally, burn the compiled bin file to the device: be push app.bin
After the device is restarted, the index.js file automatically loads and runs, and reports data to the Link Develop platform.
3. Web App development
To help you get started, use the new Link Develop platform’s visual Web App. Just drag in the hygrometer component and connect the data.
Experienced front-end developers can also use bone.js framework for core programming, or familiar Javascript: bone.aliyun.com/bone-web/bo…
With AliOS Things’ TinyEngine and Link Develop’s Bone.js framework, Internet developers can quickly and seamlessly enter IoT development without having to master other programming languages, demonstrating the inclusiveness and originality of Alibaba Cloud IoT platform. Internet developers, get over your hesitation and give it a try!