Skip to content

Streams IoT sensor data from your LAN to your HTTPS website for display

Notifications You must be signed in to change notification settings

jim3/IoT-Event-Streamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IoT Event Streamer


Overview

An IoT Event Streamer for microcontroller sensor data. This project is a simple example of how to stream sensor data from a microcontroller, via HTTP, to an HTTPS webserver located on the internet. The data is then pushed to a client on the live server via SSE (server-sent events). Uses HTML & JavaScript to display the data.

The project is divided into parts: the C++ firmware for the Photon 2 microcontroller, the MicroPython firmware and the ESP32, two different Node.js servers (local/live) and a simple HTML page with JavaScript to display the sensor data.

Server #1 is ran locally. It's a Node/Express server and takes POST requests from the microcontrollers, processes the sensor data and then makes another POST request to Server #2 located on an HTTPS encrypted webserver.

Server #2 has two endpoints, /sensors and /accelerometer, where it recieves the sensor data. The server code also has a route with an /events endpoint that listens for sensor data and pushes it to the client via SSE where it's displayed.


Usage

Hardware connections

The ADXL362 uses the library by https://github.com/rickkas7/ADXL362DMA in SPI mode. The wonderful thing about this library is that you do not have to know about SPI or SPI programming to use it. The library takes care of all of that for you. The only thing you need to do is connect the ADXL362 to the Particle device as shown in the table below.

Note: Unless you are the type that wants to do SPI programming [see datasheet below], be thankful for the library. :)

adxl362
adxl362 adxl362

Particle Device Breakout Color Description
3V3 VIN Red 3.3V DC Power
GND GND Black Ground
CLK SCL Orange SPI Clock (SCK)
MOSI SDA Blue SPI Master Out
MISO SDO Green SPI Master In
A2 CS Yellow SPI Chip Select
n/c INT2 Interrupt 2 (not used)
n/c INT1 Interrupt 1 (not used)

The BME680 uses the C++ Adafruit BME680 library (for the Particle Photon) via I2C.

adxl362

adxl362


ESP32 Breakout Color Description
3.3V VIN Red 3.3V DC
GND GND Black Ground
D1 SCK Yellow I2C
D0 MOSI Blue I2C

Hardware/Software Used

  • C++ (firmware)
  • Node.js / Express.js
  • HTML/CSS & JavaScript
  • BME680 environmental sensor
  • ADXL362 accelerometer
  • Particle Photon 2 microcontroller

Installation

....


*Note: There is a working demo of the project that illustrates the app at: https://jim3.xyz note: not guaranteed to be up and running at all times

About

Streams IoT sensor data from your LAN to your HTTPS website for display

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published