Raspy GPIO (16) and
when the switch is on I'm thinking of sending an email via AWS IoT.
In the Python program below, the lines
mosquitto_pub to show "SyntaxError: invalid syntax".
It may be elementary, but I would appreciate it if you could point out the defect.
Incidentally, if you enter the same sentence (
mosquitto_pub...-m'Hello, World') directly in the raspy, the email will be sent successfully.
I confuse Python's program with the command that I type into the shell.
mosquitto_pub is the command of the shell to run with various optional arguments, such as
--cafilerootCA.pem.It doesn't work well even if I type it in as Python's program.
To move an external executable from Python, for example, you can use the standard library subprocess module.The following are possible writing methods for Python 3.5 and later:
Python versions 3.5 and older have a way to use
© 2022 OneMinuteCode. All rights reserved.