Building A Motion Detector Troubleshooting Doc
Troubleshooting for the RaspberryPI motion detector. Topics include: RaspberryPi, AWS IOT Core, AWS SNS, and AWS SDK. This is a constantly updated document. If you had an issue with the tutorial and solved it, please let me know. Likewise, if you had an issue and did not solve it, please contact me.
RaspberryPI
SSH, Blank Terminal Screen:
- This is one of the more finicky parts of the process - stay levelheaded.
- Ctrl-C to stop the process, restart the pi, give it at least 3 minutes to get started, and then try to connect again
- Run this command to clear out previous references to raspberrypi.local and try to connect again
ssh-keygen -R raspberrypi.local
- Check the
wpa_supplicant.conf
. To do this, unplug the raspberry pi, remove the microSD card, and put it into your computer. If you want a refresher on what to do next, watch this video
AWS IOT Core
Check the SDK installation
- Things go wrong with installations all the time. Make sure that your installation is complete by verifying that you have the AWS IOT SDK in your home folder
Certificates
- Make sure you certificates are activated by going to IOT CORE –> Manage –> Thing –> Security
Policies
- Make sure there is a policy attached to your certificates by going to IOT CORE –> Manage –> Thing –> Security –> Polices. If there is not, follow the tutorial to add a policy to your things certificate
AWS SNS
No message received
- Region is important here. Make sure your MQTT client and the IOT rule are in the same Region.
- Check to make sure that your IOT rule is responding to RAW data, not JSON.
- Check to make sure your rule is looking for data in the correct topic
Import Errors:
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient ImportError: No module named AWSIoTPythonSDK.MQTTLib
- If you are getting this error, make sure you have python and the AWS IOT SDK installed on the device. Then, try the command(where the script is the name of your python script):
python3 script.py
Written on April 20, 2021