Skip to content

Commit 11792d4

Browse files
author
Ravi Singh
committed
docs: update README with MQTTS, CI/CD, security, and cloud architecture
1 parent 79d4894 commit 11792d4

1 file changed

Lines changed: 38 additions & 14 deletions

File tree

README.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# TankSync - LoRa Water Tank Monitor
22

33
[![License: MIT](https://img.shields.io/badge/Firmware-MIT-green.svg)](LICENSE)
4-
[![License: AGPL-3.0](https://img.shields.io/badge/PWA-AGPL--3.0-blue.svg)](pwa/LICENSE)
4+
[![License: AGPL-3.0](https://img.shields.io/badge/Cloud-AGPL--3.0-blue.svg)](pwa/LICENSE)
55
[![ESP-IDF](https://img.shields.io/badge/ESP--IDF-v5.4-red.svg)](https://docs.espressif.com/projects/esp-idf/)
66
[![GitHub Release](https://img.shields.io/github/v/release/Techposts/LoRa-Water-Tank-Monitor)](https://github.com/Techposts/LoRa-Water-Tank-Monitor/releases)
77
[![GitHub Stars](https://img.shields.io/github/stars/Techposts/LoRa-Water-Tank-Monitor)](https://github.com/Techposts/LoRa-Water-Tank-Monitor/stargazers)
88

9-
Long-range wireless water tank level monitoring using LoRa (RYLR998), ESP32, and an optional cloud dashboard. Monitor multiple tanks from up to 5km away with no WiFi needed between sensor and receiver.
9+
Long-range wireless water tank level monitoring using LoRa (RYLR998), ESP32, and a cloud dashboard. Monitor multiple tanks from up to 5km away with no WiFi needed between sensor and receiver.
1010

1111
<p align="center">
1212
<img src="docs/images/receiver.jpg" width="45%" alt="Receiver" />
@@ -27,12 +27,12 @@ Long-range wireless water tank level monitoring using LoRa (RYLR998), ESP32, and
2727
|
2828
+-----------+-----------+
2929
| |
30-
MQTT/WiFi Web UI
30+
MQTT over TLS Web UI
3131
| 192.168.x.x
3232
+---------+---------+
3333
| |
3434
Home Assistant TankSync Cloud
35-
(auto-discovery) (web dashboard)
35+
(auto-discovery) tanksync.smartghar.org
3636
```
3737

3838
## Features
@@ -43,10 +43,13 @@ Long-range wireless water tank level monitoring using LoRa (RYLR998), ESP32, and
4343
- **Local Display**: SH1106 1.3" OLED on receiver shows tank levels, battery, signal
4444
- **Web UI**: Built-in configuration interface on the receiver (WiFi, MQTT, LoRa, OTA)
4545
- **Home Assistant**: Native MQTT auto-discovery integration
46-
- **TankSync Cloud**: Web dashboard with push notifications, multi-site monitoring, QR device linking
46+
- **TankSync Cloud**: Web dashboard with push notifications, multi-tank monitoring, QR device linking
47+
- **MQTT over TLS**: Secure communication between receiver and cloud (port 8883)
4748
- **OTA Updates**: WiFi OTA for receiver, LoRa OTA relay for transmitter
4849
- **Captive Portal**: Auto-redirect WiFi setup on iOS, Android, and Windows
4950
- **Remote Config**: Push sleep interval and sample count to transmitters over LoRa
51+
- **Email Verification**: Resend API + Cloudflare Turnstile on signup
52+
- **Auto MQTT Provisioning**: QR code scan auto-configures receiver's cloud MQTT connection
5053

5154
## Hardware
5255

@@ -71,13 +74,13 @@ Download the latest `.bin` files from [Releases](https://github.com/Techposts/Lo
7174

7275
```bash
7376
# Receiver (ESP32 DevKit)
74-
esptool.py --chip esp32 -b 460800 write_flash 0x10000 tanksync-receiver-v2.1.0.bin
77+
esptool.py --chip esp32 -b 460800 write_flash 0x10000 tanksync-receiver-vX.Y.Z.bin
7578

7679
# Receiver (ESP32-C3 SuperMini)
77-
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-receiver-c3-v2.1.0.bin
80+
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-receiver-c3-vX.Y.Z.bin
7881

7982
# Transmitter (ESP32-C3)
80-
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-transmitter-v2.1.0.bin
83+
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-transmitter-vX.Y.Z.bin
8184
```
8285

8386
### Option 2: Build from Source
@@ -114,18 +117,18 @@ idf.py -p /dev/ttyACM0 flash
114117

115118
A web dashboard for monitoring your tanks from anywhere. Use the hosted version or self-host your own.
116119

117-
**Hosted:** [tanksync.smartghar.org](https://tanksync.smartghar.org) -- scan the QR code from your receiver's web UI to link your device.
120+
**Hosted:** [tanksync.smartghar.org](https://tanksync.smartghar.org) -- sign up, scan the QR code from your receiver's web UI, and your tank data flows to the cloud automatically.
118121

119122
**Self-host:**
120123
```bash
121124
cd pwa
122125
npm install
123-
cp .env.example .env # Edit with your MQTT broker details
126+
cp .env.example .env # Edit with your MQTT broker and API keys
124127
npm run build
125128
npm start # Runs on http://localhost:4800
126129
```
127130

128-
Features: multi-site management, push notifications, QR code device linking, dark/light themes, historical charts.
131+
Features: multi-tank monitoring, push notifications, QR code device linking, email verification, dark/light themes, historical charts.
129132

130133
See [pwa/deploy/](pwa/deploy/) for production deployment with systemd and Nginx.
131134

@@ -144,13 +147,23 @@ firmware/
144147
receiver/ ESP32 DevKit receiver (MIT)
145148
receiver-c3/ ESP32-C3 receiver variant (MIT)
146149
transmitter/ ESP32-C3 transmitter (MIT)
147-
pwa/ TankSync Cloud dashboard (AGPL-3.0)
148-
server/ Fastify + SQLite + MQTT bridge
150+
pwa/
151+
server/ Fastify + SQLite server (self-host) (AGPL-3.0)
152+
server-cloud/ Fastify + PostgreSQL server (cloud deploy) (AGPL-3.0)
149153
client/ React + Tailwind frontend
154+
deploy/ Systemd, Nginx, and deploy scripts
150155
hardware/ BOM and hardware designs (CC BY-SA 4.0)
151156
docs/ Documentation and images
157+
.github/workflows/
158+
build-firmware.yml Automated firmware builds on tag push
159+
deploy-cloud.yml CI/CD deploy to DigitalOcean on push
152160
```
153161

162+
## CI/CD
163+
164+
- **Firmware**: Push a version tag (`git tag v2.2.0 && git push origin v2.2.0`) to auto-build all 3 firmware binaries and create a GitHub Release
165+
- **Cloud**: Push changes to `pwa/` on main to auto-deploy to the production server via SSH
166+
154167
## LoRa Message Protocol
155168

156169
```
@@ -160,12 +173,23 @@ Config Downlink: SET:SLEEP=<seconds>:SAMP=<count>
160173
Pairing: PAIR_REQ / PAIR_ACK:<addr>:<name>
161174
```
162175

176+
## Security
177+
178+
- MQTT over TLS (Let's Encrypt certificates, auto-renewing)
179+
- Per-user MQTT credentials with topic-level ACL
180+
- Cloudflare Turnstile captcha on signup
181+
- Email verification via Resend API
182+
- Rate limiting on auth endpoints (5 register/min, 10 login/min)
183+
- JWT tokens with 30-day expiry
184+
- Security headers (X-Frame-Options, CSP, HSTS via Cloudflare)
185+
- UFW firewall, fail2ban, SSH key-only deploy
186+
163187
## License
164188

165189
| Component | License | Details |
166190
|-----------|---------|---------|
167191
| Firmware (`firmware/`) | [MIT](LICENSE) | Free for any use |
168-
| Web App (`pwa/`) | [AGPL-3.0](pwa/LICENSE) | Must share source if hosted as a service |
192+
| Cloud App (`pwa/`) | [AGPL-3.0](pwa/LICENSE) | Must share source if hosted as a service |
169193
| Hardware (`hardware/`) | [CC BY-SA 4.0](hardware/LICENSE) | Attribution + ShareAlike |
170194

171195
## Contributing

0 commit comments

Comments
 (0)