You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+81-1Lines changed: 81 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,15 @@ A lightweight C daemon for Raspberry Pi that reads raw CAN frames from a SocketC
8
8
|**InfluxDB**| Batches samples and uploads to InfluxDB Cloud on a configurable interval |
9
9
|**Serial radio**| Periodically serializes the latest value of every active signal and writes it to a UART radio (e.g. RFD900A) for wireless ground-station reception |
10
10
11
+
The production mobile app reads the InfluxDB sink as long/tag telemetry:
12
+
13
+
```text
14
+
telemetry_snapshot,signal=<name> value=<number>
15
+
```
16
+
17
+
In that contract, the telemetry name comes from the `signal` tag and the
18
+
numeric reading comes from the `value` field.
19
+
11
20
---
12
21
13
22
## Architecture
@@ -59,9 +68,69 @@ flowchart TD
59
68
|-----------|---------|
60
69
| CAN hat | MCP2515 on `can0`, 500 kbps |
61
70
| USB log drive |`ext4` mounted at `/mnt/usb`|
71
+
| RTC module | DS3231 on I2C (`dtoverlay=i2c-rtc,ds3231` in `/boot/firmware/config.txt`) |
62
72
| LTE modem | Quectel EG25-G on `/dev/ttyUSB1–4`; NTP via `systemd-timesyncd` for accurate timestamps |
63
73
| Serial radio | RFD900A on `/dev/ttyUSB0` (Silicon Labs CP2102); 115200 baud, NET\_ID 420 |
64
74
75
+
### Real-time clock (DS3231)
76
+
77
+
Telemetry timestamps come from `CLOCK_REALTIME`. On the driverio Pi, a DS3231 RTC keeps time when the vehicle is offline and seeds the system clock on boot.
78
+
79
+
Timekeeping flow:
80
+
81
+
1.**Boot:** kernel reads `/dev/rtc0` and sets system time.
82
+
2.**Online:**`systemd-timesyncd` syncs system time over NTP (LTE).
83
+
3.**Write-back:** system time is copied to the RTC hourly and on shutdown so the module stays accurate between power cycles.
timedatectl status # expect: System clock synchronized: yes
98
+
sudo hwclock --show --utc # should match date -u within ~1 second
99
+
```
100
+
101
+
If the RTC has never been set (or lost its battery), set system time first, then write it to the hardware clock:
102
+
103
+
```bash
104
+
sudo timedatectl set-time "2026-06-12 14:00:00"
105
+
sudo hwclock --systohc --utc
106
+
```
107
+
108
+
### Internet connectivity (WiFi first, LTE fallback)
109
+
110
+
InfluxDB uploads require internet at boot. The Pi prefers any saved WiFi profile and falls back to the Quectel EG25-G LTE modem when no known network is in range.
Saved WiFi profiles (`nmcli connection show`) are tried automatically. LTE uses APN `fast.t-mobile.com` (Tello/T-Mobile) and can be overridden in `/etc/default/network-connect`.
0 commit comments