Performs processing according to the received message.
The processing to be performed calls the following two programs in the subprocess.
① "rrr"
Program to turn on/off the LED
② "xxxx"
A program that repeats LED blinking and buzzer ON until the switch is pressed
Received message'xxxx' on topic'system' with QoS 1
xxxx
Received xxxx ...
No handlers could be found for logger "AWSIoTPythonSDK.core.protocol.mqtt_core"
Traceback (most recent call last):
File "./test.py", line 90, in<module>
client.subscribe (TOPIC, 1, my callback)
File "/usr/local/lib/python2.7/dist-packages/AWSIoTPythonSDK/MQTTLib.py", line 696, in subscribe
return self._mqtt_core.subscribe (topic, QoS, callback)
File "/usr/local/lib/python2.7/dist-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 306, in subscribe
raise subscribeTimeoutException ()
AWSIoTPythonSDK.exception.AWSIoTExceptions.subscribeTimeoutException
-
Answer # 1
-
Answer # 2
When started with subprocess.check_call, the process does not move to the next line until the command is completed. Therefore, since xxxx never ends, it seems that the Subscribe side remains stopped and an exception of subscribeTimeoutException has occurred.
You need to use subprocess.Popen to get the desired movement.
Reference: https://jellyware.jp/kurage/raspi/subprocess.html
-
Answer # 3
Since subprocess.check_call is used in mycallback, it seems that the process has not returned and has timed out.
Related articles
- python: an error occurs that the type is different in the output using dict key values
- python 3x - an error occurs after registering a dictionary with a read-aloud bot on discordpy
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - error during model training with object detection model ssd (rykov8/ssd_keras)
- python - an error occurs in the if statement program that compares the size of numbers
- python max () arg is an empty sequence and an error occurs and it cannot be processed well
- python - an error occurs when django's summer note is reflected in admin
- an error occurs during python scraping (retrieving property information from suumo)
- unintended deletions occur during symbol identification and deletion processing in python
- python - i want to display an image with pysimplegui, but an error occurs
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python - web scraping what to do when a webdriverexception occurs on starbucks hp
- python - i get an error when connecting to a voice channel with discordpy
- python - the py file cannot be executed in the task scheduler 0x2 error
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- python - an error has occurred in yolo v3
- python - idle cannot resolve the "rootgeometry" error
- python - tuple error does not resolve
- python 3x - error after changing to csv file
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
It was avoided by setting the timeout of AWSIoTPythonSDK.MQTTLib.