Skip to content

Tuya-Community/tuya-iotos-embeded-demo-wifi-ble-liquid-level-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuya IoTOS Embeded Demo WiFi & BLE Water level sensor

English | 中文

Introduction

This Demo is based on Tuya Smart Cloud Platform, Tuya Smart APP, IoTOS Embeded WiFi &Ble SDK, using Tuya WiFi/WiFi+BLE series modules to quickly set up water level sensors and achieve remote monitoring of water level data by cell phone.

Quick start

Compile & Burn

  • Download Tuya IoTOS Embeded WiFi & BLE sdk

  • Download the demo to the apps directory of the SDK directory

    $ cd apps
    $ git clone https://github.com/Tuya-Community/tuya-iotos-embeded-demo-wifi-ble-liquid-level-detection
  • Execute the following command in the SDK root directory to start compiling.

    sh build_app.sh apps/tuya-iotos-embeded-demo-wifi-ble-liquid-level-detection tuya-iotos-embeded-demo-wifi-ble-liquid-level-detection 1.0.0 
  • Firmware burn-in license information please refer to: Wi-Fi + BLE series module burn-in license

File description

├── src	
|    ├── app_soc           
|    ├── tuya_device.c       
|    ├── app_sensor.c        
|    └── sensor_control.c  
|
├── include			
|    ├── app_soc
|    ├── tuya_device.h
|    ├── app_sensor.h
|    └── sensor_control.h
|
└── output          

Application entry

Entry file: tuya_device.c

Important functions: device_init()

  • Call tuya_iot_wf_soc_dev_init_param() interface to initialize the SDK, configure the operating mode, the mating mode, and register various callback functions and store the firmware key and PID.
  • Calling the tuya_iot_reg_get_wf_nw_stat_cb() interface to register the device network status callback functions.
  • Call the application layer initialization function app_plant_init()

dp point related

  • Send down dp point data stream: dev_obj_dp_cb() -> deal_dp_proc()
  • Report dp point interface: dev_report_dp_json_async()
function name OPERATE_RET dev_report_dp_json_async(IN CONST CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,IN CONST UINT_T cnt)
devid device id (if it is a gateway, MCU, SOC class device then devid = NULL; if it is a sub-device, then devid = sub-device_id)
dp_data dp structure array name
cnt number of elements of the dp structure array
return OPRT_OK: Success Other: Failure

I/O List

Water level sensor
ADC3 P23

Related Documents

Tuya Demo Center: https://developer.tuya.com/demo/


Technical Support

You can get support for Tuya by using the following methods:


About

Tuya WIFI BLE Liquid Level Detection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages