Git Product home page Git Product logo

lora-esp32-nodejs-rpi's Introduction

IoT Temperature Read with ESP32 & RaspberryPI NodeJS(ExpressJS) & Python & NextJS

MIT License

Parts

  • 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

Installation ESP32

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.

Installation PI

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.

🔗 Links

portfolio linkedin twitter

lora-esp32-nodejs-rpi's People

Contributors

djfrs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.