{"id":19834537,"url":"https://github.com/thingpulse/esp32-gateway-paxcounter","last_synced_at":"2026-06-14T10:31:30.623Z","repository":{"id":145446183,"uuid":"555955895","full_name":"ThingPulse/esp32-gateway-paxcounter","owner":"ThingPulse","description":"PAX Counter project for the ThingPulse ESPGateway Ethernet device","archived":false,"fork":false,"pushed_at":"2022-10-23T09:34:50.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T21:48:57.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThingPulse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-22T18:27:13.000Z","updated_at":"2024-01-02T01:57:40.000Z","dependencies_parsed_at":"2023-07-12T10:00:56.207Z","dependency_job_id":null,"html_url":"https://github.com/ThingPulse/esp32-gateway-paxcounter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThingPulse/esp32-gateway-paxcounter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingPulse%2Fesp32-gateway-paxcounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingPulse%2Fesp32-gateway-paxcounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingPulse%2Fesp32-gateway-paxcounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingPulse%2Fesp32-gateway-paxcounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThingPulse","download_url":"https://codeload.github.com/ThingPulse/esp32-gateway-paxcounter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThingPulse%2Fesp32-gateway-paxcounter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34318523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T12:04:59.969Z","updated_at":"2026-06-14T10:31:30.618Z","avatar_url":"https://github.com/ThingPulse.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Master Build](https://github.com/ThingPulse/esp32-gateway-paxcounter/actions/workflows/main.yaml/badge.svg)\n\n# ThingPulse ESPGateway Ethernet PAX counter\n\nThe ThingPulse ESPGateway Ethernet is a versatile device that comes with one ESP32-WROVER-IB module, \na CH9102F Serial-To-USB chip and the LAN8720 chip for Ethernet communication. The ESP32 can display its\nstatus by controlling four WS2812B RGB Leds at the front of the device. \n\nThe ESPGateway Ethernet is available for purchase at [ThingPulse ESPGateway Ethernet](https://thingpulse.com/product/espgateway-ethernet-esp32-wifi-ble-gateway-with-rj45-ethernet-connector/)\n\n![Gateway](https://thingpulse.com/wp-content/uploads/2021/11/GatewayWithAntenna.jpg)\n\n## The Project\n\nThis project shows how the ESPGateway Ethernet can be used to count WiFi and BLE\ndevices to meter passenger flows in realtime. To count the devices it uses the \nlibpax library which is the core of the \n[ESP32-Paxcounter](https://github.com/cyberman54/ESP32-Paxcounter) project.\n\n![Pax Counter Chart in Grafana](https://thingpulse.com/wp-content/uploads/2021/11/PaxCounter-Grafana.png)\n\nThe measured data can be transmitted for reporting by one of two backhaul channels:\n\n### Ethernet\n\nThe ThingPulse ESPGateway Ethernet has a LAN8720 chip to let the ESP32 communicate\nover an RJ45 ethnernet cable with a 10/100 networking device. The code in this repository\nshows how to publish the measurements over ethernet and MQTT to an MQTT broker. From there\nthe data can be stored and visualized. E.g. by using Node-Red, Influx and Grafana.\n\n### LoRaWAN with WIO-E5\n\nThe ThingPulse ESPGateway Ethernet also features a four pin digital grove connector. By attaching\na [Seeedstudio Grove - Wio-E5 (STM32WLE5JC), for Long Range Application](https://www.seeedstudio.com/Grove-LoRa-E5-STM32WLE5JC-p-4867.html)\nthe gateway can use LoRaWAN as backhaul and transmit the measured data to networks like\n[The Things Network (TTN)](https://www.thethingsnetwork.org/). This project uses a slightly adapted\nversion of the Disk91_LoRaE5 library to communicate over serial lines with the LoRa-E5 module\n\n![Seeedstudio Grove - Wio-E5](https://thingpulse.com/wp-content/uploads/2021/11/WIO-E5.jpeg)\n\nThe PAX counter measurements are transmitted in 6 bytes. The following formatter can be used to decode\nthe bytes into a json structure at the TTN console:\n\n```JavaScript\nfunction decodeUplink(input) {\n  return {\n    data: {\n      pax: (input.bytes[0] \u003c\u003c 8) + input.bytes[1],\n      wifi_count: (input.bytes[2] \u003c\u003c 8) + input.bytes[3],\n      ble_count: (input.bytes[4] \u003c\u003c 8) + input.bytes[5],\n    },\n    warnings: [],\n    errors: []\n  };\n}\n```\n\nThe device also needs to know its deveui, appeui and appkey to connect to a LoRaWAN network.\nThese values can be set in the settings.h file:\n\n```JavaScript\nuint8_t deveui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\nuint8_t appeui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\nuint8_t appkey[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingpulse%2Fesp32-gateway-paxcounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingpulse%2Fesp32-gateway-paxcounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingpulse%2Fesp32-gateway-paxcounter/lists"}