SIM800L本身是不支持MQTT的,但是模块本身很小巧很便宜,也很稳定。我就不喜欢什么功能都封装成AT指令,明明这些可以自己用软件来实现的,平白无故还增加了成本。说说具体做法,其实在ESP32上已经很容易做到了,IDF本身有MQTT协议栈(基于lwip写的),并且lwip又支持PPP接口,所以我们只要让Modem正确进入PPP模式,然后调用mqtt...
思路同上一篇:本例程实现了以下功能:通过SIM800L连接网络连接OneNet平台(通过新版MQTTs协议)调用SHT20的库采集温湿度将温湿度信息上传至OneNet每5分钟采集一次, 采集完成就休眠#include <Arduino.h>#include "PubSubClient.h"#include "Ticker.h"#include "uFire_SH..
constchar*mqtt_server="183.230.40.96";//onenet 的 IP地址constintport=1883;//端口号#definemqtt_devid "esp_device001"//设备ID#definemqtt_pubid "370098"//产品ID//鉴权信息#definemqtt_password "version=2018-10-31&res=products%2F370098%2Fdevices%2Fesp_device001&et=4092512761&method=md5&sign=...
This guide shows how to connect the TTGO T-Call ESP32 SIM800L board to the Internet using a SIM card data plan and publish/subscribe to a cloud MQTT broker without using Wi-Fi. The cloud MQTT Mosquitto broker will be installed on a Digital Ocean server. We’ll also use Node-RED to ...