Contents Menu Expand Light mode Dark mode Auto light/dark mode
LuatOS documentation
(NEW) Go to English site
前往中文站点
Discord
Light Logo Dark Logo

💁 LuatOS Introduction

  • 🏠️ Home Page
  • 🕹️ Online Experience LuatOS
  • 🛠 LuatOS Tools Daquan
  • 💬 Technical Support

🌠 Quick to get started

  • 🌙 Lua Tutorial
    • Basic Grammar
    • LuaTask Framework
  • 🧮 Chips and Development Boards
    • 📊 Chip comparison and selection table
    • 📶 Air780EP(EC718P Series General)
      • Air780EP Module (EC718P Series General)
      • Hardware Data
      • LuatOS IO multiplexing configuration under firmware
      • Ec718p Series Firmware Release Notes
      • Air780EPV Additional instructions
      • Air780EPVH Additional instructions
    • 📶 Air780E(EC618 Series General)
      • Air780E Module (EC618 Series General)
      • Development Board
      • Hardware Data
      • Description of mass production brush machine
      • Network Characteristics
      • LuatOS IO multiplexing configuration under firmware
      • Air780EG Additional instructions
      • Air700E Additional instructions
      • TTS Description of the function
      • Firmware Description
      • FOTA Upgrade and generation of upgrade package
      • Air780E_PCB
      • EC618 Series Firmware Release Notes
    • 📶 Air780EP(EC718P Series General)
      • Air780ES Module
      • Air780EPS Module Firmware Release Notes
    • 📡 PC Simulator
      • Method of use
      • Code base for simulator
      • Generate and manage luadb files
    • 🚢 satellite navigation GNSS
      • Air510U
      • Air530Z
      • auxiliary positioning AGPS
      • Used with communication modules (such as 4G modules)
      • Introduction to Other Positioning Methods
    • Core Software LuaTools
      • Function introduction
      • LuaTools Version History
    • 🛴 Air001
      • Air001 Chip
      • Development Board
      • Hardware Data
      • Air001 Keil MDK-based user manual
      • Air001 Arduino-based user manual
      • Air001_PCB
    • 🚲 Air32F103
      • AIR32F103 Chip
      • Development Board
      • Hardware Data
      • Air32F103 Manual
      • Transplant from SXX32F103
      • Enhanced function instructions
      • DAPLink Manual
      • Air32F103_PCB
      • BluePill_PCB
    • 📡 Air601
      • Air601
      • Air601-12F Development Board
      • Air601 Hardware Data
      • Firmware Release Notes
      • About the mac address
      • Upgrade with the co-IoT platform
      • SPI SLOVAL FUNCTION
    • 🚗 Air101
      • Air101 Chip
      • Development Board
      • Hardware Data
      • Air101 Hardware Design Tutorial
      • Air101 Getting Started Manual
      • Air101_PCB
      • Air101 power consumption curve
    • 🚗 Air103
      • Air103 Chip
      • Development Board
      • Hardware Data
      • Function Description of Segment Screen/Segment Screen
      • Touch sensor/touch button
      • Air103_PCB
      • Air103 power consumption curve
    • 🚗 Air105
      • Air105 Chip
      • Air105 Development Board
      • Hardware Data
      • Air105_PCB
      • Air105 power consumption curve
      • Air105 Script Encryption
    • 📡 ESP32-C3
      • ESP32C3-CORE Development Board
      • Hardware Data
      • ESP32-C3_PCB
      • ESP32C3 power consumption curve
      • Replace flash tutorial
      • Issue Notes
    • 📡 ESP32-S3
      • ESP32S3-CORE Development Board
      • Hardware Data
      • ESP32-S3_PCB
      • Portable wifi data collection
    • 📡 RP2040
      • RP2040_PCB
    • 🚲 SWM181CBT6
      • SWM181CBT6 Chip
      • Development Board
      • Hardware Data
      • SWM181 Manual
      • SWM181_PCB
    • 📶 Air302
      • Air302 Module
      • Development Board
      • Hardware Data
    • 📡 Air640w
      • Air640w
      • Development Board
      • Hardware Data
    • 🚗 W806
    • Performance testing (based on coremark)
    • Equipment Support/Supported Devices
    • FAQ List
    • Air724UG
    • Air820UG
  • 🧷 Peripheral expansion data
    • Air10x Series Screen Expansion Board
      • Hardware Data
      • Use Example
    • EINK1.54 Ink screen
      • Hardware Data
      • Use Example
    • 1.8 TFT LCD resolution 128x160
      • Hardware Data
      • Use Example
    • 2.4 Inch TFT_ LCD color screen resolution 240x320
      • Hardware Data
      • Use Example
    • 1.54 Inch TFT_ LCD resolution 240x240
      • Hardware Data
      • Use Example
    • Air105 Supporting GC032A camera
      • Hardware Data
      • Use Example
    • Qualcomm Font Chip
      • Hardware Data
      • Use Example
  • 📚 Development Tutorial
    • recommend learning line
    • Construction of development environment
    • Burn Tutorial
    • API Tutorial
      • log
      • sys
      • adc
      • CRYPTO
      • fdb
      • DISP
      • i2c
        • air101
        • air103
        • air105
      • spi
        • air101
        • air103
        • air105
      • uart
        • air101
        • air103
        • air105
      • LCD Drive screen
      • mcu
        • air101
        • air103
        • air105
      • PM
      • pwm
        • air101
        • air103
        • air105
      • RTC
      • sfd
      • sfud
        • air101
        • air103
        • air105
      • timer
  • Firmware Download

📖 Reference Manual

  • 🍴 LuatOS-SOC Interface Documentation
    • Adaptation status
    • adc - Analog-to-digital conversion
    • antbot - Ant Chain
    • audio - Multimedia-Audio
    • bit64 - 32 Basic arithmetic and logical operations on 64-bit data on bit systems
    • camera - Camera
    • cc - VoLTE Call function
    • codec - Multimedia-Codec
    • coremark - Running points
    • crypto - Encryption and decryption and hash functions
    • dac - Digital-to-analog conversion
    • disp - disp Library (Obsolete)
    • eink - ink screen operation library
    • ercoap - New Coap Protocol Parsing Library
    • errDump - Error reporting
    • fastlz - FastLZ Compression
    • fatfs - read/write fatfs format
    • fdb - kv Database, power failure does not lose data
    • fonts - Font Library
    • fota - Underlying Firmware Upgrade
    • fs - Additional File System Operations
    • fskv - kv Database, power failure does not lose data
    • ftp - ftp Client
    • gmssl - national secret algorithm(SM2/SM3/SM4)
    • gpio - GPIO Operation
    • gtfont - Qualcomm Font Chip
    • hmeta - Hardware metadata
    • ht1621 - LCD Driver(HT1621/HT1621B)
    • http - http Client
    • httpsrv - http Server
    • i2c - I2C Operation
    • i2s - Digital Audio
    • iconv - iconv Operation
    • io - io action (extended)
    • ioqueue - io Sequence operation
    • iotauth - IoT Authentication library, used to generate parameters for various cloud platforms
    • ir - infrared remote control
    • json - json Generating and parsing libraries
    • keyboard - Keyboard Matrix
    • lcd - lcd Drive module
    • lcdseg - Segment lcd
    • libcoap - coap Data processing
    • libgnss - NMEA Data processing
    • little_flash - LITTLE FLASH Software package
    • log - Logstore
    • lora - lora Drive module
    • lora2 - lora2 Driver module (supports multi-hanging)
    • lvgl - LVGL Image Library
    • max30102 - Heart Rate Module(MAX30102)
    • mcu - encapsulation mcu some special operations
    • miniz - Easy zlib compression
    • mlx90640 - infrared temperature measurement(MLX90640)
    • mobile - Cellular Network
    • mqtt - mqtt Client
    • natp - Network Address Port Translation (under development)
    • nes - nes Simulator
    • nimble - Bluetooth BLE library (nimble version)
    • onewire - single bus protocol driver
    • os - os Operation
    • otp - OTP Operation Library
    • pack - Packing and unpacking format string
    • pin - Pin Naming Map
    • pm - Power Management
    • protobuf - ProtoBuffs Codec
    • pwm - PWM Module
    • repl - “Read-evaluate-output “loop
    • rsa - RSA encryption and decryption
    • rtc - Real Time Clock
    • rtos - RTOS underlying operation library
    • sdio - sdio
    • sensor - Sensor Operation Library
    • sfd - SPI FLASH Operation Library
    • sfud - SPI FLASH sfud Software package
    • sms - SMS
    • socket - Network Interface
    • softkb - Software Keyboard Matrix
    • spi - spi Operation Library
    • spislave - SPI From machine
    • sqlite3 - sqlite3 Database Operations
    • statem - SM State Machine
    • string - String Manipulation Functions
    • sys - sys Library
    • sysplus - sys A strong complement to the library
    • timer - Operating the bottom timer
    • touchkey - Touch keys
    • u8g2 - u8g2 graphics processing library
    • uart - serial port operation library
    • ulwip - lwip integration in user space (under development)
    • usbapp - USB Functional operation
    • w5500 - w5500 Ethernet driver
    • wdt - watchdog Operation Library
    • websocket - websocket Client
    • wlan - wifi Operation
    • wlanraw - WLAN Data RAW Transfer
    • ws2812 - Phantom Lights with RGB Controller (WS2812 Series)
    • xxtea - xxtea encryption and decryption
    • ymodem - ymodem Agreement
    • zbuff - c Memory Data Manipulation Library
    • zlib - zlib Compression/Decompression (Obsolete)
  • 📮 sys System Messages
  • 🌕 Native API Manual
  • 👓 CSDK Development Manual
  • 🥢 Extended Library Interface Documentation
    • ads1115 - ads1115 analog-to-digital converter
    • ads1115plus - ADS1115 Drive
    • adxl34x - adxl34x 3 Axis accelerometer currently supports adxl345 adxl346
    • aht10 - aht10 Temperature and humidity sensor
    • air153C_wtd - Add software watchdog function to prevent crashes
    • airlbs - airlbs Location services (fee-based services, you need to contact the sales application)
    • ak8963 - ak8963 geomagnetic sensor
    • aliyun - AliYun Alibaba Cloud IoT Platform
    • am2320 - am2320 Temperature and humidity sensor
    • ap3216c - ap3216c Light sensor
    • bh1750 - bh1750 Digital light intensity sensor
    • bmx - bmx The air pressure sensor currently supports bmp180 bmp280 bme280 bme680 will automatically judge the device
    • cht8305c - cht8305c Temperature and humidity sensor
    • ds3231 - ds3231 Real Time Clock Sensor
    • ec11 - ec11 Rotary encoder
    • gt911 - gt911 Drive
    • gy53l1 - gy53l1 laser ranging sensor
    • httpdns - Domain name resolution using Http
    • httpplus - http Supplement to the library
    • ina226 - ina226 Drive
    • iotcloud - iotcloud Cloud platform library (supported: tengxun cloud ariyun onenet huawei cloud graffiti cloud baidu cloud tlink cloud others will also support, and the useful issue will accelerate support )
    • l3g4200d - l3g4200d Three-Axis Digital Gyroscope Sensor
    • lbsLoc - lbsLoc Sending Base Station Location Request
    • lbsLoc2 - base station positioning v2
    • libfota - libfota fota Upgrade
    • libfota2 - fota Upgrade v2
    • libnet - libnet synchronous blocking api based on the socket library, the socket library itself is asynchronous non-blocking api
    • lis2dh12 - lis2dh12 Three-axis sensor
    • lm75 - lm75 Temperature Sensor Support lm75a lm75b
    • max31856 - max31856 Thermocouple temperature detection
    • mcp2515 - mcp2515 CAN Protocol Controller Driver
    • mlx90614 - mlx90614 infrared temperature
    • mpu6xxx - mpu6xxx Six-axis/nine-axis sensor support mpu6500,mpu6050,mpu9250,icm2068g,icm20608d
    • necir - necir NEC protocol infrared receiving
    • netLed - netLed Network status indicator
    • pca9685 - pca9685 16 Road PWM drive steering gear
    • pcf8563t - pcf8563t Clock Module
    • pcf8574 - pcf8574 IO Extension
    • qmc5883l - qmc5883l geomagnetic sensor
    • rc522 - rc522 Non-contact read/write card driver
    • rtkv - Remote KV Database
    • sc7a20 - sc7a20
    • shift595 - shift595 74HC595 Chip
    • si24r1 - si24r1 Drive
    • spl06 - spl06_01 Air pressure sensor
    • tcs3472 - tcs3472 Color Sensor
    • tm1637 - tm1637 Digital tube
    • tm1640 - tm1640 Digital tube and LED driver chip
    • tm1650 - tm1650 Digital tube and key scanning chip
    • tsl2561 - tsl2561 light intensity sensor
    • udpsrv - UDP Server
    • vl6180 - VL6180 laser ranging sensor
    • xmodem - xmodem Drive
    • ze08g_ch2o - ZE08G-CH2O electrochemical formaldehyde module
    • zh07 - ZH07 Laser Dust Sensor
  • Community Extension Library

🖥️ Kernel Development

  • 👨‍💻 Compile source code
    • ☁️ Cloud Compilation
    • 📶 Air780E Compilation Guide
    • 📶 Air780EP Compilation Guide
    • 🚗 Air101 / Air103
    • 🚗 Air105
    • 📡 ESP32 Series Compilation Document
    • 🖥️ Win32
    • 🖥️ Linux
    • 📡 Air640w
    • 📶 Air302
  • 📁 Development documentation
    • Development practice
      • Add Custom Functions (Rapid Edition)
      • Add custom libraries and functions (full version)
      • Lua Library File Writing Guide (Pure Lua Writing)
      • C Interface implements Task waiting function
      • Command Line Brush Guide
    • Development Information
      • LuatOS-SoC The file system
      • Explain lua’s string and hex data (hexadecimal)
      • LuaDB File Format
      • LuatOS-SoC Common Firmware Format soc
  • ❤️ Contribution Code
    • Coding Specification
    • Add New Library
    • Design Document
      • Core Layer
        • Luat Core
        • Luat Debugger
        • File System
        • Memory Pool
        • Message Bus
        • Luat Platform layer
        • Power and Low Power Management
        • Luat Timer
        • C style buffer
        • C Interface implements Task waiting function
        • C The Structure of Style
      • Peripherals API
        • GPIO
        • IR
        • SPI
        • UART
        • WLAN

💼 actual combat reference

  • ⌨️ Application Development
    • Peripherals
      • LuatOS-Soc Driver WS2812 Tutorial
    • lvgl
      • LVGL for LuatOS Manual
      • Introduction
      • LVGL Foundation
      • LVGL Components
      • LVGL Advanced
      • Precautions
    • Video playback
      • Air105 Video playback

🗄️ Other information

  • ⏳ IoT Power Power consumption test artifact
    • 🔋 IoT Power - V1
    • ⚡ IoT Power - CC
      • Technical indicators
      • Connection and assembly
      • Operating Instructions
      • FAQ
    • 🔍 Version Comparison
    • 🖥 PC Client
  • 🗃️ Data Archiving
    • Luat Framework
    • Luat framework (advanced-underlying mechanism)
    • Lua 5.3 Reference Manual
Back to top

iotcloud - iotcloud Cloud platform library (supported: tengxun cloud ariyun onenet huawei cloud graffiti cloud baidu cloud tlink cloud others will also support, and the useful issue will accelerate support )#

Adaptation status unknown

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

--Note: due to the use of sys.wait() all apis need to be used in the coroutine

    -- Tencent Cloud 
    -- dynamic registration
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx" ,product_secret = "xxx"})
    -- Key verification
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx",device_name = "123456789",device_secret = "xxx=="})
    -- Certificate verification
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx",device_name = "123456789"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

    -- Alibaba Cloud  
    -- One type, one secret (no pre-registration-only supported by enterprise version)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",product_secret = "xxx"}) -- Enterprise Edition Public Instance
    -- One type, one secret (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{produt_id = "xxx",device_name = "xxx",product_secret = "xxx"})                     -- Legacy Public Instance
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",device_name = "xxx",product_secret = "xxx"}) -- New Public Instance
    -- One machine, one secret (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})                    -- Legacy Public Instance
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})-- New Public Instance


    -- ONENET Cloud
    -- dynamic registration
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",userid = "xxx",userkey = "xxx"})
    -- One type, one density
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",product_secret = "xxx"})
    -- One machine, one secret
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- HUAWEI CLOUD
    -- Dynamic registration (no pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{produt_id = "xxx",project_id = "xxx",endpoint = "xxx",
    --                         iam_username="xxx",iam_password="xxx",iam_domain="xxx"})
    -- Manual registration (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{produt_id = "xxx",endpoint = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- graffiti cloud 
    -- iotcloudc = iotcloud.new(iotcloud.TUYA,{device_name = "xxx",device_secret = "xxx"})

    -- Baiduyun 
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{produt_id = "afadjlw",device_name = "test",device_secret = "BBDVsSRGefaknffT"})
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{produt_id = "xxx",device_name = "xxx"},{tls={server_cert=io.readFile("/luadb/GlobalSign.cer"),client_cert=io.readFile("/luadb/client_cert"),client_key=io.readFile("/luadb/client_private_key")}})

    -- Tlink Cloud  
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{produt_id = "xxx",product_secret = "xxx",device_name = "xxx"})
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{produt_id = "xxx",product_secret = "xxx",device_name = "xxx"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

Constant#

constant

type

explanation

iotcloud.TENCENT

string

Tencent Cloud

iotcloud.ALIYUN

string

Alibaba Cloud

iotcloud.ONENET

string

ONENET Cloud

iotcloud.HUAWEI

string

HUAWEI CLOUD

iotcloud.TUYA

string

graffiti cloud

iotcloud.BAIDU

string

Baiduyun

iotcloud.TLINK

string

Tlink Cloud

iotcloud.CONNECT

string

Connect to the server

iotcloud.SEND

string

Send Message

iotcloud.RECEIVE

string

Message received

iotcloud.DISCONNECT

string

Server Disconnected

iotcloud.OTA

string

ota Message

iotcloud.new(cloud,iot_config,connect_config)#

Create a cloud platform object

Parameters

Incoming Value Type

Explanation

string

Cloud platform iotcloud.TENCENT: Tencent cloud iotcloud.ALIYUN: Alibaba cloud iotcloud.ONENET: China mobile cloud iotcloud.HUAWEI: Huawei cloud iotcloud.TUYA: graffiti cloud iotcloud.BAIDU: Baidu cloud iotcloud.TLINK: Tlink cloud

table

iot Cloud platform configuration, device_name: optional, default is imei, otherwise it is unique_id iot_config.product_id: product id (alibaba cloud is product key) iot_config.product_secret: product key, if there is this item, it is dynamically registered iot_config.device_secret: device secret key, if there is this item, it is secret key connection instance_id: public instance id, new version alibaba public user id userkey private registration dynamic user id: onuser id enuserid:

table

mqtt Configuration, host: optional, default is platform default host ip: optional, default is platform default ip tls: encryption, if there is this item is generally product certification keepalive: heartbeat time, unit s optional, default 240 autoreconn: automatic reconnection, number: reconnection time, unit ms /bool reconnection, default 3000ms optional, default not automatic reconnection

Return Value

return value type

explanation

table

Cloud Platform Objects

Examples

    -- Tencent Cloud 
    -- dynamic registration
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx" ,product_secret = "xxx"})
    -- Key verification
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx",device_name = "123456789",device_secret = "xxx=="})
    -- Certificate verification
    -- iotcloudc = iotcloud.new(iotcloud.TENCENT,{produt_id = "xxx",device_name = "123456789"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

    -- Alibaba Cloud  
    -- One type, one secret (no pre-registration-only supported by enterprise version)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",product_secret = "xxx"}) -- Enterprise Edition Public Instance
    -- One type, one secret (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{produt_id = "xxx",device_name = "xxx",product_secret = "xxx"})                     -- Legacy Public Instance
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",device_name = "xxx",product_secret = "xxx"}) -- New Public Instance
    -- One machine, one secret (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})                    -- Legacy Public Instance
    -- iotcloudc = iotcloud.new(iotcloud.ALIYUN,{instance_id = "xxx",produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})-- New Public Instance

    -- ONENET Cloud
    -- dynamic registration
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",userid = "xxx",userkey = "xxx"})
    -- One type, one density
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",product_secret = "xxx"})
    -- One machine, one secret
    -- iotcloudc = iotcloud.new(iotcloud.ONENET,{produt_id = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- HUAWEI CLOUD
    -- Dynamic registration (no pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{produt_id = "xxx",project_id = "xxx",endpoint = "xxx",
    --                         iam_username="xxx",iam_password="xxx",iam_domain="xxx"})
    -- Key verification (pre-registration)
    -- iotcloudc = iotcloud.new(iotcloud.HUAWEI,{produt_id = "xxx",endpoint = "xxx",device_name = "xxx",device_secret = "xxx"})

    -- graffiti cloud 
    -- iotcloudc = iotcloud.new(iotcloud.TUYA,{device_name = "xxx",device_secret = "xxx"})

    -- Baiduyun 
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{produt_id = "afadjlw",device_name = "test",device_secret = "BBDVsSRGefaknffT"})
    -- iotcloudc = iotcloud.new(iotcloud.BAIDU,{produt_id = "xxx",device_name = "xxx"},{tls={server_cert=io.readFile("/luadb/GlobalSign.cer"),client_cert=io.readFile("/luadb/client_cert"),client_key=io.readFile("/luadb/client_private_key")}})

    -- Tlink Cloud  
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{produt_id = "xxx",product_secret = "xxx",device_name = "xxx"})
    -- iotcloudc = iotcloud.new(iotcloud.TLINK,{produt_id = "xxx",product_secret = "xxx",device_name = "xxx"},{tls={client_cert=io.readFile("/luadb/client_cert.crt")}})

cloudc:connect()#

Cloud Platform Connectivity

Parameters

None

Return Value

None

Examples

iotcloudc:connect()

cloudc:disconnect()#

Cloud platform disconnected

Parameters

None

Return Value

None

Examples

iotcloudc:disconnect()

cloudc:subscribe(topic, qos)#

Cloud Platform Subscription

Parameters

Incoming Value Type

Explanation

string/table

Theme

number

topic 0/1/2 Default 0

Return Value

None

Examples

None


cloudc:unsubscribe(topic)#

Cloud platform unsubscribe

Parameters

Incoming Value Type

Explanation

string/table

Theme

Return Value

None

Examples

None


cloudc:publish(topic,data,qos,retain)#

Cloud platform release

Parameters

Incoming Value Type

Explanation

string/table

Theme

string

Message, required, but length can be 0

number

Message Level 0/1 Default 0

number

Archive, 0/1, default 0

Return Value

None

Examples

None


cloudc:close()#

Cloud platform shutdown

Parameters

None

Return Value

None

Examples

iotcloudc:close()

Next
l3g4200d - l3g4200d Three-Axis Digital Gyroscope Sensor
Previous
ina226 - ina226 Drive

Copyright © LuatOS team | 下载离线版文档
Contents
  • iotcloud - iotcloud Cloud platform library (supported: tengxun cloud ariyun onenet huawei cloud graffiti cloud baidu cloud tlink cloud others will also support, and the useful issue will accelerate support )
    • Constant
    • iotcloud.new(cloud,iot_config,connect_config)
    • cloudc:connect()
    • cloudc:disconnect()
    • cloudc:subscribe(topic, qos)
    • cloudc:unsubscribe(topic)
    • cloudc:publish(topic,data,qos,retain)
    • cloudc:close()