- 1 x ESP32 Dev modules
- 1 x RaspberryPI 2 B
- 1 x Char LCD 2*16 with i2c ic
- 1 x Char LCD 2*16
- 2 x LORA-RA02(Sx1278)
- 2 x 2.4GHZ Antena 3dbi with converter cable
- 3 x push button with 10k resistor pull down
- 4 x led 2 on esp32 2 on pi (on esp32 for send signal and else)(on pi for app running and receive)
- 1 x wifi adapter usb
- 1 x DS18B20 with 4.7k resistor
The PINOUT file for ESP32 and PI is available in each directory
First, add ESP32 to your list of boards in Arduino
Then install the following libraries
DallasTemperature
LiquidCrystal_I2C
RH_RF95
Then compile the code and transfer it to the board.
First, we clone all the codes in Raspberry Pi
git clone https://github.com/DJFRS/Lora-Esp32-Nodejs-RPI.git
Then we have to ensure the installation of Python 3.9 and NodeJS 16, if the version is not available, update it.
python3 -V
python3 -m pip -v
node -v
npm -V
Then we need to install yarn
npm install --global yarn
Then enter the Python directory and install the modules
cd Lora-Esp32-Nodejs-RPI
cd pi
cd Python
python3 -m pip install -r requirements.txt
Then we need to install the NodeJS and NextJS packages
cd ..
cd nodejs
cd nextjs-iot-core
yarn install
cd ..
cd nodejs-iot-core
yarn install
You need to enter nodejs server ip in nextjs and python
in python
Lora-Esp32-Nodejs-RPI
└── pi
└── python
└── main.py
Set the server line and port according to nodejs
device_name="sen1"
server_ip="127.0.0.1"
server_port=81
in Nextjs
Lora-Esp32-Nodejs-RPI
└── pi
└── nodejs
└── nextjs-iot-core
└── next.config.js
Set the server line and port according to nodejs
env: {
serverUrl: "127.0.0.1:81",
},
You can run nodejs and nextjs server on different servers
But you can't Python. It must be launched on Raspberry Pi
Now it's time to start the server
You have to run each section separately in different terminals and simultaneously
First NodeJS
cd Lora-Esp32-Nodejs-RPI
cd pi
cd nodejs
cd nodejs-iot-core
yarn start
Start nextjs
cd Lora-Esp32-Nodejs-RPI
cd pi
cd nodejs
cd nextjs-iot-core
yarn build
yarn start
Start python
cd Lora-Esp32-Nodejs-RPI
cd pi
cd python
python3 main.py
You should also turn on the transmitter board.