资源简介
F103C8T6+SIM800C 模组连接阿里云物联网平台套件,实现的功能:1、STM32上PC13控制LED翻转作为运行指示灯2、串口2(PA2)用来打印运行数据(包括MQTT连接网发布消息订阅主题)3、阿里物联网平台在线调试下发一个led开关命令通过串口2打印信息验证4、平台能收到温度值并显示(仅32上电的时候publish温度值,官网是2S发布一次)5、也可以用AIR208S模组全指令共用都是sim800的AT指令6、调试助手:PC端可以用mqtt.fx模拟设备,手机端可以用微信搜索小程序“MQTT模拟器”进行模拟测试
代码片段和文件信息
/**
* NOTE:
*
* HAL_TCP_xxx API reference implementation: wrappers/os/ubuntu/HAL_TCP_linux.c
*
*/
#include
#include
#include
#include “stm32f1xx_hal.h“
#include “infra_types.h“
#include “infra_defs.h“
#include “wrappers_defs.h“
#include “at_wrapper.h“
#define EXAMPLE_PRODUCT_KEY “a1OX6aa5gk8“
#define EXAMPLE_PRODUCT_SECRET “4R9HZPK22uyWog2E“
#define EXAMPLE_DEVICE_NAME “example“
#define EXAMPLE_DEVICE_SECRET “NROjb5mS14K36DJsYU1mlqcijoOXs2Rj“
#define EXAMPLE_FIRMWARE_VERSION “app-1.0.0-20190118.1000“
#define RING_BUFFER_SIZE (128)
typedef struct
{
uint8_t data[RING_BUFFER_SIZE];
uint16_t tail;
uint16_t head;
}uart_ring_buffer_t;
extern UART_HandleTypeDef huart1;
static uint8_t g_uart_tx_flag;
static uart_ring_buffer_t g_uart_rx_buf;
static UART_HandleTypeDef* p_at_uart = &huart1;
#ifdef STM32_MEM_DEBUG
#define MEM_DEBUG_INFO_NUM (40)
typedef struct {
void* addr;
uint32_t len;
}mem_debug_info_t;
volatile uint32_t g_mem_alloc_num = 0;
volatile uint32_t g_mem_alloc_maxnum = 0;
volatile uint32_t g_mem_alloc_len = 0;
volatile uint32_t g_mem_alloc_maxlen = 0;
mem_debug_info_t g_mem_debug_info[MEM_DEBUG_INFO_NUM] = {0};
void mem_alloc_debug(void* addr uint32_t len)
{
int i;
if(NULL == addr){
return;
}
if(0 == len){
return;
}
for(i = 0; i < MEM_DEBUG_INFO_NUM; i++){
if(g_mem_debug_info[i].addr == addr){
printf(“error >> %d addr alloc error 0x%08x\n“iaddr);
return;
}
}
for(i = 0; i < MEM_DEBUG_INFO_NUM; i++){
if(g_mem_debug_info[i].addr == NULL){
g_mem_debug_info[i].addr = addr;
g_mem_debug_info[i].len = len;
g_mem_alloc_len += len;
g_mem_alloc_maxlen = g_mem_alloc_len > g_mem_alloc_maxlen ? g_mem_alloc_len : g_mem_alloc_maxlen;
g_mem_alloc_num++;
g_mem_alloc_maxnum = g_mem_alloc_num > g_mem_alloc_maxnum ? g_mem_alloc_num : g_mem_alloc_maxnum;
return;
}
}
printf(“error >> g_mem_debug_info id empty\n“);
}
void mem_free_debug(void* addr)
{
int i;
if(NULL == addr){
return;
}
for(i = 0; i < MEM_DEBUG_INFO_NUM; i++){
if(g_mem_debug_info[i].addr == addr){
if(g_mem_alloc_len >= g_mem_debug_info[i].len){
g_mem_alloc_len -= g_mem_debug_info[i].len;
}
else{
printf(“error >> g_mem_alloc_len calc error 0x%08x 0x%08x\n“g_mem_alloc_leng_mem_debug_info[i].len);
return;
}
g_mem_debug_info[i].addr = NULL;
g_mem_debug_info[i].len = 0;
g_mem_alloc_num--;
return;
}
}
printf(“error >> mem_free_debug not find 0x%08x\n“addr);
}
void mem_debug_show(void){
printf(“\n
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5797 2019-06-20 16:29 SIM800C_TCP_Basic\.mxproject
文件 499462 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f100xb.h
文件 544671 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f100xe.h
文件 450133 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f101x6.h
文件 460506 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f101xb.h
文件 538320 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f101xe.h
文件 553362 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f101xg.h
文件 542861 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f102x6.h
文件 552467 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f102xb.h
文件 874522 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103x6.h
文件 884899 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h
文件 971936 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xe.h
文件 986030 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xg.h
文件 1261567 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f105xc.h
文件 1342402 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f107xc.h
文件 8788 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h
文件 3337 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h
文件 15127 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f100xb.s
文件 16715 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f100xe.s
文件 12564 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f101x6.s
文件 12937 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f101xb.s
文件 15049 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f101xe.s
文件 15808 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f101xg.s
文件 12886 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f102x6.s
文件 13271 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f102xb.s
文件 13449 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f103x6.s
文件 13834 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f103xb.s
文件 16391 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f103xe.s
文件 16845 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f103xg.s
文件 16653 2019-06-18 09:25 SIM800C_TCP_Basic\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f105xc.s
............此处省略608个文件信息
- 上一篇:小程序开发指南-完整版-20180320
- 下一篇:松下A4伺服设置软件
相关资源
- stm32 + w5500 + MQTT
- MQTT-client for D7
- utdMQTT-client for D7
- SIM800L_硬件设计手册_V1.1.pdf
- SIM800_datasheet.pdf
- STM32+ESP8266+MQTT接入OneNet 通过手机APP控
- paho.mqtt.c 树莓派交叉编译版本SDK
- STM32+MQTT协议功能实现
- MQTT-ESP8266.rar
- sim800上传温湿度到onenet
- 基于STM32F1和ESP8266的MQTT数据传输
- 通讯猫-mqtt测试软件
- MQTT协议完整中文版版.pdf
- Azure微软云MQTT连接
- STM32+MQTT协议功能实现测试demo
- 重新上传esp8266创建mqtt任务,连接mq
- 玩转STM32F103+W5500 MQTT
- mqtt发包工具-压力测试工具
- 使用QT官方库的mqtt客户端
- Mqtt for Unity 完整工程包
- ESP8266开发固件MQTT服务器
- andriod-MQTT客户端
- STM32F4x7+freertos+lwip+ssl+MQTT完整代码
- ESP8266开发,实现MQTT客户端,与MQTT服
- SIM800900用GPS定位,无操作系统
- 技小新-MQTT单片机编程小工具.zip
- SIM900A模块原理图、例程源码、软件、
- SIM800C_EAT包+编译工具+工具
- STM32F4x7+freertos+lwip+ssl+MQTT-(MDK5)稳定
- MQTT Essentials – A Lightweight IoT Protocol
评论
共有 条评论