Skip to content

A project to experiment with IoTs, data handling and web apps

License

Notifications You must be signed in to change notification settings

pcolt/iots-full-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 IoTs data full-stack project

A project to experiment with IoTs, data handling and web apps.
The project has also a related tutorial on Medium (wrok in progress).
The project gets an initial inspiration from a job interview I had with the guys of Fybra - Indoor air quality more specifically with their tech lead Davide Violante.

  • ✅ step 1: an Arduino with analog photoresistor converts data to digital, which is sent serially through usb to a Raspberry which (optionally sends the data via MQTT pub/sub protocoll to an other Raspberry who acts as broker who then) sends the data to Influxdata cloud database
  • ✅ step 2: Backend in Node.js that queries the data from InfluxDb and serves it with Express
  • 🏗️ step 3: Frontend with React
  • step 4: migrate backend to Google Cloud Functions
  • step 5: React Native mobile app
  • step 6: change/add sensor to CO2/other
  • step 7: experiment with AI

📚 Working notes

Network

  • Ip local address raspberry pi: 192.168.1.180
  • Ip local address laptop: 192.168.1.65

Connect via ssh ssh pi@[ip-address]

Arduino part

Check README.md in arduino folder

Raspberry part

Check README.md in raspberry folder

Backend part

Check README.md in backend folder

Frontend part

Check README.md in frontend folder

General

VSCode REST Client

HTTP requests to the express endpoints are in requests folder (Installation of VSCode plugin REST Client is required).

VSCode ESlint plugin configuration

Because this repo has multiple sub-repos: in order to have Vscode ESlint plugin working, add to the Vscode settings (File > Preferences > Settings) the parameter:

"eslint.workingDirectories": [
    "./backend", "./frontend
]

MQTT

Mosquitto

Tutorial

  • Install broker (on laptop)
    sudo apt-get install mosquitto
    sudo service mosquitto status
    sudo service mosquitto restart

  • to allow access from other address on port 1883 with no authentication add to file /etc/mosquitto/mosquitto.conf:

listener 1883
allow_anonymous true
  • Install client sudo apt-get install mosquitto-clients
  • subscribe to a topic (from laptop) mosquitto_sub -h localhost -t "my_topic"
  • pubblish to a topic (from Raspberry) mosquitto_pub -h 192.168.1.65 -t "my_topic" -m "hello world"

INFLUXDB

InfluxDB Cloud Serverless

Influx CLI
  • Install influx CLI Docs
  • Configure connection influx config create --host-url CLUSTER_URL --org pcolt --token INFLUX_DATA_TOKEN --active --config-name sensors1
  • Write data Docs influx write --bucket sensors1 -p s "home2,location=studio light=600 1708502477"
UI
  • query all data from one table Docs SELECT * from home2;
  • query all tables in bucket SHOW TABLES;

About

A project to experiment with IoTs, data handling and web apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published