C# 对接阿里云 IOT 平台 | 演示

内容纲要

 

 

一,开题

《C# 对接阿里云 IOT 平台 | 演示》

(Copy 张队的七龙珠)

5G时代已经快来临, IOT 的发展会如虎添翼~ .NET Core 跨平台在各方面开发出现越来越多的实现例子,笔者的这个示例是在树莓派Linux 上实现直连对接阿里云IOT平台。

背景信息:

《C# 对接阿里云 IOT 平台 | 演示》

《C# 对接阿里云 IOT 平台 | 演示》

 

 使用 阿里云的 原因:

【阿里云】物联网平台邀您免费试用,现在开通每月赠送100万条流量:http://tb.cn/NzsIUHw
【便捷】支持开源MQTT、阿里云官方SDK、AliOS Things等多种方式接入,最快10分钟可完成设备上云开发
【强大】具有亿级设备长连接能力,百万级并发能力,服务可用性99.9%,单点故障自动迁移
【开放】数据流转自主可控,可与丰富的云产品无缝衔接,快速构建物联网应用
【安全】领先的安全能力覆盖云边端各环节

 

二,C 语言写好设备的动态链接库

C# 不能直接操控传感器,就好像没人使用 SQL 开发安卓 APP,只有使用C语言才能直接操作、接收、发送数据给传感器。如果 C# 能够直接在嵌入式 Linux 中,跟那些微型电子设备通讯,那就上天了…

我这里使用 C语言 开发在 Linux 下使用的动态链接库 .so,然后 C# 调用链接库,实现设备-IOT平台的对接。

C语言 ,模拟一个温度传感器,有打开、关闭功能,能够传送温度数据(非真实传感器)

《C# 对接阿里云 IOT 平台 | 演示》

 

然后生成动态链接库,放到 .NET Core 项目中,设置一个类对接

《C# 对接阿里云 IOT 平台 | 演示》

这里使用模拟传感器,待笔者发工资后,买一套上手干。

三,阿里云创建物联网产品、设备

去阿里云IOT控制台创建相应的产品、添加设备,并且添加自定义 Topic。

《C# 对接阿里云 IOT 平台 | 演示》

四,开发控制台对接、传输数据

分为三部分

对接设备

对接阿里云IOT

收发订阅、回调

项目大体代码、结构如下:

《C# 对接阿里云 IOT 平台 | 演示》

 

点赞
  1. purchase ABILIFY说道:

    I am commenting to let you know of the fine encounter my cousin's daughter experienced reading your site. She even learned many issues, not to mention what it's like to have a wonderful giving mindset to have many people quite simply grasp chosen hard to do subject areas. You really exceeded our expectations. Many thanks for giving the insightful, healthy, educational and as well as easy thoughts on the topic to Jane.

  2. bupron prices说道:

    A lot of thanks for each of your hard work on this web page. Kim really likes getting into investigation and it's really easy to understand why. Many of us know all of the dynamic method you make invaluable steps on this web blog and as well as improve participation from people on that idea so our girl is certainly learning a lot of things. Have fun with the remaining portion of the new year. You are conducting a pretty cool job.

  3. I intended to compose you a bit of note in order to give many thanks again about the awesome basics you've contributed above. It's generous of people like you giving easily all a few individuals could have advertised as an e-book in making some bucks for their own end, and in particular considering that you could have done it if you considered necessary. The basics additionally acted as a easy way to be aware that many people have a similar desire just as mine to figure out a good deal more around this condition. Certainly there are a lot more enjoyable instances ahead for folks who check out your blog.

发表评论

邮箱地址不会被公开。 必填项已用*标注

You must enable javascript to see captcha here!