The actual content is coming soon. We shall develop a software that will control our home automation projects and devices with Raspberry pi.


01.  makefile:4: *** missing separator. Stop

=> Solution, convert space to tab in the makefile (use Notepad ++,  Edit | Blank Operation | Space to Tab)

02. Updating Pi

=> sudo apt dist-upgrade

03. Installing Wiringpi

=> cd /tmp


sudo dpkg -i wiringpi-2.61-1-armhf.deb

# Test

sudo gpio -g mode 19 out

sudo gpio -g write 19 1

04. Update Tool Chain

=> sudo apt update 

sudo apt dist-upgrade

sudo apt-get install build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev

05. How to compile from commandline

=> gcc -o led_blink led_blink.c -l wiringPi

06. Download Source code

=> git clone, go to the folder and ./build

07. Libmodbus Installation

=> sudo apt install libmodbus-dev

08. Physical PINs (Image source


Download and launch the Raspberry Pi Imager


L298N motor Driver

L298N is a motor driver, which can be used to control a DC motor. We shall use this module to control motor over Modbus TCP.

Jumper: jumper in place – uses the motors power supply to power up the chip. Jumper removed: you need to provide 5V to the +5V terminal. If you supply more than 12V, you should remove the jumper

VCC : This is the pin which supplies power to the motor. It can be 6-12V.

Ground : This is the common ground pin.

5V: This pin supplies the power (5V) for the internal circuit (L298N IC). 

ENA: This pin controls the speed of the motor A by enabling the PWM signal (connect to lower pin of ENA).

IN1 & IN2: These are the input pins for motor A. They control the spinning direction  of motor A.

IN3 & IN4: These are the input pins for motor B. They control the spinning direction of motor B.

ENB: This pin controls the speed of the motor B by enabling the PWM signal.

OUT1 & OUT2: OUT1: Positive terminal, OUT2: Negative terminal

OUT3 & OUT4: OUT3: Positive terminal OUT4: Negative terminal



=> (Create make file)

=> (GPIO and BCM)