Questions tagged with Internet of Things (IoT)

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

if I push IoT Core data to Kinesis Analytics as stream, how possible is to apply order by query to streaming data because you don't have complete data to call "order by" ? My goal is pushing IoT Core data and push them to Analytics in order to put them in sequence and push to AppSync to broadcast to subscribers. This Way I can visualize the data flow in time series and sequential in real time. Thanks
2
answers
0
votes
29
views
asked 5 months ago
Hi, We have a number of custom Greengrass V2 components that we'd like to automatically load in the latest set of configuration settings that may have been changed andsince deployed to one or more devices. I'm assuming the correct way to do this is by triggering a component restart? Or is there a better way?
1
answers
0
votes
37
views
cgddrd
asked 5 months ago
Hello, I am receiving an SSLError when trying to send a GET request from my Chalice backend (which runs as a lambda) to Iot Core Device Shadow service, via Boto3 client for IoT Core. Here is the workflow I am looking to achieve: GET --> Chalice Backend (Lambda) --> Helper Module (Boto3) --> GET --> IoT Core Device Shadow REST API More details: this Helper Module uses a boto3 `iot-data` client to make requests to the Device Shadow REST API. Using this module alone, if I provide `AWS_SECRET_KEY` and `AWS_ACCESS_ID` as env variables, as advised in the boto3 configuration docs, I can successfully make the requests. The trouble starts when I try introducing the Chalice Backend into this workflow. More details about the boto3 module: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot-data.html. I import the Helper Module to the backend, and when I call something like `Helper.get_thing_shadow(...)`, it no longer works and I get an SSLError, with the following logs: ``` ... 1666806563116 Traceback (most recent call last): 1666806563116 File "/var/task/urllib3/connectionpool.py", line 703, in urlopen 1666806563116 httplib_response = self._make_request( 1666806563116 File "/var/task/urllib3/connectionpool.py", line 386, in _make_request 1666806563116 self._validate_conn(conn) 1666806563116 File "/var/task/urllib3/connectionpool.py", line 1042, in _validate_conn 1666806563116 conn.connect() 1666806563116 File "/var/task/urllib3/connection.py", line 414, in connect 1666806563116 self.sock = ssl_wrap_socket( 1666806563116 File "/var/task/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket 1666806563116 ssl_sock = _ssl_wrap_socket_impl( 1666806563116 File "/var/task/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl 1666806563116 return ssl_context.wrap_socket(sock, server_hostname=server_hostname) 1666806563116 File "/var/lang/lib/python3.9/ssl.py", line 501, in wrap_socket 1666806563116 return self.sslsocket_class._create( 1666806563116 File "/var/lang/lib/python3.9/ssl.py", line 1041, in _create 1666806563116 self.do_handshake() 1666806563116 File "/var/lang/lib/python3.9/ssl.py", line 1310, in do_handshake 1666806563116 self._sslobj.do_handshake() 1666806563116 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129) ... 1666806621896 botocore.exceptions.SSLError: SSL validation failed for https://data.iot.<my-region>.amazonaws.com/things/<thing-name>/shadow [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129) ``` What is going wrong with the authentication here, and how can I complete this workflow? I would like to avoid having to provide my personal aws access tokens to provide authentication, the backend authenticates the initial request and I just want to post a request to the IoT Core service from the backend after that. Thank you
1
answers
0
votes
63
views
asked 5 months ago
Hi. I deployed the components of Greengrass v2 to Raspberry Pi. The artifact of my recipe contains the face recognition inference code in the S3 bucket. So I created and deployed the components. The Raspberry pi status is normal, and the components are deployed successfully. But I have an error. In my inference code, there is a task to open and execute the camera connected to the Raspberry Pi4. But it can't open the camera when I deployed it as a component. What should I do? When I run the code on Raspberry Pi4, it runs well, but when I deploy it as a component, it doesn't. Help me!!! The camera connected to my Raspberry pi4 is intel realsense F450 Thank you. Please help me <This is my component's log> 2022-10-24T14:57:40.205Z [INFO] (pool-2-thread-28) com.example.jamesML: shell-runner-start. {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=STARTING, command=["cd /home/pi&&. pracvenv/bin/activate&&cd james_ml&&python3 practice.py"]} 2022-10-24T14:58:11.981Z [WARN] (Copier) com.example.jamesML: stderr. /home/pi/pracvenv/lib/python3.7/site-packages/h5py/__init__.py:40: UserWarning: h5py is running against HDF5 1.10.6 when it was built against 1.10.4, this may cause problems. {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=RUNNING} 2022-10-24T14:58:11.982Z [WARN] (Copier) com.example.jamesML: stderr. '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple). {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=RUNNING} 2022-10-24T14:58:11.982Z [WARN] (Copier) com.example.jamesML: stderr. WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.. {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=RUNNING} 2022-10-24T14:58:11.998Z [WARN] (Copier) com.example.jamesML: stderr. [ WARN:0@15.489] global /tmp/pip-wheel-8c7uejek/opencv-python_88dbbad412c5416b992ae69de26299d6/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can't open camera by index. {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=RUNNING} 2022-10-24T14:58:12.005Z [INFO] (Copier) com.example.jamesML: stdout. Could not open webcam. {scriptName=services.com.example.jamesML.lifecycle.run.script, serviceName=com.example.jamesML, currentState=RUNNING} 2022-10-24T14:58:13.240Z [INFO] (Copier) com.example.jamesML: Run script exited. {exitCode=0, serviceName=com.example.jamesML, currentState=RUNNING} <and this is my recipe> { "RecipeFormatVersion": "2020-01-25", "ComponentName": "com.example.jamesML", "ComponentVersion": "1.0.19", "ComponentType": "aws.greengrass.generic", "ComponentDescription": "Capstone Design james machine learning.", "ComponentPublisher": "Me", "ComponentConfiguration": { "DefaultConfiguration": { "accessControl": { "aws.greengrass.ipc.mqttproxy": { "com.example.jamesML:mqttproxy:1": { "policyDescription": "Allows access to publish via topic ml/dlr/image-classification.", "operations": [ "aws.greengrass#PublishToIoTCore" ], "resources": [ "ml/dlr/image-classification" ] } } } } }, "Manifests": [ { "Platform": { "os": "linux", "architecture": "arm" }, "Lifecycle": { "install": { "Script": "" }, "run": { "script": "cd /home/pi&&. pracvenv/bin/activate&&cd james_ml&&python3 practice.py" } }, "Artifacts": [ { "Uri": "s3://greengrass-sagemaker-0930/james_ml.zip", "Digest": "Bc8JmqcuVXamFOuXHeEGMoNovRTgwo9sJQEcsgpqoDo=", "Algorithm": "SHA-256", "Unarchive": "ZIP", "Permission": { "Read": "OWNER", "Execute": "NONE" } } ] } ], "Lifecycle": {} }
1
answers
0
votes
58
views
hyorim
asked 5 months ago
Hello I'm going to deploy a component with AWS Greengrass v2. I will deploy the recipe I wrote to Raspberry Pi4. The artifacts in the recipe are associated with a face recognition inference code in the S3 bucket. I'm curious. Can you make the component deployment run automatically whenever I request it? Like it's triggered like a lambda. Or it doesn't have to be this. If this is possible, I would like to know what the command to do it in boto3 is. Or is it possible to have the deployment run only at a certain time? Please let me know. Thank you.
1
answers
0
votes
58
views
hyorim
asked 5 months ago
Does IoT Core batch messages to Timestream or invoke the WriteRecords API for every incoming message? The Timestream "Best Practices" docs recommends batching to optimize data ingestion performance & cost. https://docs.aws.amazon.com/timestream/latest/developerguide/data-ingest.html Thanks.
1
answers
0
votes
70
views
asked 5 months ago
I can't see the data in AWS SiteWise Edge from REST API, CLI or monitor portal, but I can see it in the AWS Sitewise. I use the last versions of components: OPC-UA collector: 2.1.3 Publisher: 2.2.2 Data processing pack: 2.2.23 In data processing component logs I see some errors but I can't interpret it correctly: ``` SiteWiseEdgeProcessor: stderr. % Total % Received % Xferd Average Speed Time Time Time Current. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.330Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. Dload Upload Total Spent Left Speed. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.330Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.335Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.336Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 100 7 100 7 0 0 1271 0 --:--:-- --:--:-- --:--:-- 1400. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.337Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. healthy[2022-10-21] [08:42:37] INFO - model-service is healthy. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.390Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. [2022-10-21] [08:42:37] INFO - Running curl -f http://localhost:9500/deep_ping command to validate health of insights. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.390Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. [2022-10-21] [08:42:37] INFO - Running commnad with "curl -f http://localhost:9500/deep_ping" command. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.397Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. % Total % Received % Xferd Average Speed Time Time Time Current. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.397Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. Dload Upload Total Spent Left Speed. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.397Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.399Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.399Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 100 7 100 7 0 0 2652 0 --:--:-- --:--:-- --:--:-- 3500. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:37.400Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. healthy[2022-10-21] [08:42:37] INFO - insights is healthy. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.557Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. [2022-10-21] [08:42:38] INFO - Running curl -f http://localhost:8081/deep_ping command to validate health of property-state-service. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.557Z [INFO] (Copier) aws.iot.SiteWiseEdgeProcessor: stdout. [2022-10-21] [08:42:38] INFO - Running commnad with "curl -f http://localhost:8081/deep_ping" command. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.587Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. % Total % Received % Xferd Average Speed Time Time Time Current. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.588Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. Dload Upload Total Spent Left Speed. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.588Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.619Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.619Z [WARN] (Copier) aws.iot.SiteWiseEdgeProcessor: stderr. 100 7 100 7 0 0 205 0 --:--:-- --:--:-- --:--:-- 212. {scriptName=services.aws.iot.SiteWiseEdgeProcessor.lifecycle.Run.Script, serviceName=aws.iot.SiteWiseEdgeProcessor, currentState=RUNNING} 2022-10-21T08:42:38.619Z [INFO] (Copier) aws.iot. ``` What I've already done: 1) Redeploy all component to edge 2) Recreate assets and data streams 3) Check all metrics from edge in CloudWatch and found no errors 4) Restart Sitewise Edge How can I proof the no data issue: On edge: ``` aws iotsitewise --endpoint https://localhost --no-verify-ssl get-asset-property-value-history --asset-id <id> --property-id <prod_id> { "assetPropertyValueHistory": [] } ``` The same command to cloud return data. And checking the monitor portal shows the same results.
1
answers
0
votes
85
views
asked 5 months ago
Hello I am studying Greengrass machine learning components. I have a question. I'm going to distribute Greengrass custom machine learning components to Raspberry Pi now. The artifacts associated with the recipe in this component contain inference codes uploaded to S3. And this inference code has a function of determining who is by photographing the user's face in real time. I'm curious. If the components are distributed well in Raspberry Pi, will the inference code continue to run? Or, do I have to deploy components every time I try to run an inference? Thank you.
0
answers
0
votes
54
views
hyorim
asked 5 months ago
I am getting error while running following command to register an M5 Core 2 AWS edukit device through platformio. 1 : "**cd Blinky-Hello-World**" ERROR: cd : Cannot find path 'C:\Users\Mshaikh\Documents\AWS_m5stack\Core2-for-AWS-IoT-EduKit\Blinky-Hello-World\Blinky-Hello-World' because it does not exist. At line:1 char:1 + cd Blinky-Hello-World + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\Mshaik...nky-Hello-World:String) [Set-Location], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand 2: "pio run -e core2foraws-device_reg -t register_thing" ERROR: Could not find a version that satisfies the requirement esptool>=3.2 (from versions: none) ERROR: No matching distribution found for esptool>=3.2 WARNING: There was an error checking the latest version of pip.
0
answers
0
votes
26
views
asked 5 months ago
I'm publishing Shadow updates from multiple iot devices. I want to filter those updates and extract only some data that will update another thing shadow (let's call it main shadow) with a list of Json objects. Each json object key is the thing id. For that, I have a rule that is subscribed to $aws/things/+/shadow/update/documents to capture all the devices shadow updates. So for example for the following updates to $aws/things/device101/shadow/update/documents ``` { state: { reported: { "temperature": "28" } } } ``` to $aws/things/device202/shadow/update/documents ``` { state: { reported: { "temperature": "31" } } ``` the main shadow will result in ``` { state: { reported: { "device101": { "temperature": "28" } "device202": { "temperature": "31" } } } ``` In my SQL I still can't find the way to use the thing id as a key in the json data that will be published to the main shadow. I'm using topic(3) as the function to get the thing name and Literals to build the json but it keeps telling me that it expects a key. I tried to cast the topic(3) function but same result ``` SELECT { topic(3): {'temperature': current.state.reported.temperature }} as state.reported FROM '$aws/things/+/shadow/update/documents' ``` ``` SqlParseException Expected a key, but got IDENT(topic). Object literals should follow the format {"keyName": any-expression, "anotherKey": any-expression} topic(3): ``` Any idea how this can be achieved ? thanks
2
answers
0
votes
117
views
mvp
asked 5 months ago
I trying to understand how AWS Device Shadow handles a failed update to a local device. For example, say an application wants to configure some property on this device, let's call this property "mode". My device accepts two values for "mode"; either "on" or "off". Now say some app updates the "desired" component of the shadow state document to the following: { "desired": { "mode": "invalid_mode" }, "reported": { "mode": "off" }, } When my device receives the delta for this situation, it will attempt to set "mode" to "invalid_mode"; my device does not permit this value for "mode", so this operation will not be applied. Therefore, I want to report back to the Device Shadow somehow that the update was not applied, i.e. I want the "reported" part of the state document to be unaltered for the setting "mode". The trouble is, leaving the property "mode" unaltered in "desired" means the delta will persist and I will keep receiving it over and over. Some solutions I saw recommended to send back the following to the shadow: { "desired": { "mode": null } } Which will erase the property from "desired" and stop the endless loop of deltas. However, I wanted to know if this is indeed the optimal/recommended approach to handling this case where "desired" updates were not applied. Are there any other ways of going about this? Additionally does the Device Shadow service provide any mechanism for reporting an invalid/rejected "desired" update as in this case? Thank you!
1
answers
1
votes
55
views
asked 5 months ago
I have an application using the Mosquitto MQTT library that publishes and subscribes using MQTT messages to AWS IoT. The connection succeeds, and the permissions are correct. I am logging using CloudWatch, and can see the successful connection in the log. The application subscribes to about 20 topics when it connects, then sends current values for those same topics. More than half the time, this fails. I get messages like this in the CloudConnect log: ``` { "timestamp": "2022-10-13 10:58:21.254", "logLevel": "ERROR", "traceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "accountId": "xxxxxxxxxx", "status": "Failure", "eventType": "Subscribe", "protocol": "MQTT", "topicName": "soft/increment/UI2", "clientId": "58af8c4d-d863-449e-b632-d2aae465797b", "principalId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "sourceIp": "xxxxxxxxxxxxxxxxx", "sourcePort": 52524 } ``` After this, AWS IoT drops the connection. If I disable the subscription step in my application, I get similar messages, but for eventType: Publish-In instead of Subscribe. As far as I can tell, I'm not exceeding any of the limits described here: https://docs.aws.amazon.com/general/latest/gr/iot-core.html#limits_iot If I allow my application to re-try the connection, it will fail repeatedly until one time it succeeds. At that point it can publish and receive data without any further trouble. This confirms that the permissions are correct. If I reduce the number of topics from 20 to 8, the chance of success rises substantially, to the point where the connection is almost reliable. If I add a 100ms delay between each subscription request, the chance of success rises substantially. If I add a 100ms delay between subscriptions, make a successful connection, then remove the 100ms delay and try again, the connection almost always succeeds, even though it was always failing prior to adding the 100ms delay the first time. If I remove the subscription step altogether, the chance of success does not apparently change. Using this same application to connect to the Mosquitto broker never fails. * What is going on here? This cannot be explained by permissions, and isn't obviously related to service limits. * How can I find more information than just "Failure" when AWS IoT rejects a message? * How can I make this reliable?
2
answers
0
votes
75
views
asked 5 months ago