Close
0%
0%

DockerPi series of 4 Channel Relay Board about IOT

The project to introduce how to use Docker Pi series of 4 Channel Relay board about IOT by Microsoft Azure

Similar projects worth following
0 followers
Hello,everyone.Recently,i found the DockerPi of 4 Channel Relay also could operate by Microsoft Azure.I believe that there is no doubt that you have a account of Microsoft Azure.You could use it almost full function for one year.So if you still don't know this,go to sign up and buy a DockerPi 4 Channel Relay Board,then follow me how to use it by Microsoft Azure.Through this simple tutorial,you can use your ability to realize smart home

Firstly,let us look how to install it to raspiberrpi 

It is very easy to install,you just need to insert their 40pin pins into it.

Please turn off the power when you are installing them.

Above all,please open the I2C.

sudo raspi-config       

Secondly,you need to check your python3's version,it needs to be 3.7 or above.Or,you need to update your python3's version:

python3 --version

Then you need to install the Azure relevant components.Be careful,you must use the command which include the "python3":

pip3 install azure-iot-device

 Next you need to check whether you have already installed the tool of git,if you have installed the git,please execute the following commands:

git clone https://github.com/Azure/azure-iot-sdk-python --depth=1

Go to the following directory:

~/azure-iot-sdk-python/azure-iot-device/samples/advanced-hub-scenarios

Then open the file:update_twin_reported_properties.py and add some codes:

Change to the following codes on the picture:

the HostName...which you could get from the Azure webiste.

Then add some codes following on the picture:

Next,execute by the python3 in terminal.

Open the Microsoft Azure,please choose the device _twin and open it like the picture showing:

You will see the phenomenon on the picture:

Of course,we can do the same operation to open other Relays:

From the codes we can know we could use to transmit "5" to shutdown all the Realys:

At the same time,you could  see all the Relay's LED has been turned off.

  • 1 × DockerPi 4 Relay Board
  • 1 × Raspberry Pi 3B/3B+/4B
  • 1 × 16GB Class 10 TF Card
  • 1 × 5V/2.5A power supply or 5v/3A power supply for RPi 4B

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates