如何将图像从ESP32 CAM发送到IoT核心版? [英] How to send images from ESP32 CAM to IoT Core?

查看:341
本文介绍了如何将图像从ESP32 CAM发送到IoT核心版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要系统安全.

我厌倦了使用base64对图像进行编码,并通过MQTT将字符串发送到Iot Core.然后使用云函数对字符串进行解码,最后将解码后的图像存储在Google Cloud Storage中.问题是MQTT中消息的大小有限.

I tired to encode the image with base64 and sending the string via MQTT to Iot Core. Then decode the string with a cloud function and finally storage the decoded image in Google Cloud Storage. The problem is the limited size of a message in MQTT.

使用云功能然后在Google Cloud Storage中存储并不十分安全,任何人都可以访问该URL,并且我失去了对所有ESP32CAM通信的控制权.

Using a Cloud Function and then storage in Google Cloud Storage is not really secure, anyone could hit that url and I loos control of all the ESP32CAM comunication.

我错过了什么吗?有没有一种真正安全的方法将文件从IoT Core发送到Google Cloud Storage?

Am I missing something? is there a really secure way to send files to Google Cloud Storage from to IoT Core?

谢谢

推荐答案

IoT Core不应该用于传输大斑点.

IoT Core should not be used to transfer big blobs.

但是,您可以利用IoT Core和设备之间的安全连接将凭据发送到设备以安全地访问GCS.

However, you can take advantage of the secure connection between IoT Core and the device to send credentials to the device to access GCS securely.

创建一个对GCS存储桶具有仅写访问权限的服务帐户. 通过IoT Core将该服务帐户的密钥传递给设备(例如,通过配置更改) 然后,设备可以使用该密钥将其安全地连接到GCS并上传图像.

Create a service account with write only access to your GCS bucket. Pass a key for that service account to the device through IoT Core(via configuration change, for example) The device then can use that key to connect securely to GCS and upload the image.

根据您的首选项和特定用例,您可以随时旋转密钥以访问GCS,也可以根据需要进行细粒度的设置(所有设备一个密钥,每个设备一个密钥,... )

Depending on your preferences and the particular use case you can rotate the keys to access GCS whenever you want, or be as granular as you want with the permissions (one key for all the devices, one key per device, ...)

这篇关于如何将图像从ESP32 CAM发送到IoT核心版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆