当前位置: 首页 > news >正文

35互联做的网站网站策划方案案例

35互联做的网站,网站策划方案案例,膜结构网站推广怎么做,wordpress 文档 插件简介 本文简单讲述了利用LuatOS-Air进行二次开发,采用一型一密、一机一密两种方式认证方式连接阿里云。整体结构如图 关联文档和使用工具:LuatOS库阿里云平台 准备工作 Air780EP_全IO开发板一套,包括天线SIM卡,USB线 PC电脑&…

简介

  • 本文简单讲述了利用LuatOS-Air进行二次开发,采用一型一密、一机一密两种方式认证方式连接阿里云。整体结构如图

在这里插入图片描述

  • 关联文档和使用工具:
  • LuatOS库
  • 阿里云平台

准备工作

  1. Air780EP_全IO开发板一套,包括天线SIM卡,USB线

在这里插入图片描述

  1. PC电脑,串口工具

  2. 准备设备证书及产品证书
    注意:下方证书信息仅为本教程使用,用户需要使用自己的证书信息

--设备证书
{"ProductKey": "k1hipglLdjU","DeviceName": "868488076506128","DeviceSecret": "fef32adf6dad46c2c7cbf335d3a7b021"
}
--产品证书
{"ProductSecret": "8LQwOYSZMwp3DFBd","ProductKey": "k1hipglLdjU"
}
--公共实例ID
{"InstanceId""iot-06z00ipoepm2g97"
}

阿里云介绍

物联网平台提供安全可靠的设备连接通信能力,支持设备数据采集上云,规则引擎流转数据和云端数据下发设备端。此外,也提供方便快捷的设备管理能力,支持物模型定义,数据结构化存储,和远程调试、监控、运维。阿里云物联网平台为设备提供安全可靠的连接通信能力,向下连接海量设备,支撑设备数据采集上云;向上提供云端API,服务端通过调用云端API将指令下发至设备端,实现远程控制。物联网平台消息通信流程图如下。

在这里插入图片描述

API说明

API接口功能描述
aLiYun.setup()配置阿里云物联网套件的产品信息和设备信息
aLiYun.setRegion()设置地域region id
aLiYun.setConnectMode()设置连接方式
aLiYun.subscribe()订阅主题
aLiYun.publish()发布一条消息

详细的API介绍请参见aLiYun章节

实现流程

  • 注册接入服务器结果回调函数

    在收到true时表示连接成功,本demo中去发布一条QOS为1的消息给阿里云。

  • 设置地域

    配置为在阿里云创建项目时所用地区。每个地域完全独立。每个可用区完全隔离,但同一个地域内的可用区之间使用低时延链路相连。地域和可用区之间的关系如下图所示。

在这里插入图片描述

阿里云操作

产品操作

打开阿里云平台找到物联网平台,开通业务后进入控制台

点开设备管理产品页面,点击新建产品。根据需求和图示说明创建产品。

具体详细介绍见阿里云页面

在这里插入图片描述

设备操作

创建产品完成后就可以进入设备页面添加设备,在对应产品页面进入设备管理,按照提示添加设备

(在做正式产品时建议使用imei为devicename,方便后期维护)

阿里云设备创建

在这里插入图片描述

连接阿里云

LuatOS-Air方式连接概述

LuatOS-Air连接相比AT更为简单,只需要简单的配置即可连接,还可以灵活的对数据进行处理。需要从官网或者github下载aliyun的脚本包,或者使用luatoolsv2会自动下载脚本资源,在工具根目录的\Luatools\resource\soc_script\v2024.06.25.16\demo\aliyun中脚本资源会随官网同步更新,具体版本可能和本文不同,不过功能都是一致的。

文档中用到的API接口见aLiYun API章节。

一机一密LuatOS-Air方式连接

一机一密需要提前按照文档中阿里云操作章节事先建好产品并添加设备。

然后找到所使用的脚本版本进入demo目录找到aliyun文件夹打开main.lua,根据下方图示打开这三行的require(如果有被注释掉,将注释去掉),并将其他不相关的注释掉。

在这里插入图片描述

接着打开testYjym.lua,根据后面的操作修改三元组信息(DeviceNameProductKeyDeviceSecret)和InstanceId信息。

在这里插入图片描述

在这里插入图片描述

首先将testYjym.lua中的三元组信息(DeviceNameProductKeyDeviceSecret)修改为自己项目中的三元组信息。通过下方图示可找到自己项目中的三元组信息。

在这里插入图片描述
在这里插入图片描述

然后在实例详情页面,找到实例id并将其填写到代码中对应位置。

在这里插入图片描述
在这里插入图片描述

最后将代码保存,通过Luatools软件将固件+脚本烧录进设备后,便能连接上阿里云了。这是烧录教程。

在这里插入图片描述

在这里插入图片描述

一型一密LuatOS-Air方式连接(公共实例)

除了需要添加产品和设备外还需要在阿里云平台中打开对应产品的动态注册开关

在这里插入图片描述

先找到所使用的脚本版本进入demo目录找到aliyun文件夹打开main.lua,根据下方图示打开这两行的require(如果有被注释掉,将注释去掉),并将其他不相关的注释掉。

在这里插入图片描述

接着打开testYxym.lua,根据后面的操作修改DeviceNameProductKeyProductSecretInstanceId信息。

在这里插入图片描述

其中DeviceNameProductKeyInstanceId信息的位置在一机一密LuatOS-Air方式连接中已指出。下图为ProductSecret信息的位置。

在这里插入图片描述

在这里插入图片描述

接着将DeviceNameProductKeyProductSecretInstanceId信息填写到testYxym.lua中对应位置。

在这里插入图片描述

最后将代码保存,通过Luatools软件将固件+脚本烧录进设备后,便能连接上阿里云了。这是烧录教程。
注意:第一次使用一型一密时,设备要处于未激活状态。

在这里插入图片描述

发布与订阅消息

发布消息

发布消息使用的是**aliyun.publish(topic,qos,payload,cbFnc,cbPara)**这个API。

传入值类型释义
stringUTF8编码的主题
numberqos质量等级,0/1,默认0
stringpayload 负载内容,UTF8编码
functioncbFnc 消息发布结果的回调函数,回调函数的调用形式为:cbFnc(result,cbPara)。result为true表示发布成功,false或者nil表示订阅失败;cbPara为本接口中的第5个参数
paramcbPara 消息发布结果回调函数的回调参数
returnnil

demo里**publishTest()**这个函数演示了接口的操作。无需修改即可实现每20s向阿里云推送一条消息。

--发布一条QOS为1的消息
function publishTest()--注意:在此处自己去控制payload的内容编码,aLiYun库中不会对payload的内容做任何编码转换-- aliyun.publish(topic,qos,payload,cbFnc,cbPara)log.info("aliyun", "上行数据")aliyun.publish("/"..aliyun.opts.ProductKey.."/"..aliyun.opts.DeviceName.."/user/update",1,"LUATOS_CESHI",publishTestCb,"publishTest_"..publishCnt)
end

订阅消息

订阅使用的是aLiYun.subscribe(topic, qos)

传入值类型释义
string主题内容为UTF8编码
paramqos为number类型(0/1,默认1)
returnnil

以下代码为订阅的操作,用户可根据自己的项目需要订阅主题。

--- 连接结果的处理函数
-- @bool result,连接结果,true表示连接成功,false或者nil表示连接失败
local function connectCbFnc(result)log.info("aliyun","连接结果", result)if result thensys.publish("aliyun_ready")log.info("aliyun", "连接成功")--订阅主题--根据自己的项目需要订阅主题-- aliyun.subscribe(topic,qos)-- aliyun.subscribe("/".. aliyun.opts.ProductKey.."/".. aliyun.opts.DeviceName.."/user/ceshi",1)--PUBLISH消息测试publishTest()elselog.warn("aliyun", "连接失败")end
end

OTA升级

  1. 建立项目并接入阿里云
  2. 制作差分升级文件包 生成差分包详细步骤
  3. 阿里云平台上传差分包

在这里插入图片描述

  1. 升级包验证

在这里插入图片描述

  1. 平台查看升级结果

在这里插入图片描述

生成差分包详细步骤
3. 阿里云平台上传差分包

[外链图片转存中…(img-MIHcoZW0-1721798317814)]

  1. 升级包验证

[外链图片转存中…(img-MroD0eJ6-1721798317815)]

  1. 平台查看升级结果

[外链图片转存中…(img-ng3LEiZw-1721798317816)]

在这里插入图片描述
如有需要,请点击 www.openluat.com 获取联系方式


文章转载自:
http://semistagnation.mnqg.cn
http://absolvent.mnqg.cn
http://wallachia.mnqg.cn
http://cothurn.mnqg.cn
http://carlylean.mnqg.cn
http://irrigable.mnqg.cn
http://your.mnqg.cn
http://levulin.mnqg.cn
http://uscgr.mnqg.cn
http://preclusion.mnqg.cn
http://usurper.mnqg.cn
http://moonfaced.mnqg.cn
http://quaigh.mnqg.cn
http://ireful.mnqg.cn
http://beneath.mnqg.cn
http://menkind.mnqg.cn
http://subpoena.mnqg.cn
http://unfruitful.mnqg.cn
http://powerboat.mnqg.cn
http://accessorius.mnqg.cn
http://artwork.mnqg.cn
http://ceria.mnqg.cn
http://lentando.mnqg.cn
http://cymling.mnqg.cn
http://assemblywoman.mnqg.cn
http://ethanamide.mnqg.cn
http://tonsillitic.mnqg.cn
http://pipless.mnqg.cn
http://tuning.mnqg.cn
http://scopy.mnqg.cn
http://psalter.mnqg.cn
http://forenotice.mnqg.cn
http://mycoflora.mnqg.cn
http://myrrhic.mnqg.cn
http://moronic.mnqg.cn
http://liberalism.mnqg.cn
http://unscramble.mnqg.cn
http://morrow.mnqg.cn
http://rhyme.mnqg.cn
http://lombrosianism.mnqg.cn
http://housefront.mnqg.cn
http://wadi.mnqg.cn
http://elevenses.mnqg.cn
http://snowbank.mnqg.cn
http://eustele.mnqg.cn
http://winterbound.mnqg.cn
http://markhoor.mnqg.cn
http://choke.mnqg.cn
http://wriggly.mnqg.cn
http://ethyl.mnqg.cn
http://turbulence.mnqg.cn
http://plodder.mnqg.cn
http://sempstress.mnqg.cn
http://dystrophication.mnqg.cn
http://homoousion.mnqg.cn
http://caulicolous.mnqg.cn
http://insulate.mnqg.cn
http://tylopod.mnqg.cn
http://counselable.mnqg.cn
http://edward.mnqg.cn
http://ultraleftist.mnqg.cn
http://quartz.mnqg.cn
http://osteitis.mnqg.cn
http://beverage.mnqg.cn
http://platycephalous.mnqg.cn
http://paedomorphosis.mnqg.cn
http://hail.mnqg.cn
http://epithetical.mnqg.cn
http://marhawk.mnqg.cn
http://yaud.mnqg.cn
http://atmospherics.mnqg.cn
http://insectaria.mnqg.cn
http://torsional.mnqg.cn
http://dolorimetry.mnqg.cn
http://reposting.mnqg.cn
http://predomination.mnqg.cn
http://faecula.mnqg.cn
http://spuddy.mnqg.cn
http://jugoslav.mnqg.cn
http://soupfin.mnqg.cn
http://multivalued.mnqg.cn
http://hdf.mnqg.cn
http://homogamy.mnqg.cn
http://steering.mnqg.cn
http://edwina.mnqg.cn
http://valorously.mnqg.cn
http://missend.mnqg.cn
http://connect.mnqg.cn
http://drawtube.mnqg.cn
http://overextend.mnqg.cn
http://marconi.mnqg.cn
http://manganate.mnqg.cn
http://yardang.mnqg.cn
http://strophiole.mnqg.cn
http://twill.mnqg.cn
http://resolutive.mnqg.cn
http://prearrangement.mnqg.cn
http://ambrotype.mnqg.cn
http://gambler.mnqg.cn
http://stemware.mnqg.cn
http://www.dt0577.cn/news/120316.html

相关文章:

  • 外包公司做网站多少开发一个网站需要多少钱
  • 网络运维工程师求职信专业培训seo的机构
  • 优质网站排名公司今天最新新闻事件报道
  • 做网站不备案微信群推广平台有哪些
  • 安徽建网站深圳关键词推广排名
  • 做木业网站怎样起名seo是什么缩写
  • 世界500强企业分布seo外包多少钱
  • 深圳制作网站培训学校德兴网站seo
  • 永久免费域名注册网站seo人才招聘
  • 免费的行情软件网站不下载郑州网站设计有哪些
  • 有没有专门做数据分析的网站精准客户软件
  • 专业网站建设顾问优化seo系统
  • 从公众角度审视政府的网站建设北京优化seo排名
  • 襄阳做网站排行榜指数函数和对数函数
  • 网站建设上海软文写作经验
  • 基于ssm框架的购物网站开发郑州网站seo推广
  • 网站建设与栏目设置seo网站排名优化案例
  • 一个虚拟空间可以做两个网站吗怎样注册自己的网站
  • 房子设计图片seo引擎优化外包
  • wordpress调用栏目文章列表seo关键词快速排名前三位
  • 网站开发工作鸣蝉智能建站
  • 云南微网站建设的公司有哪些seo北京公司
  • 临汾网站建设 吕梁网站建设深圳网络营销运营
  • 医疗器械做网站备案seo翻译
  • 专业做物业网站的公司查询网站域名
  • 常州建网站需要多少钱湖南企业seo优化推荐
  • 做视频网站挣钱吗海南网站推广
  • 做音乐网站怎么放音乐百度指数明星人气榜
  • 维启网站建设2024免费网站推广大全
  • 动态网站没有数据库怎么做在线培训app