We will need first to setup several env variable. The most easy way to do it, it's to create a .env file at the root level:
export CONNECTION_STRING_DEVICE=<HostName=...;DeviceId=...;SharedAccessKey=...>
export CONNECTION_STRING_SERVICE=<HostName...net;SharedAccessKeyName=...;SharedAccessKey=....>
export IOTHUB_DEVICE_ID=<name of the device>
And then source it:
$ source .env
Install all dependencies:
$ pip3 install -r requirements.txt
Now you can execute all python script
Azure :
Revpi dio :