Questions tagged with AWS IoT Core

Content language: English

Sort by most recent

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

Code 400, message Bad request version ('18.0} from Network Load Balancer

My problem is that I am in the process of moving from the IoT-Core/Lambda services to a ECS docker doing containing a Mosquitto broker. This is because AWS IoT-Core does not support basic authentication and we really need this to be supported - our IoT devices have very limited resources, so we struggle very much to perform the encryption you require on the IoT-Core service. Now I have setup the docker and implemented the network load balancer, but sometimes (only sometimes) the load balancer fails to handle a simple JSON message. The MQTT message I am sending is always the same, but sometimes the load balancer fails with "code 400, message Bad request version" and other times everything is fine. When I am sending the messages directly to the Containers public IP things are always working. Also when I have the exact same docker running on my localhost and there things are also working fine. So, I think this is a problem caused by the load balancer and I am out of ideas on how solve this? Log from where the load balancer rejets the message: 2022-10-28 06:50:3410.0.0.196 - - [28/Oct/2022 04:50:34] code 400, message Bad request version ('18.0}')8a1c1c7e0e5d4353ac68e974ce4adb99 10.0.0.196 - - [28/Oct/2022 04:50:34] code 400, message Bad request version ('18.0}') 2022-10-28 06:50:3410.0.0.196 - - [28/Oct/2022 04:50:34] "2MQTTÂ< publisherdmrfOOgG5%@2hSV8DOF1nPa*80Ócanister/outgoing{"clientid": "786523DB50583837372E3120FF181243", "elapsedHours": 1, "powerUpCounter": 1, "pressure": 1024, "valveState": 1, "stepPressureTarget": 1000, "rtcTemp": 21.0, "batteryVoltage": 18.0}" 400 -8a1c1c7e0e5d4353ac68e974ce4adb99 10.0.0.196 - - [28/Oct/2022 04:50:34] "2MQTTÂ< publisherdmrfOOgG5%@2hSV8DOF1nPa*80Ócanister/outgoing{"clientid": "786523DB50583837372E3120FF181243", "elapsedHours": 1, "powerUpCounter": 1, "pressure": 1024, "valveState": 1, "stepPressureTarget": 1000, "rtcTemp": 21.0, "batteryVoltage": 18.0}" 400 -
1
answers
0
votes
14
views
asked a month ago

SSLError on GET request from Chalice to IoT Core

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
32
views
asked a month ago

ShadowManager deployment failed

Hi,When I am deploying ShadowManager , I am getting the following error 2022-10-25T08:06:25.546Z [INFO] (aws.greengrass.ShadowManager-lifecycle) com.aws.greengrass.shadowmanager.ShadowManager: service-set-state. {serviceName=aws.greengrass.ShadowManager, currentState=ERRORED, newState=NEW} 2022-10-25T08:06:25.619Z [ERROR] (pool-2-thread-18) com.aws.greengrass.shadowmanager.ShadowManager: service-errored. {serviceName=aws.greengrass.ShadowManager, currentState=NEW} java.lang.IllegalStateException: File corrupted in chunk 1401, expected check value 1854, got 1850 [1.4.200/6] at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.Chunk.readBufferForPage(Chunk.java:379) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.readBufferForPage(MVStore.java:1214) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.readPage(MVStore.java:2209) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.readPage(MVMap.java:672) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.readOrCreateRootPage(MVMap.java:688) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.setRootPos(MVMap.java:682) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.openMap(MVStore.java:576) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.openMap(MVStore.java:535) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.tx.TransactionStore.openMap(TransactionStore.java:534) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.tx.Transaction.openMap(Transaction.java:544) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVPrimaryIndex.<init>(MVPrimaryIndex.java:62) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTable.<init>(MVTable.java:120) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTableEngine$Store.createTable(MVTableEngine.java:253) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:127) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:41) at com.aws.greengrass.shadowmanager.lib.org.h2.schema.Schema.createTable(Schema.java:697) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Database.open(Database.java:741) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Database.openDatabase(Database.java:307) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Database.<init>(Database.java:301) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Engine.openSession(Engine.java:74) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Engine.openSession(Engine.java:192) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Engine.createSessionAndValidate(Engine.java:171) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Engine.createSession(Engine.java:166) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Engine.createSession(Engine.java:29) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:340) at com.aws.greengrass.shadowmanager.lib.org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173) at com.aws.greengrass.shadowmanager.lib.org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152) at com.aws.greengrass.shadowmanager.lib.org.h2.Driver.connect(Driver.java:69) at com.aws.greengrass.shadowmanager.lib.org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) at com.aws.greengrass.shadowmanager.lib.org.h2.jdbcx.JdbcDataSource.getConnection(JdbcDataSource.java:160) at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56) at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80) at org.flywaydb.core.Flyway.execute(Flyway.java:453) at org.flywaydb.core.Flyway.migrate(Flyway.java:158) at com.aws.greengrass.shadowmanager.ShadowManagerDatabase.install(ShadowManagerDatabase.java:74) at com.aws.greengrass.shadowmanager.ShadowManager.install(ShadowManager.java:215) at com.aws.greengrass.lifecyclemanager.Lifecycle.lambda$handleCurrentStateNew$5(Lifecycle.java:441) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Suppressed: com.aws.greengrass.shadowmanager.lib.org.h2.message.DbException: (Message 90028 not found) [90028-200] at com.aws.greengrass.shadowmanager.lib.org.h2.message.DbException.get(DbException.java:194) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTableEngine$Store.close(MVTableEngine.java:421) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1545) at com.aws.greengrass.shadowmanager.lib.org.h2.engine.Database.openDatabase(Database.java:329) ... 24 more Caused by: com.aws.greengrass.shadowmanager.lib.org.h2.jdbc.JdbcSQLNonTransientException: (Message 90028 not found) [90028-200] at com.aws.greengrass.shadowmanager.lib.org.h2.message.DbException.getJdbcSQLException(DbException.java:505) at com.aws.greengrass.shadowmanager.lib.org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ... 28 more Caused by: java.lang.IllegalStateException: File corrupted in chunk 1401, expected check value 1854, got 1850 [1.4.200/6] at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.Chunk.readBufferForPage(Chunk.java:379) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.readBufferForPage(MVStore.java:1214) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.readPage(MVStore.java:2209) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.readPage(MVMap.java:672) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.readOrCreateRootPage(MVMap.java:688) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVMap.setRootPos(MVMap.java:682) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.openMap(MVStore.java:576) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStore.openMap(MVStore.java:535) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStoreTool.compact(MVStoreTool.java:559) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStoreTool.compact(MVStoreTool.java:506) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.MVStoreTool.compact(MVStoreTool.java:449) at com.aws.greengrass.shadowmanager.lib.org.h2.mvstore.db.MVTableEngine$Store.close(MVTableEngine.java:410) ... 26 more 2022-10-25T08:06:25.625Z [INFO] (aws.greengrass.ShadowManager-lifecycle) com.aws.greengrass.shadowmanager.ShadowManager: service-set-state. {serviceName=aws.greengrass.ShadowManager, currentState=NEW, newState=BROKEN} my device : Linux raspberrypi 4.4.26-v7+ #1 SMP Sat Oct 22 21:06:04 HKT 2016 armv7l GNU/Linux java version : openjdk version "11.0.17" 2022-10-18 LTS OpenJDK Runtime Environment Zulu11.60+19-CA (build 11.0.17+8-LTS) OpenJDK Client VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)
1
answers
0
votes
40
views
asked a month ago

greengrass component cannot open camera

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
31
views
hyorim
asked a month ago