我是靠谱客的博主 不安月饼,这篇文章主要介绍stm32+mc20上传gps信息至onenet 可路径显示,现在分享给大家,希望可以做个参考。

开发环境:

芯片: STM32F103C8T6

GSM模块: 移远MC20

开发软件: Keil5

协议 :多协议接入——TCP透传

手机端显示图像

使用STM32F103C8T6 通过串口+AT指令控制MC20模块+TCP协议,登录OneNet服务器上传GPS数据 。

核心:

串口解析GPS数据

TCP透传协议,上传Json数据串。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sprintf(text, "{"datastreams":[{"id":"%s","datapoints":[{"value":{"lon":%s,"lat":%s}}]}]}", sensor_id_temp, lon_str_end, lat_str_end); sprintf(text,"vol,%.2f;", vol); send_buf[0] = 0; strcat(send_buf, "POST /devices/"); strcat(send_buf, device_id_temp); strcat(send_buf, "/datapoints HTTP/1.1rn"); strcat(send_buf, "api-key:"); strcat(send_buf, API_VALUE_temp); strcat(send_buf, "rn"); strcat(send_buf, "Host:"); strcat(send_buf, OneNetServer); strcat(send_buf, "rn"); sprintf(tmp, "Content-Length:%drnrn", strlen(text)); strcat(send_buf, tmp); strcat(send_buf, text);

如有需要请联系:sxq2576484664

最后

以上就是不安月饼最近收集整理的关于stm32+mc20上传gps信息至onenet 可路径显示的全部内容,更多相关stm32+mc20上传gps信息至onenet内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(70)

评论列表共有 0 条评论

立即
投稿
返回
顶部