Giter Site home page Giter Site logo

pcolt / iots-full-stack Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 281 KB

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

License: GNU General Public License v3.0

C++ 8.47% Python 29.14% TypeScript 38.88% JavaScript 3.99% HTML 3.35% CSS 16.17%

iots-full-stack's Introduction

๐Ÿงฎ 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;

iots-full-stack's People

Contributors

pcolt 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.