LoRa modules often have built-in related sensor products. For example, RAK7204 is a temperature and humidity LoRaWAN sensor product. He has built-in various environmental sensors that can collect temperature, humidity, air pressure and indoor air quality parameters. Different users and different application scenarios may lead to different actual needs of users for sending and receiving data at this node. Usually as an embedded engineer, I start to develop an IoT product. For the selection of IoT modules, there are usually several ways, including serial port AT command, serial port transparent transmission, if you want to get lower power consumption and better cost , You can choose to use the MCU built into the module as your own application. However, the OpenMCU approach requires module suppliers with strong SDK integration capabilities and good supporting documentation. For example, RAKwireless has multiple LoRa modules to allow users to conduct secondary development, and also provides multiple The secondary development application examples of power consumption design can help users achieve lower system cost and lower system power consumption. Users can refer to these examples and modify them slightly according to their actual needs to achieve their own application purposes. This article introduces the specific steps of LoRa module module secondary development for developers who are using LoRaWAN module products for the first time and want to use OpenMCU for secondary development. There are two ways to do secondary development inside the IoT module. The usual approach is to integrate an SDK that can be developed. According to some of the SDK's configuration interfaces to implement their own applications, this approach requires users to The development environment of MCU must be familiar to achieve efficient development. RAKwireless provides a new way to help developers realize the use of internal MCU for secondary development. RAKwireless encapsulates a variety of scene-oriented APIs for the LoRaWAN protocol stack. Users only need to understand the usage of the API, write their own applications, and get their own development through a Web-based online compilation platform. This online compiler, The equivalent is that the developer only needs to write the specific application part, and then upload the main program, compile it, and the platform outputs an executable file, that is to complete the entire development process. Figure 1 Flowchart of secondary development of OpenMCU in RUI 1. Understand the composition of RUI and the purpose of RUI API.The firmware developed based on RUI consists of two parts: RUI SDK and Application, as shown in Figure 1 of this article. Among them, the RUI SDK part is the core of RUI, which has been adapted to the RAK LoRaWAN module product, and at the same time provides a unified set of RUI API for the Application part to call. For the purpose and usage of RUI API, please refer to the RUI API manual (available on the official website of RAKwireless, the company's official website-> resources-> documentation center, this way you can get the manuals of all products). Note: 1) Application is open source, users can carry out secondary development and modify it according to their own application logic, and the required low-level function support can be called by corresponding RUI API. 2) The RUI SDK part is not open source. It is placed in the RUI online compiler. When the user completes the secondary development of the Application part and uses the RUI online compiler to compile, the RUI SDK will be automatically loaded into the customized firmware. . 2. Comparing RAK product development practice code on Github with RAK, and understanding the usage of RUI API.RAK's LoRaWAN module and derivative products, and the application code corresponding to its officially released firmware can be found in RAK's Github at https://github.com/RAKWireless/Products_practice_based_on_RUI Figure 2 is an example of a file on Github: Figure 2 An example of the storage of Application code files corresponding to the firmware released by RAKwireless on Github As you can see, this code warehouse is divided into directories according to the model of the core module. We only need to find the corresponding core module directory, and we can see some product practice codes based on the module. Taking LoRaWAN module RAK811 as an example, as shown in Figure 3, when we enter the "based on RAK811" directory, we can see some product practice examples based on RAK811 module, these codes show how to add some peripherals and based on RAK811 module Sensors, through these sample codes, developers can quickly understand how to load sensors through RUI: rakwireless, Github, RAK811, Application code files, product practice examples Figure 3 RAKwireless LoRaWAN module RAK811 product practice example directory diagram on Github among them, 1) "app_5205" is the Application source code corresponding to the official firmware of the LoRaWAN tracker module RAK5205. An example of the folder directory is shown in Figure 4. Fig. 4 Product practice example catalogue of the LoRaWAN tracker module RAK5205 on the Github The LoRaWAN tracker module RAK5205 is based on the RAK811 module, adding environmental monitoring sensors (BME680), three-axis acceleration sensors (LIS3DH), and GPS modules (Ublox MAX 7Q). The code examples in this directory show how to complete the development of customized firmware based on the RAK811 module, connect other sensors through I2C and GPS modules through UART, and call through the RUI API. 2) "app_7204" is the Application source code corresponding to the official firmware of RAK7204, including RAK7204 sensor driver, AT command implementation, application logic processing, etc., all here (as shown in Figure 5), which uses a lot of RUI API, Used to implement related functions. Fig. 5 The product practice example catalogue of RAKwireless Wilink's LoRa module RAK7204 on Github The LoRa module RAK7204 is based on the RAK811 module and adds an environmental monitoring sensor (BME680). Therefore, you can learn how to add an I2C sensor based on the RAK811 module through the product practice code, and quickly complete the development of customized firmware through the RUI API call. For example, the file "app_7204.c" circled by the red rectangle in Figure 5 is the implementation of application logic processing. If you want to customize the development of application logic, you can focus on the code to understand the actual usage of the RUI API. 3) "app_PT100_Digital_Pressure_Sensor" is based on the RAK811 module, adding a hydraulic sensor PT100. 4) "app_RAK811" is the application code corresponding to the official firmware of the RAK811 module. If you want to modify the working logic and process of the RAK811 module, you can modify it based on the example code. 3. Choose a suitable example code from the RUI product development practice code on RAK Github, and modify it based on it, and carry out secondary development according to actual application requirements.These product development practice codes on RAK Github have realized the main part of Application, and code modification and secondary development based on it will do more with less. For example, the RAK7204 sample code shown in Figure 5 prints out the LoRa downlink data received by the node through the serial port without processing. This can be obtained from the code in the "app_7204.c" file shown in Figure see: Figure 6 The code example of app_7204.c of the LoRa module RAK7204 on the Github If you want to process the downstream data of LoRa in your customized firmware, you can achieve the goal by modifying the code of this function. 4. After completing the secondary development, use RUI's online compiler to compile to obtain the final customized firmware.RUI is the IoT end-side software tool deeply optimized by RAKwireless. After completing the customized development of the Application part, you can use the RUI online compiler to compile. The compilation interface is shown in Figure 7 and Figure 8. Figure 7 The login interface of the RUI Huilian RUI user interface Figure 8 RAKwireless RUI user interface selection product model As mentioned earlier, when compiling, the compiler will automatically load and compile the Application and RUI SDK together, and output the final customized firmware. The address of the RUI online compiler is: http://47.112.137.11:12090/#/user/login You can register and use it by email. For detailed usage, please refer to the instruction manual of RUI online compiler: https://downloads.rakwireless.com./RUI/RAK_Online_Compiler_Quick_Start_Guide.pdf 5. Burn the compiled customized firmware into RAK IoT terminal products and use OK, after the previous steps, you have compiled the final customized firmware binary file, and now you can burn it into the product for use. The method of programming the firmware is detailed in the corresponding product usage documents, and will not be repeated here. You can find the corresponding product usage in the document center (official website-> resources-> document center) of RAKwireless official website Documentation, follow the steps in the product usage documentation to complete the firmware programming. SummaryFor secondary development directly on the LoRa module with built-in OpenMCU, you can refer to the secondary development examples provided by the supplier. These secondary development examples are often designed with low power consumption. Therefore, users can not only save a lot of development time, no need for additional Purchasing components can save a lot of costs, and these secondary development application examples that have been designed with low power consumption can also achieve lower system costs and lower system power consumption. Original Post: https://zhuanlan.zhihu.com/p/127860989
1 Comment
2/11/2024 08:37:16 am
IoT SIM cards are specialized SIM cards designed for Internet of Things (IoT) devices. They provide connectivity for IoT devices to communicate with each other and with central systems over cellular networks. Unlike traditional SIM cards, IoT SIM cards offer features such as low power consumption, scalability, and remote management capabilities. They enable efficient data transmission, security, and flexibility for IoT applications across industries including healthcare, transportation, agriculture, and smart cities.
Reply
Leave a Reply. |