从手机到云端:基于Blinker、Node-RED与ESP32的MQTT全链路数据流转实战

几何非线性-屈曲分析 结构系统的破坏分为两种,一类是因材料软化而引起的强度破坏,另一类是几何软化使得结构的几何形状发生极大变化,从而使结构丧失承载能力。在材料力学中是这样定义压杆失稳的:中心受压直杆(理想模型)在直线状态下平衡,由稳定平衡转化为不稳定平衡时所受的轴向压力的界限值,称为临界压力。中心受压直杆在临界压力的作用下,其直线形态的平衡开始丧失稳定性,简称为失稳。显然,这个定义只使用于理想的压杆模型,那么关于失稳和屈曲是否存在一般性定义呢? 阅读详情

1. 从手机到云端的数据流转全景图

想象一下这样的场景:早上起床,你在手机上轻轻一点,卧室的窗帘自动拉开;出门时用APP查看家里的温湿度;晚上回家前远程打开空调。这套行云流水的操作背后,其实隐藏着一个完整的数据流转链条。今天我们就用Blinker、Node-RED和ESP32这三件套,搭建一个从手机指令到云端响应的完整物联网系统。

整个流程就像一场接力赛:手机APP(Blinker)是第一棒选手,它把我们的操作指令打包成MQTT消息;ESP32开发板是第二棒,负责接收指令并控制硬件;Node-RED是最后一棒,在云端完成数据处理和可视化。而MQTT协议就是它们之间的隐形跑道,确保信息能准确传递。

2. 手机端:Blinker的快速入门

2.1 五分钟搭建控制界面

在应用商店搜索"Blinker"下载安装(最新版v2.6.3),注册账号后点击右上角"+"号添加设备。选择"独立设备"-"网络接入"-"点灯科技服务",这时会生成一串像"d4e5f6a7b8"的密钥,这相当于你设备的身份证号码,务必妥善保存。

建议在设备设置里修改一个易记的名称,比如"客厅主灯"。进入UI编辑器后,拖拽一个按钮控件到画布,设置按钮ID为"btn-light"(这个ID后续会用在代码中)。保存后你会看到一个简约的控制界面,这就是未来控制硬件的手机操作面板。

2.2 密钥背后的安全机制

很多新手会好奇:为什么需要密钥?其实这是点灯科技设计的双重认证机制。当你用这个密钥连接他们的MQTT服务器时,系统会自动分配临时账号密码。我实测发现,这些凭证有效期约24小时,过期后会自动刷新。这意味着即使密钥被泄露,攻击者也无法长期控制你的设备。

3. 设备端:ESP32的智能变身

3.1 开发环境搭建

首先安装Arduino IDE(建议1.8.19版本),在首选项中添加开发板管理网址:

https://dl.espressif.com/dl/package_esp32_in
银河麒麟V10SP1系统盘瘦身指南:如何制作一个只含必需软件的轻量级安装镜像 本文详细介绍了银河麒麟V10SP1系统盘瘦身的完整流程,从依赖分析到最小化镜像构建,帮助用户创建只含必需软件的轻量级安装镜像。通过智能包筛选、KickStart定制和性能优化,显著减少ISO体积和部署时间,适用于服务器批量部署等场景。 阅读详情

相关推荐

蓝牙HCI Dongle实战:从芯片选型到协议栈集成的完整指南

本文详细介绍了蓝牙HCI Dongle的实战应用,从芯片选型到协议栈集成的完整指南。通过对比CSR8510、nRF52840等主流芯片的性能和价格,提供选型建议和避坑技巧。同时,深入解析Zephyr协议栈移植和常见问题排查,帮助开发者高效完成蓝牙项目开发。

weixin_30786657的博客 314

fsQCA实战:从数据校准到结果解读的完整流程(附R代码示例)

本文提供了一份完整的模糊集定性比较分析(fsQCA)实战指南,详细阐述了从数据校准、必要条件分析、真值表构建到布尔最小化与结果解读的全流程。通过R语言代码示例,帮助研究者掌握如何将理论转化为可操作的分析步骤,并产出稳健的中间解,以揭示导致结果的复杂条件组合。

d6e7f8g9h的博客 1144

深入解析Lora模块的工作原理与应用场景

本文深入解析了Lora模块的工作原理与应用场景。Lora模块作为物联网领域的核心无线通信组件,凭借其独特的扩频调制与半双工通信技术,实现了远距离、低功耗的数据传输。文章详细拆解了其技术内核,包括空中唤醒等低功耗奥秘,并提供了地址、信道、空中速率等关键参数的实战配置指南。最后,探讨了Lora模块在智能家居、智慧农业、城市监测等广域物联网场景中的具体应用,为开发者提供了从理论到实践的完整参考。

weixin_29174385的博客 330

C语言实现定时任务

例:设置定时任务,每周周X的X时X分自动重启系统 思路:将设置好的重启时间保存到本地配置文件中,设置定时器定时一分钟,每一分钟信号触发一次事件,事件函数中获取配置文件信息与当前系统时间信息,将两个时间进行时间差计算,符合条件的自动重启系统. //创建定时器函数(通过信号触发事件timer_task函数启动) int create_timer() { struct sigevent evp; int ret = 0; memset(&evp, 0, sizeof(stru

佳佳鸽的博客 5026

部署与可视化系统:零基础到精通:LabVIEW 调用 YOLO 动态链接库(DLL)的保姆级视觉检测系统融合实战

LabVIEW与YOLO26深度集成:工业视觉检测新范式 本文揭示了LabVIEW与最新YOLO26模型深度集成的创新方案,通过C++封装ONNX Runtime为DLL,在LabVIEW中实现端到端视觉检测。核心突破点包括: 技术选型:对比YOLOv5/YOLOv8/YOLO26性能,YOLO26在CPU推理速度提升43%,支持NMS-Free端到端推理 部署架构:提供ONNX Runtime C++ API和TensorRT两种DLL封装路径,适配不同硬件环境 工程实现:详细展示从PyTorch模型导出

ZXSXJ的博客 277

Qt入门教程【基础控件篇】QLineEdit输入框

QLineEdit输入框

小鱼酱的博客 3248

生存曲线绘制及图例标签添加(使用R语言)

数据应该包含两列:一个是表示个体生存时间的时间变量(通常称为"时间(time)“)和一个是表示个体是否发生事件(如死亡)的事件变量(通常称为"事件(event)”)。通过修改上述代码中的数据和参数,您可以根据自己的需求绘制生存曲线,并添加相应的图例信息和标签。生存曲线是在生存分析中常用的工具,用于描述一组个体随时间的存活概率。函数的第一个参数指定图例的位置,这里我们选择了右上角(“topright”)。包来进行生存曲线的绘制,并通过添加图例信息和标签来增强可视化效果。的数据框,包含这两列数据。

CyberXZ的博客 549

如何调用 DBMS_DISKGROUP 对 ASM 文件进行随机读取

该篇博客介绍了如何通过 Java 调用 DBMS_DISKGROUP 读写 Oracle ASM 共享存储文件,并提供了 Java Demo。并测试出 DBMS_DISKGROUP 存在性能瓶颈。

我要出家当道士 1168

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 从STT到Super TT:USB-HUB带宽共享技术的演进与实战解析
下一篇: 第六章:从配置到验证——Tessent Scan插入流程的深度解析
AngstEssenSeele
博客等级 码龄8年 40粉丝 1万+原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值