This is my undergraduate final project of bachelor degree on Computer Science at Fundação Universidade Regional de Blumenau (FURB).
It is a system to manage the logistic/supply-chain and track delivery transport, using a WiFi LoRa 32 to get vehicles geolocation and send via LoRaWAN to KORE network server which will forward the payloads to that application.
Article | Resources | Prerequisites | Setup | Running | Techs | License
The application has more functionalities like login, create products, users, devices and other ones, but the main are listed below:
- User's addresses CRUD, getting automatically coordinates when adding a new one
- Users do orders
- Create cargos
- Generate cargo pack list (PDF)
- Send vehicle geolocation throw LoRaWAN network
- Scan order's barcode
- Track cargos
Below are listed softwares that you must install to run the application:
- Git
- Yarn
- Node.js
- PostgreSQL
- mongoDB
- Arduino IDE
- Reactotron (optional)
To show map at frontend and geocoding user addresses it is used Mapbox API, so you must create an account and an access token at Mapbox.
LoRaWAN network server used is from KORE Wireless company. To user their services, you must contact them and choose/contract a plan that makes more sense for your application. Here, it was used the biggest one, G plan.
To build the device, components below are necessary:
- WiFi LoRa 32 (V2)
- GPS GY-NEO6MV2
- Protoboard 400 pins
- 4 jumpers male to male
- Portable charger (or other thing to power device)
- As said before, the device used was WiFi LoRa 32, for that you will need setup your Arduino IDE following the Helctec DOCS instructions
- Install TinyGPS++
- Get Heltec ChipID and license for you device following the instructions
- With ChipID, you must "tranform" it to a DevEUI, changing from 6 bytes to 8 bytes
- e.g.: if your ChipID is: 123456781122, your DevEUI will be: 0x12, 0x34, 0x56, 0xFF, 0xFF, 0x78, 0x11, 0x22
- Open device/lorawan_example.ino file and set values to variables DevEUI, AppEui and AppKey (the last two you can get in KORE)
With access to KORE, you need to create an "organização", a "aplicação" and two HTTP "encaminhamentos" (endpoints which KORE will send the payloads):
- URL: https://deggautcc.loca.lt/cargos/geolocation (select UPLINK, LORA and RADIO)
- This endpoint will save vehicle geolocation in PostgreSQL
- URL: https://deggautcc.loca.lt/lora (select all options except DUPLICATE)
- This endpoint will save all messages in mongoDB, to have a messages history/logs
- Create a device (Device EUI you must set with values that you get previously)
- Set config as OTAA, contador as 2, NS security and class A
- Duplicate .env.example file and rename to .env in backend and frontend folders
- Set API_KEY_MAPBOX with access token that you got in Mapbox
- Create a database in PostgreSQL and set connections data in backend/.env
- Create a database in mongoDB with tcc name
- Create an account/project in Sentry and set SENTRY_DSN property in backend/.env (it is not necessary, used to errors monitoring)
# Repository clone
$ git clone https://github.com/gdeggau/logistical_management_and_monitoring_with_LoRa.git
# Acccess backend folder
$ cd logistical_management_and_monitoring_with_LoRa/backend/
# Dependence install
$ yarn
# Run
$ yarn dev
# Open a new terminal (script responsable to set API public)
$ yarn tunnel
# Acccess frontend folder
$ cd logistical_management_and_monitoring_with_LoRa/frontend/
# Dependence install
$ yarn
# Run
$ yarn start
- Compile and upload the lorawan_example.ino file to the device
Backend | Frontend | Device |
---|---|---|
Node.js | React JS | ESP32 LoRaWAN Heltec |
Express | Styled Components | TinyGPS++ |
Sequelize | Reactstrap | |
Localtunnel (dev) | Redux & Redux-Saga | |
Mapbox | React-map-gl | |
PostgresSQL | Reactotron (dev) | |
mongoDB | Formik | |
JWT | cep-promise | |
Sentry | react-table |