Error running coral.cloudiot.core apperas suddenly

234 views Asked by At

I am using the coral.cloudiot.core class (install instructions). This is a high level API for paho-mqtt.

Please find a simplified version of my code below:

with CloudIot("./cloud_config.ini", config_section='DEFAULT') as cloud:
    while True:

        """if a defined if clause evalutes to True, 
        the following method is executed."""

        cloud.publish_message(message)
  • Port 443 is used for the communication with the gcloud iot hub.
  • I tried qos = 0 and 1
  • systemctl is used to run the code.
  • The scripts sends up to 48 messages per minute.
  • ntp port is blocked by firewall (htpdate is used with crontab 5 * * * *)

After sometime the following error message accrues.

Mar 08 03:17:33 mocha-orange systemd[1]: Started ANN Client Detection.
Mar 09 07:18:30 mocha-orange start_service_client[3957]: Exception in thread Thread-1:
Mar 09 07:18:30 mocha-orange start_service_client[3957]: Traceback (most recent call last):
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     self.run()
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3.7/threading.py", line 865, in run
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     self._target(*self._args, **self._kwargs)
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/coral/cloudiot/core.py", line 196, in _token_update_loop
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     username='unused', password=self._create_jwt())
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/coral/cloudiot/core.py", line 225, in _create_jwt
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     return self._jwt_inst.encode(token, self._private_key, algorithm=self._algorithm)
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 65, in encode
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     json_payload, key, algorithm, headers, json_encoder
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/jwt/api_jws.py", line 114, in encode
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     signature = alg_obj.sign(signing_input, key)
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/coral/cloudiot/ecc608.py", line 132, in sign
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     return ecc608_hw_sign(msg)
Mar 09 07:18:30 mocha-orange start_service_client[3957]:   File "/usr/lib/python3/dist-packages/coral/cloudiot/ecc608.py", line 81, in ecc608_hw_sign
Mar 09 07:18:30 mocha-orange start_service_client[3957]:     assert status == 0
Mar 09 07:18:30 mocha-orange start_service_client[3957]: AssertionError

I do not understand how to solve this problem. I appreciate any hint.

0

There are 0 answers