Skip to content

Hezhou Module Development ​

Hezhou development diagram

Hezhou Module Introduction ​

Hezhou modules are a series of high-performance, low-power cellular communication modules widely used in the IoT field. The following is a detailed introduction to Hezhou modules:

  1. Product overview: Hezhou modules support various standards from 2G to 4G, including Cat.1 bis, Cat.1, Cat.4, and NB-IoT. These modules support not only traditional AT commands but also LuatOS, an embedded operating system developed based on Lua scripts, which makes development simpler and faster.

  2. Core features: Hezhou modules offer rich network protocol support, such as TCP/UDP, TCP-SSL/TCP-TLS, MQTT, HTTP, WEBSOCKET, NTP, and more. This protocol support allows the modules to run stably in various network environments and meet the needs of different application scenarios.

  3. Low-power design: Hezhou modules provide multiple low-power modes, including the 500uA (response-first) mode and the 2uA (PSM+) mode. These modes significantly reduce standby power consumption through optimized power management and extend device battery life.

  4. Remote upgrade: Hezhou modules support FOTA (Firmware Over-The-Air) remote upgrades. Users can upgrade firmware through the Hezhou IOT platform or a self-built server without on-site operations, greatly reducing maintenance costs.

  5. Hardware interfaces: Hezhou modules provide rich peripheral pins, such as USB, UART, SPI, I2C, PWM, GPIO, and more. These interfaces allow the modules to easily connect with various sensors, controllers, and other devices to implement complex functions.

  6. Application areas: Hezhou modules are widely used in smart cities, smart homes, industrial automation, intelligent transportation, and many other fields. Their high performance, low power consumption, and rich features make them an ideal choice for IoT applications.

In summary, Hezhou modules occupy an important position in the IoT industry thanks to their high performance, low power consumption, rich features, and wide range of application areas.

Air724 SDK Overview ​

1. Runtime Environment ​

  • VS Code simulation
  • Air724 board: when selecting the underlying library pac file, note that it must support the float type
  1. Install luatIDE in VS Code

  2. Install the Air724 USB-related drivers

  3. Use luatools

    For all of the above, refer to https://doc.openluat.com/wiki/26?wiki_page_id=3063

2. Running the Code ​

  1. Simulate and debug in VS Code Copy mainVscode.lua as main.lua Comment out the hardware-related code in WeiMeiApp.lua, such as adc, temperature, etc. Configure the Product ID, MQTT, and other information in the WuMeiTest.lua file Simulate and debug
  2. Run the code on Air724 hardware Copy mainAir724.lua as main.lua Uncomment the hardware-related code in WeiMeiApp.lua, such as adc, temperature, etc. Configure the Product ID, MQTT, and other information in the WuMeiTest.lua file Use luatools to create a project; you need to load the main.lua, WeiMeiApp.lua, WeiMeiComAuth.lua, WeiMeiComInteraction.lua, and WuMeiTest.lua files, as well as the underlying library with float type support

3. Code File Description ​

  1. WeiMeiComAuth.lua: used for authentication processing Supports simple authentication and encrypted authentication
  2. WeiMeiComInteraction.lua: user interaction Supports information, properties, functions, events, and monitoring Supports scheduled uploading of properties, functions, and events
  3. WeiMeiApp.lua Main development happens in this file Provides information, property, function, and event data functions externally; these functions directly return packaged JSON strings

AIR780E CSDK Overview ​

1. Development Environment ​

  1. Install the relevant drivers; refer to https://doc.openluat.com/wiki/37?wiki_page_id=4454
  2. Choose a code editor according to your preference: VS Code, VS2022, SI, etc.
  3. For compilation, refer to https://gitee.com/openLuat/luatos-soc-2022
  4. Use luatools

2. FastBee CSDK Overview ​

  1. Project path: sdk\合宙\air780e\csdk\wu_mei
  2. This path contains the header file directory, the source file directory, and the xmake project management files

3. Code File Description ​

  1. app.c: application development based on the encapsulated FastBee communication SDK. For example, collecting temperature, handling control commands issued by the platform, and so on are all handled in this file
  2. base64.c: used to handle all base64 encoding for FastBee authentication
  3. comAuth.c: used for FastBee's HTTP time synchronization and the encrypted generation of the MQTT client ID
  4. comInteraction.c: encapsulates interactions with the FastBee platform's Thing Model
  5. main.c: program entry; contains the standard development entry for the Air780E, where a thread is created and started
  6. optocoupler.c: optocoupler collection code for the FastBee-matched Air780E development board
  7. relay.c: relay operation code for the FastBee-matched Air780E development board
  8. uart.c: serial port code for the FastBee-matched Air780E development board, supporting RS485 control
  9. wuMeiLed.c: LED code for the FastBee-matched Air780E development board
  10. wuMeiMqtt.c: parameter configuration for SDK-platform communication and MQTT communication management

4. Pitfall Guide ​

  1. The Air780E CSDK has a limit on the number of MQTT subscriptions. It can be adjusted in the sdk\合宙\air780e\csdk\luatos-soc-2022\thirdparty\mqtt\MQTTClient-C\src\MQTTClient.h file #define MAX_MESSAGE_HANDLERS 5 /* redefinable - how many subscriptions do you want? */
  2. Note that MQTT on the Air780E runs in an internal thread; pay attention to processing incoming data. The encapsulated Hezhou SDK avoids this pitfall
  3. The standard cjson does not support 64-bit number types, but they are used during time synchronization. This issue has been resolved and submitted to Hezhou's official code repository; just pull it directly
  1. Companion development schematic path: sdk\合宙\air780e\开发板原理图\wumeiair780e.pdf

FastBee | fastbee.cn