Coder Social home page Coder Social logo

esp32-gateway-paxcounter's Introduction

Master Build

ThingPulse ESPGateway Ethernet PAX counter

The ThingPulse ESPGateway Ethernet is a versatile device that comes with one ESP32-WROVER-IB module, a CH9102F Serial-To-USB chip and the LAN8720 chip for Ethernet communication. The ESP32 can display its status by controlling four WS2812B RGB Leds at the front of the device.

The ESPGateway Ethernet is available for purchase at ThingPulse ESPGateway Ethernet

Gateway

The Project

This project shows how the ESPGateway Ethernet can be used to count WiFi and BLE devices to meter passenger flows in realtime. To count the devices it uses the libpax library which is the core of the ESP32-Paxcounter project.

Pax Counter Chart in Grafana

The measured data can be transmitted for reporting by one of two backhaul channels:

Ethernet

The ThingPulse ESPGateway Ethernet has a LAN8720 chip to let the ESP32 communicate over an RJ45 ethnernet cable with a 10/100 networking device. The code in this repository shows how to publish the measurements over ethernet and MQTT to an MQTT broker. From there the data can be stored and visualized. E.g. by using Node-Red, Influx and Grafana.

LoRaWAN with WIO-E5

The ThingPulse ESPGateway Ethernet also features a four pin digital grove connector. By attaching a Seeedstudio Grove - Wio-E5 (STM32WLE5JC), for Long Range Application the gateway can use LoRaWAN as backhaul and transmit the measured data to networks like The Things Network (TTN). This project uses a slightly adapted version of the Disk91_LoRaE5 library to communicate over serial lines with the LoRa-E5 module

Seeedstudio Grove - Wio-E5

The PAX counter measurements are transmitted in 6 bytes. The following formatter can be used to decode the bytes into a json structure at the TTN console:

function decodeUplink(input) {
  return {
    data: {
      pax: (input.bytes[0] << 8) + input.bytes[1],
      wifi_count: (input.bytes[2] << 8) + input.bytes[3],
      ble_count: (input.bytes[4] << 8) + input.bytes[5],
    },
    warnings: [],
    errors: []
  };
}

The device also needs to know its deveui, appeui and appkey to connect to a LoRaWAN network. These values can be set in the settings.h file:

uint8_t deveui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t appeui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t appkey[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

esp32-gateway-paxcounter's People

Contributors

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