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.

Does anyone have experience with connecting to AWS IoT using Azure RTOS NetXDuo? I have successfully connected to Azure IoT and Mosquitto public broker. The problem I think is I'm using certificates in the wrong way This is an example of when I'm successfully connected to mosquitto: it uses only root_ca certificate without username/password. ``` #define HOST_NAME "test.mosquitto.org" #define SERVER_NAME "test.mosquitto.org" #define DEVICE_ID "nxpevkboard" #define SERVER_PORT 8883 #define PUBLISH_TOPIC "devices/%s/test/me" #define SUBSCRIBE_TOPIC "devices/%s/notice/me" for (i = 0; i < sizeof(threadx_tls_remote_certificate) / sizeof(NX_SECURE_X509_CERT); i++) { /* Need to allocate space for the certificate coming in from the remote host. */ nx_secure_tls_remote_certificate_allocate(tls_session, &threadx_tls_remote_certificate[i], threadx_tls_remote_cert_buffer[i], sizeof(threadx_tls_remote_cert_buffer[i])); } /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ status = nx_secure_x509_certificate_initialize(trusted_certificate, mosqitto_root_ca, sizeof(mosqitto_root_ca), NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); status = nx_secure_tls_trusted_certificate_add(tls_session, trusted_certificate); ``` AWS provides one more certificate and private key. I tried to include both certificates with provided private_key. API returned success status but later client can't connect to the host, so maybe I have a mistake in host or servername. ``` #define HOST_NAME "xxxx.iot.us-west-2.amazonaws.com" #define SERVER_NAME "xxxx.iot.us-west-2.amazonaws.com" #define DEVICE_ID "nxpevkboard" #define SERVER_PORT 8883 #define PUBLISH_TOPIC "devices/%s/test/me" #define SUBSCRIBE_TOPIC "devices/%s/notice/me" for (i = 0; i < sizeof(threadx_tls_remote_certificate) / sizeof(NX_SECURE_X509_CERT); i++) { /* Need to allocate space for the certificate coming in from the remote host. */ nx_secure_tls_remote_certificate_allocate(tls_session, &threadx_tls_remote_certificate[i], threadx_tls_remote_cert_buffer[i], sizeof(threadx_tls_remote_cert_buffer[i])); } /* This should be local cert i think. */ status = nx_secure_x509_certificate_initialize(certificate, amazon_cert, sizeof(amazon_cert), NX_NULL, 0, private_key, sizeof(private_key), NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); status = nx_secure_tls_local_certificate_add(tls_session, certificate); /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ status = nx_secure_x509_certificate_initialize(trusted_certificate, amazon_root_ca_cert, sizeof(amazon_root_ca_cert), NX_NULL, 0, private_key, sizeof(private_key), NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); status = nx_secure_tls_trusted_certificate_add(tls_session, trusted_certificate); ```
1
answers
0
votes
43
views
Brjk
asked 4 months ago
My testing has hit a number of roadblocks: 1. I often run into an issue where my GG device stops accepting any new component commands including deployments from the console. The console will report all is well, but the instance does not show the updated component list for example. This can be solved easily by restarting the instance and running the commands again or redeploying, although I do not know why this occurs, this will happen after about 1-2 hours of constant use on a t3.large Ubuntu Cloud9 instance. It seems to occur specifically with the Publisher and Subscriber components running but enough work with any components will cause logs to start failing to appear in the /greengrass/v2/logs file and new commands to be essentially ignored. This is hard to catch and harder to debug due to the lack of new log files. 2. Just trying to test the Stream Manager component has proven to be almost impossible and my test case (which I've gotten to work just a week ago) no longer runs correctly and I have no idea how to fix it or if I'm looking at the incorrect logs. I've been running the Custom Component tutorial here: https://docs.aws.amazon.com/greengrass/v2/developerguide/use-stream-manager-in-custom-components.html This is under the "Define component recipes that use stream manager" > "Use the Stream Manager SDK for Python" > https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python/blob/main/samples/stream_manager_s3.py I will include the logs in a response below 3. Finally, I don't see any documentation on how to trigger a component using MQTT. I've tried importing a Lambda which has the option to be triggered by the local topic but haven't been able to test it due to the above. Any documentation on how to subscribe to a topic and run a script on the GG Core device when a message comes through from a client device (similar to an SNS topic triggering a Lambda) would be helpful. PS. I did find some stuff for V1 of GG but I'm specifically looking for V2.
2
answers
0
votes
83
views
AWS
asked 4 months ago
I inited a aws-greengrass-labs-local-web-server community component for deploying my web application to Iot aws greengrass. But in the template, I see this: Artifacts: - URI: s3://BUCKET_NAME/COMPONENT_NAME/COMPONENT_VERSION/aws.greengrass.labs.LocalWebServer.zip Unarchive: ZIP I would like to ask whether I must host my website to AWS S3 first in order to build the component? Also, it is a must to download AWS CLI for building a aws-greengrass-labs-local-web-server community component?
2
answers
0
votes
113
views
asked 4 months ago
Hello, I am starting with AWS Iot Core. I use the MQTT protocol. I did create my Device on the account, as well as its shadow and embedded the 3 certificates: AmazonRootCA1.pem, <MyDeviceName>.cert.pem, and <MyDeviceName>.private.key When I try to connect, each of these certificates seems to be well recognized by my API functions, (I'm not using the AWS SDK, I'm using the Azure RTOS APIs... provided by my device's microcontroller manufacturer) However the TLS session seems to start correctly, the "ClientHello" transaction seems to start well with a successful first handshake, but the connection breaks without me being able to find the reason. Namely, my code was adapted for AWS IOT Core, because it originally worked for Azure IT Hub... I hope someone here can help me? Thanks in advance, Best Regards, Eric F.
3
answers
0
votes
70
views
asked 4 months ago
I have a thing with a classic shadow and several named shadows. I don't know the name of the named shadows. they are created by the devices with a uuid the moment the device connects to IoT Core I need to get in a single document the current state of all the shadows of the thing. one json that includes the classic shadow current state together with the current state of all the named shadows Is it possible to do this with one single API call? using IoT core and/or other services like fleet indexing ? Currently I'm using the API to fetch all the named shadows of the thing and then fetch each shadow document per named shadow. But maybe there is a better option. thanks
1
answers
0
votes
41
views
mvp
asked 4 months ago
Hi there, I've installed the stream manager via pip, also installed the stream manager component via AWS console and everything looks healthy. I am trying to run these samples from github: https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python/tree/main/samples and I am getting this error message (using sudo): ``` ERROR:StreamManagerClient:Received ConnectResponse with unexpected status ResponseStatusCode.Unauthorized. ERROR:root:Exception while running Traceback (most recent call last): File "s3.py", line 41, in main client = StreamManagerClient() File "/usr/local/lib/python3.8/dist-packages/stream_manager-1.1.1-py3.8.egg/stream_manager/streammanagerclient.py", line 114, in __init__ UtilInternal.sync(self.__connect(), loop=self.__loop) File "/usr/local/lib/python3.8/dist-packages/stream_manager-1.1.1-py3.8.egg/stream_manager/utilinternal.py", line 39, in sync return asyncio.run_coroutine_threadsafe(coro, loop=loop).result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 444, in result return self.__get_result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result raise self._exception File "/usr/local/lib/python3.8/dist-packages/stream_manager-1.1.1-py3.8.egg/stream_manager/streammanagerclient.py", line 152, in __connect await asyncio.wait_for(self.__connect_request_response(), timeout=self.request_timeout) File "/usr/lib/python3.8/asyncio/tasks.py", line 494, in wait_for return fut.result() File "/usr/local/lib/python3.8/dist-packages/stream_manager-1.1.1-py3.8.egg/stream_manager/streammanagerclient.py", line 309, in __connect_request_response raise ConnectFailedException("Failed to establish connection with the server") stream_manager.exceptions.ConnectFailedException: Failed to establish connection with the server ``` So the error says that if failed to establish a connection with the server, but I am not sure what server is it referring to? DId I miss a step somewhere? Cheers, Mark
0
answers
0
votes
48
views
asked 4 months ago
Hello. I deployed component to Raspberry Pi with AWS IoT Greengrass. The Raspberry pi is in normal condition. The deployment status of the components is also normal. But I have an error. I set it as an artifact to the file I uploaded on the S3 bucket. My artifact is a file for socket communication. This is what I think. 1. Deploy components in AWS IoT Greengrass. 2. When the deployment is completed, the server file for socket communication is executed. 3. If I run a client file on my computer, I can connect to each other and communicate with each other. 4. Then, another file in the artifact, the face recognition file, can be executed to make an inference. But I have an error here. Socket communication seems to be connected. However, the print statement that the socket was opened does not appear in the log. So I'm curious. Was it wrong to connect socket communication with components? I'm confused. Because if I run the temperature and humidity measurement file instead of the face recognition file in number 4 above, it runs well! Strangely, the face recognition function does not work. Is it because face recognition takes a long time? Then can I fix this by modifying the components? I don't know if it's a component problem or a socket communication problem. I always look forward to your reply. This is my Raspberry Pi's log. <My Component's Log> 2022-11-07T11:19:51.555Z [INFO] (pool-2-thread-20) com.james.socket: shell-runner-start. {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=STARTING, command=["cd /home/pi&&. pracvenv/bin/activate&&cd socketserve&&python3 socketserver.py"]} 2022-11-07T11:21:49.203Z [WARN] (Copier) com.james.socket: 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.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING} 2022-11-07T11:21:49.204Z [WARN] (Copier) com.james.socket: stderr. '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple). {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING} 2022-11-07T11:21:49.205Z [WARN] (Copier) com.james.socket: stderr. WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.. {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING} <Greengrass Log> 2022-11-07T11:19:59.699Z [INFO] (pool-2-thread-10) com.aws.greengrass.deployment.DeploymentDirectoryManager: Clean up link to earlier deployment. {link=/greengrass/v2/deployments/previous-success} 2022-11-07T11:19:59.972Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: Received empty jobs in notification . {ThingName=Raspberrypi4} 2022-11-07T11:34:35.021Z [WARN] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection interrupted. {clientId=Raspberrypi4, error=The connection was closed unexpectedly.} 2022-11-07T11:34:35.260Z [INFO] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection resumed. {clientId=Raspberrypi4, sessionPresent=true} 2022-11-07T11:34:35.272Z [INFO] (Thread-4) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=RECONNECT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-07T11:34:35.299Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: No deployment job found. {ThingName=Raspberrypi4} 2022-11-07T11:45:08.486Z [WARN] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection interrupted. {clientId=Raspberrypi4, error=The connection was closed unexpectedly.} 2022-11-07T11:45:10.725Z [INFO] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection resumed. {clientId=Raspberrypi4, sessionPresent=true} 2022-11-07T11:45:10.728Z [INFO] (Thread-4) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=RECONNECT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-07T11:45:10.767Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: No deployment job found. {ThingName=Raspberrypi4} Thank you
1
answers
0
votes
49
views
hyorim
asked 4 months ago
I'm using an ESP32 as a simple counter and my program has been working for a few months. I made a small change to send more data and I am getting this error. The size of the JSON payload is about 50 only. ** However, the data is being stored as per the rule in my DynamoDB table with no errors.** Why is the information to my device coming back on the rejected topic rather than the accepted one? 14:49:33.250 -> $aws/things/Dev3/shadow/update - {"state": {"reported": {"9": "53,192,1667553572" }}} 14:49:33.250 -> $aws/things/Dev3/shadow/update/rejected - {"code":413,"message":"Json document too large. Size is 8202, max allowed: 8192"} Thanks
2
answers
0
votes
37
views
asked 4 months ago
Can I deploy a video analysis web application run on a Nvdia Gpu server, which receive videos from pc at the frontend then done the video analysis at the backend, on aws Iot greengrass, without modification of the original project? How to do it? If no, how to deploy it to greengrass with the least modification?
1
answers
0
votes
43
views
asked 5 months ago
A customer is using AWS IoT and would like to push data to MSK with IoT rules, but they state that they can only use SASL_SCRAM as IAM authentication is not supported for IoT rules. Are there plans to support this in the near future? Or what is the suggested turnaround?
1
answers
0
votes
30
views
AWS
asked 5 months ago
Is there any way to enforce millisecond accurate timestamps in the metadata of messages from LoRaWan devices? I have verified that the timestamp generated by my gateway is a unix timestamp in millisecond (eg `1667406503931`), but the JSON timestamp in the metadata I am getting from IoT Core is a string timestamp that only goes to seconds (eg. `2022-11-02T16:23:15Z`). The example with gateway metadata off on [this page of the documentation](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-uplink-metadata-format.html) has an example of a message with milliseconds in the timestamp, and I am curious how accurate that example is. Currently if I disable gateway metadata in the service profile it will remove the timestamp all-together (the only metadata I get is fcount and fport) so I am wondering if I am missing something or if that example is just wrong. Truncating the milliseconds like this also makes it unclear if the timestamp in the metadata is the time that the Gateway received the message, or if it is the time that the LNS server received the message, is this information also available anywhere? I poked around in the settings and documentation for the Devices, Gateways, Device profiles and Service profiles and was unable to find much regarding timestamps or metadata formatting. Is anyone able to provide any insight into this, or otherwise point me in the right direction?
1
answers
0
votes
60
views
asked 5 months ago
Hello AWS team, Greeting from EU We have been getting our hands dirty with using AWS IOT. While exploring the service we came across device advisor test. Can you please provide us with a some sample MQTT Client that we can use to test out the device advisor. Most of our test are failing and we would like to see an example which passes the test. We are very inclined towards migrating to AWS IoT. https://docs.aws.amazon.com/iot/latest/developerguide/device-advisor-tests.html Regards JZ
1
answers
1
votes
76
views
asked 5 months ago