About this project

This is a remote monitoring web page project for the ESP32-S3 + SIM7670G 4G geofence device. The page is hosted on GitHub Pages and can be opened from a phone on any network (4G/5G/WiFi). Main features include: displaying the device's real-time location on a map (updated every 2 minutes); showing geofence-entry alarm status with a red banner and status light; clicking on the map to draw a geofence polygon and sending it to the device with one click; supporting manual coordinate entry to send a geofence; clearing the geofence; and displaying the satellite count and distance to the geofence. In terms of architecture, the mobile browser accesses the GitHub Pages page, uses fetch to read position.json (written every 2 minutes by GitHub Actions), then pulls data through Bemfa Cloud TCP (bemfa.com:8344) with cmd=3, and finally reaches the ESP32-S3 device over 4G (the device reports coordinates every 30 seconds). The geofence command delivery path is: web page → Bemfa Cloud HTTP sendMessage → device TCP reception → update the geofence and save it to NVS. Deployment requires configuring BEMFA_UID (Bemfa Cloud private key) and BEMFA_TOPIC (topic name geofence001) as GitHub Actions Secrets, while the BEMFA_UID / TOPIC constants at the top of the web page's index.html must match the actual values. For maintenance, location synchronization is handled automatically every 2 minutes by .github/workflows/sync-position.yml, which pulls device coordinates and writes them to position.json. The Sync device position workflow can also be triggered manually from the Actions page.