×

创建一个带有按钮的简单项目

消耗积分:0 | 格式:zip | 大小:0.00 MB | 2023-06-30

385288

分享资料个

描述

在本教程中,您将创建一个带有按钮的简单项目,每次按下它都会向您的手机发送推送通知。

 

请注意如何将电池模块放在底部。它是唯一可以以错误方式插入的模块。

poYBAGOX-QyAeLyJAAED5zhZfog527.png
 

2.刷机固件

pYYBAGOX-ROAS7GUAADathZJsn4031.png
 

3. 配对核心模块

您需要将 Core 模块与您正在使用的 Radio dongle 配对,按照下面的说明查看它是如何完成的。

pYYBAGOX-RaAK2XBAAB8xQxrmUo127.png
 
  • 单击开始配对加密狗上的 LED 应开始闪烁
  • 将要配对的设备连接到计算机或插入电池。
  • 等待设备出现在表格中
  • 它应该使用别名添加设备:push-button:0
poYBAGOX-RuAWdr1AACCwfEsnas604.png
 

4. 进口流程

  • 切换到功能选项卡
pYYBAGOX-R6AASmGAABMmNXBmg4832.png
 

如果您没有看到流程,您可以复制下面的文本并将其粘贴到 Node-RED 的菜单 > 导入 > 剪贴板

[{"id":"103c675c.c81139","type":"mqtt in","z":"2c41a2bd.aa36ae","name":"","topic":"node/push-button:0/push-button/-/event-count","qos":"2","broker":"29fba84a.b2af58","x":270,"y":360,"wires":[["ff41c7e0.06eba8"]]},{"id":"f507ecc3.8f82b","type":"blynk-ws-out-notify","z":"2c41a2bd.aa36ae","name":"Blynk notification","client":"fc4bbabb.9bb1b8","queue":false,"rate":5,"x":790,"y":360,"wires":[]},{"id":"ff41c7e0.06eba8","type":"change","z":"2c41a2bd.aa36ae","name":"Set message","rules":[{"t":"set","p":"payload","pt":"msg","to":"Button pressed, you're the best!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":360,"wires":[["f507ecc3.8f82b"]]},{"id":"c131dd35.bb855","type":"comment","z":"2c41a2bd.aa36ae","name":"Push Button Kit flow","info":"","x":190,"y":300,"wires":[]},{"id":"29fba84a.b2af58","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"fc4bbabb.9bb1b8","type":"blynk-ws-client","z":"","name":"","path":"ws://blynk-cloud.com/websockets","key":"5cf554e34caf4d49a1b24cd07c5e2c13","dbg_all":false,"dbg_read":false,"dbg_write":false,"dbg_notify":false,"dbg_mail":false,"dbg_prop":false,"dbg_sync":false,"dbg_bridge":false,"dbg_low":false,"dbg_pins":"","multi_cmd":false,"proxy_type":"no","proxy_url":""}]
[{"id":"103c675c.c81139","type":"mqtt in","z":"2c41a2bd.aa36ae","name":"","topic":"node/push-button:0/push-button/-/event-count","qos":"2","broker":"29fba84a.b2af58","x":270,"y":360,"wires":[["ff41c7e0.06eba8"]]},{"id":"f507ecc3.8f82b","type":"blynk-ws-out-notify","z":"2c41a2bd.aa36ae","name":"Blynk notification","client":"fc4bbabb.9bb1b8","queue":false,"rate":5,"x":790,"y":360,"wires":[]},{"id":"ff41c7e0.06eba8","type":"change","z":"2c41a2bd.aa36ae","name":"Set message","rules":[{"t":"set","p":"payload","pt":"msg","to":"Button pressed, you're the best!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":360,"wires":[["f507ecc3.8f82b"]]},{"id":"c131dd35.bb855","type":"comment","z":"2c41a2bd.aa36ae","name":"Push Button Kit flow","info":"","x":190,"y":300,"wires":[]},{"id":"29fba84a.b2af58","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"fc4bbabb.9bb1b8","type":"blynk-ws-client","z":"","name":"","path":"ws://blynk-cloud.com/websockets","key":"5cf554e34caf4d49a1b24cd07c5e2c13","dbg_all":false,"dbg_read":false,"dbg_write":false,"dbg_notify":false,"dbg_mail":false,"dbg_prop":false,"dbg_sync":false,"dbg_bridge":false,"dbg_low":false,"dbg_pins":"","multi_cmd":false,"proxy_type":"no","proxy_url":""}]

5. Blynk 集成

该项目应该与 Blynk 一起使用。HARDWARIO 教程中解释了如何设置blynk

如果您完成了整个教程,您的手机中应该有一个下载的 Blynk 应用程序。

点击右上角的二维码图标,扫描以下二维码。

poYBAGOX-SCAA1_cAAAZbwavlPs385.png
 

您将需要一个 Auth Token 来设置 Blynk 和 Node-RED 连接,您可以通过应用程序将其通过电子邮件发送给您。

  • 单击刚刚导入的项目中的设置
pYYBAGOX-SaAJzSZAAB9WklKeno096.png
 
  • 点击电子邮件全部
poYBAGOX-SqABXq3AACZENpYcSE978.png
 
  • 现在点击项目中的 Play 启动它
pYYBAGOX-S2AMTAvAABlymWKx08513.png
 
  • 您需要将电子邮件中的 Auth Token 放入您在上面教程中所做的 Blynk 服务器设置中。

6. 测试你的设备

现在您只需按下按钮

推送后,您应该会在手机上收到通知

pYYBAGOX-TWAXY4BAACV2W-ovVw589.png
 

概括

这只是您可以使用 HARDWARIO IoT Kit 完成的一个基本项目。当然,您可以将其扩展得更多,只需按下按钮即可制作出很棒的东西。

如果您想查看更多这样的入门项目,您可以访问此类别中的项目。

随时问,我会尽力回答任何问题。

  • 访问hackster.io 上的 HARDWARIO 页面了解更多有趣的项目或直接访问他们的网站
  • 转到HARDWARIO 文档以了解有关其模块和平台其他可能性的更多信息。
  • 从 HARDWARIO Playground 尝试更多固件或编写自己的固件,很容易上手。
  • 因为一切都是开源的,你可以在GitHub 上获取所有固件,获得一些灵感并尝试制作自己的应用程序。
  • 获取您自己的HARDWARIO Hub来替换您在此项目中的计算机,以便您始终可以访问您的应用程序。
  • 在集成部分查看更多可与 HARDWARIO IoT Kit 一起使用的应用程序。

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !