i think we're basically done

This commit is contained in:
Thaddeus Hughes
2026-04-27 17:22:34 -05:00
parent 9f4362b5fd
commit f47a29205e
35 changed files with 14893 additions and 1687 deletions

9871
BRINGUP_27APR2026_1315.txt Normal file

File diff suppressed because it is too large Load Diff

839
BRINGUP_27APR2026_1329.txt Normal file
View File

@@ -0,0 +1,839 @@
13:29:29.980
------------------------------------------------------------
Flashing COM3
------------------------------------------------------------
13:29:29.981 erase_flash @ COM3
13:29:33.264 flashing from D:\SC\SC-F001\build
13:29:33.265 files: [('0x1000', 'bootloader/bootloader.bin'), ('0x10000', 'SC-F001.bin'), ('0x8000', 'partition_table/partition-table.bin'), ('0xd000', 'ota_data_initial.bin')]
13:29:58.139 Flash complete
13:29:59.640 Connecting to COM3 @ 115200 ...
13:29:59.645 -> BU.BEGIN
13:29:59.892 <- BU.BEGIN
13:29:59.892 <-
13:29:59.892 <- BU.OK begin fw=9f4362b-dirty board=V5 t=0.00
13:29:59.893 -> BU.INFO
13:29:59.893 <- E rmt: hw buffer too small, received symbols truncated
13:29:59.905 <- I (1741) SENS: EVENT 2
13:29:59.905 <- I (1741) SENS: FALLING
13:29:59.905 <- I (1741) SENS: SAFETY BREAK - Relays disabled
13:29:59.912 <- I (1861) BT_HID: Scanning for HID devices (3s)...
13:29:59.912 <- I (1861) BT_HID: BLE HID host initialised
13:29:59.912 <- I (1861) WEBSERVER: Initializing webserver...
13:29:59.912 <- I (1861) WEBSERVER: AP LAUNCHING
13:29:59.933 <- I (1881) wifi:wifi driver task: 3ffe2838, prio:23, stack:6656, core=0
13:29:59.933 <- BU.OK info reset=POWERON heap=118600 min_heap=118512 fw=9f4362b-dirty build=2026-04-27 18:28:59
13:30:29.734 -> BU.FLASH
13:30:29.735 <- I (1881) wifi:wifi firmware version: ccaebfa
13:30:29.735 <- I (1881) wifi:wifi certification version: v7.0
13:30:29.735 <- I (1891) wifi:config NVS flash: enabled
13:30:29.735 <- I (1891) wifi:config nano formating: disabled
13:30:29.735 <- I (1901) wifi:Init data frame dynamic rx buffer num: 32
13:30:29.735 <- I (1901) wifi:Init static rx mgmt buffer num: 5
13:30:29.735 <- I (1901) wifi:Init management short buffer num: 32
13:30:29.735 <- I (1911) wifi:Init dynamic tx buffer num: 32
13:30:29.736 <- I (1911) wifi:Init static rx buffer size: 1600
13:30:29.736 <- I (1921) wifi:Init static rx buffer num: 10
13:30:29.736 <- I (1921) wifi:Init dynamic rx buffer num: 32
13:30:29.736 <- I (1931) wifi_init: rx ba win: 6
13:30:29.736 <- I (1931) wifi_init: accept mbox: 6
13:30:29.737 <- I (1931) wifi_init: tcpip mbox: 32
13:30:29.737 <- I (1941) wifi_init: udp mbox: 6
13:30:29.737 <- I (1941) wifi_init: tcp mbox: 6
13:30:29.737 <- I (1941) wifi_init: tcp tx win: 5760
13:30:29.737 <- I (1951) wifi_init: tcp rx win: 5760
13:30:29.737 <- I (1951) wifi_init: tcp mss: 1440
13:30:29.738 <- I (2241) wifi:mode : softAP (80:f3:da:65:45:4d)
13:30:29.738 <- I (2251) wifi:Total power save buffer number: 16
13:30:29.738 <- I (2251) wifi:Init max length of beacon: 752/752
13:30:29.738 <- I (2251) wifi:Init max length of beacon: 752/752
13:30:29.739 <- I (2251) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
13:30:29.739 <- I (2261) DNS_SERVER: DNS server started on port 53
13:30:29.739 <- I (2271) mdns_mem: mDNS task will be created from internal RAM
13:30:29.739 <- I (2271) WEBSERVER: SoftAP ready. SSID: sc.local, Channel: 6, Password: password
13:30:29.739 <- I (2281) WEBSERVER: Access at: http://sc.local.local or http://192.168.4.1
13:30:29.739 <- I (2281) WEBSERVER: STARTING HTTP
13:30:29.739 <- I (2291) WEBSERVER: HTTP server started successfully
13:30:29.740 <- I (2291) WEBSERVER: Registered URI handler: /
13:30:29.740 <- I (2301) WEBSERVER: Registered URI handler: /get
13:30:29.740 <- I (2301) WEBSERVER: Registered URI handler: /post
13:30:29.740 <- I (2311) WEBSERVER: Registered URI handler: /log
13:30:29.740 <- I (2321) WEBSERVER: Registered URI handler: /ota
13:30:29.741 <- I (2321) WEBSERVER: Registered URI handler: /*
13:30:29.741 <- I (2331) WEBSERVER: Webserver initialization complete
13:30:29.741 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.741 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.741 <- I (4871) BT_HID: Found 0 HID device(s)
13:30:29.741 <- I (4871) BT_HID: No HID devices found, retrying in 2000ms...
13:30:29.742 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.742 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.742 <- I (6871) BT_HID: Scanning for HID devices (3s)...
13:30:29.742 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.742 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.742 <- I (9881) BT_HID: Found 0 HID device(s)
13:30:29.743 <- I (9881) BT_HID: No HID devices found, retrying in 2000ms...
13:30:29.743 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.743 <- I (11881) BT_HID: Scanning for HID devices (3s)...
13:30:29.743 <- I (14891) BT_HID: Found 0 HID device(s)
13:30:29.743 <- I (14891) BT_HID: No HID devices found, retrying in 2000ms...
13:30:29.744 <- I (16891) BT_HID: Scanning for HID devices (3s)...
13:30:29.744 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.744 <- I (19901) BT_HID: Found 0 HID device(s)
13:30:29.744 <- I (19901) BT_HID: No HID devices found, retrying in 2000ms...
13:30:29.744 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.744 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.744 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.744 <- I (21901) BT_HID: Scanning for HID devices (3s)...
13:30:29.745 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.745 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.745 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.745 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.745 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.746 <- I (24911) BT_HID: Found 0 HID device(s)
13:30:29.746 <- I (24911) BT_HID: No HID devices found, retrying in 2000ms...
13:30:29.746 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.746 <- I (26911) BT_HID: Scanning for HID devices (3s)...
13:30:29.746 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.746 <- E rmt: hw buffer too small, received symbols truncated
13:30:29.746 <- I (29921) BT_HID: Found 0 HID device(s)
13:30:29.746 <- I (29921) BT_HID: No HID devices found, retrying in 2000ms...
13:30:30.261 <- E rmt: hw buffer too small, received symbols truncated
13:30:30.261 <- BU.OK flash post_part=roundtrip log_head=11 log_tail=0 partitions_size=4128768
13:30:31.875 -> BU.I2C
13:30:31.875 <- I (31921) BT_HID: Scanning for HID devices (3s)...
13:30:31.911 <- E rmt: hw buffer too small, received symbols truncated
13:30:31.911 <- E rmt: hw buffer too small, received symbols truncated
13:30:31.911 <- E rmt: hw buffer too small, received symbols truncated
13:30:31.911 <- I (33871) I2C: POST: TCA9555 OK (port0=0x0021)
13:30:31.911 <- BU.OK i2c tca9555=ack
13:30:31.913 -> BU.LED.WATCH
13:30:32.414 <- E rmt: hw buffer too small, received symbols truncated
13:30:32.414 <- BU.EVENT led t=32.26 pressed=0
13:30:32.414 <- E rmt: hw buffer too small, received symbols truncated
13:30:33.423 <- I (34931) BT_HID: Found 0 HID device(s)
13:30:33.423 <- I (34931) BT_HID: No HID devices found, retrying in 2000ms...
13:30:33.423 <- E rmt: hw buffer too small, received symbols truncated
13:30:33.423 <- E rmt: hw buffer too small, received symbols truncated
13:30:34.940 <- BU.EVENT led t=35.16 pressed=1
13:30:35.447 <- I (36931) BT_HID: Scanning for HID devices (3s)...
13:30:36.455 <- BU.EVENT led t=36.28 pressed=0
13:30:38.470 <- E rmt: hw buffer too small, received symbols truncated
13:30:38.470 <- I (39941) BT_HID: Found 0 HID device(s)
13:30:38.470 <- I (39941) BT_HID: No HID devices found, retrying in 2000ms...
13:30:38.830 ->
13:30:38.979 <- BU.OK led.watch done
13:30:43.094 -> BU.ADC
13:30:43.095 <- E rmt: hw buffer too small, received symbols truncated
13:30:43.095 <- I (41941) BT_HID: Scanning for HID devices (3s)...
13:30:43.095 <- E rmt: hw buffer too small, received symbols truncated
13:30:43.095 <- E rmt: hw buffer too small, received symbols truncated
13:30:43.608 <- I (44951) BT_HID: Found 0 HID device(s)
13:30:43.608 <- I (44951) BT_HID: No HID devices found, retrying in 2000ms...
13:30:43.608 <- BU.OK adc bat_mv=1678 bat_V=13.383 isens_mv=1664 isens_A=-1.06
13:30:57.100 -> BU.PARAM GET V_SENS_K
13:30:57.101 <- I (46951) BT_HID: Scanning for HID devices (3s)...
13:30:57.101 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.101 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.101 <- I (49961) BT_HID: Found 0 HID device(s)
13:30:57.102 <- I (49961) BT_HID: No HID devices found, retrying in 2000ms...
13:30:57.102 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.102 <- I (51961) BT_HID: Scanning for HID devices (3s)...
13:30:57.102 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.102 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.102 <- I (54971) BT_HID: Found 0 HID device(s)
13:30:57.102 <- I (54971) BT_HID: No HID devices found, retrying in 2000ms...
13:30:57.102 <- I (56971) BT_HID: Scanning for HID devices (3s)...
13:30:57.615 <- E rmt: hw buffer too small, received symbols truncated
13:30:57.615 <- BU.OK param key=V_SENS_K value=0.00766666653
13:30:57.615 -> BU.ADC
13:30:58.119 <- BU.OK adc bat_mv=1686 bat_V=13.383 isens_mv=1664 isens_A=-1.06
13:31:05.442 -> BU.PARAM SET V_SENS_OFFSET 0.074000
13:31:05.442 <- E rmt: hw buffer too small, received symbols truncated
13:31:05.442 <- I (59981) BT_HID: Found 0 HID device(s)
13:31:05.442 <- I (59981) BT_HID: No HID devices found, retrying in 2000ms...
13:31:05.443 <- E rmt: hw buffer too small, received symbols truncated
13:31:05.443 <- I (61981) BT_HID: Scanning for HID devices (3s)...
13:31:05.443 <- I (64991) BT_HID: Found 0 HID device(s)
13:31:05.443 <- I (64991) BT_HID: No HID devices found, retrying in 2000ms...
13:31:05.510 <- I (66991) BT_HID: Scanning for HID devices (3s)...
13:31:05.510 <- I (67441) STORAGE: Parameter 34 (V_SENS_OFFSET) set (not committed)
13:31:05.510 <- I (67441) STORAGE: Committing 49 parameters to flash...
13:31:06.011 <- I (67471) STORAGE: Successfully committed all parameters to flash
13:31:06.011 <- BU.OK param key=V_SENS_OFFSET set=ok committed=yes
13:31:06.011 -> BU.ADC
13:31:06.517 <- BU.OK adc bat_mv=1687 bat_V=13.383 isens_mv=1669 isens_A=-1.44
13:31:06.522 -> BU.SENSORS.WATCH 0
13:31:06.522 <- E rmt: hw buffer too small, received symbols truncated
13:31:06.522 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.037 <- BU.EVENT state t=66.87 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:07.037 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.037 <- BU.EVENT state t=67.13 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:07.290 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.290 <- BU.EVENT state t=67.38 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:07.290 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.290 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.740 <- E rmt: hw buffer too small, received symbols truncated
13:31:07.740 <- BU.EVENT state t=67.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:07.740 <- BU.EVENT state t=67.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:08.061 <- E rmt: hw buffer too small, received symbols truncated
13:31:08.061 <- BU.EVENT state t=68.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:08.061 <- I (70001) BT_HID: Found 0 HID device(s)
13:31:08.061 <- I (70001) BT_HID: No HID devices found, retrying in 2000ms...
13:31:08.561 <- BU.EVENT state t=68.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:08.561 <- BU.EVENT state t=68.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:08.561 <- E rmt: hw buffer too small, received symbols truncated
13:31:09.071 <- BU.EVENT state t=68.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:09.071 <- BU.EVENT state t=69.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:09.071 <- BU.EVENT state t=69.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:09.575 <- BU.EVENT state t=69.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:09.575 <- E rmt: hw buffer too small, received symbols truncated
13:31:09.575 <- BU.EVENT state t=69.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:10.078 <- BU.EVENT state t=70.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:10.078 <- I (72001) BT_HID: Scanning for HID devices (3s)...
13:31:10.078 <- BU.EVENT state t=70.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:10.581 <- BU.EVENT state t=70.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:10.581 <- E rmt: hw buffer too small, received symbols truncated
13:31:10.581 <- BU.EVENT state t=70.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:11.084 <- BU.EVENT state t=71.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:11.084 <- BU.EVENT state t=71.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:11.562 <- E rmt: hw buffer too small, received symbols truncated
13:31:11.562 <- BU.EVENT state t=71.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:11.562 <- E rmt: hw buffer too small, received symbols truncated
13:31:12.077 <- BU.EVENT state t=71.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:12.077 <- BU.EVENT state t=72.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:12.077 <- BU.EVENT state t=72.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:12.580 <- BU.EVENT state t=72.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:12.580 <- BU.EVENT state t=72.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:13.062 <- BU.EVENT state t=73.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:13.062 <- I (75011) BT_HID: Found 0 HID device(s)
13:31:13.062 <- I (75011) BT_HID: No HID devices found, retrying in 2000ms...
13:31:13.564 <- BU.EVENT state t=73.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:13.564 <- BU.EVENT state t=73.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:13.564 <- E rmt: hw buffer too small, received symbols truncated
13:31:14.077 <- BU.EVENT state t=73.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:14.077 <- BU.EVENT state t=74.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:14.077 <- BU.EVENT state t=74.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:14.583 <- E rmt: hw buffer too small, received symbols truncated
13:31:14.583 <- BU.EVENT state t=74.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:14.583 <- BU.EVENT state t=74.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:15.061 <- E rmt: hw buffer too small, received symbols truncated
13:31:15.061 <- BU.EVENT state t=75.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:15.062 <- I (77011) BT_HID: Scanning for HID devices (3s)...
13:31:15.564 <- BU.EVENT state t=75.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:15.564 <- BU.EVENT state t=75.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:15.564 <- BU.EVENT state t=75.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:16.068 <- BU.EVENT state t=76.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:16.068 <- BU.EVENT state t=76.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:16.576 <- E rmt: hw buffer too small, received symbols truncated
13:31:16.576 <- BU.EVENT state t=76.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:16.576 <- BU.EVENT state t=76.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:17.091 <- BU.EVENT state t=77.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:17.091 <- E rmt: hw buffer too small, received symbols truncated
13:31:17.091 <- BU.EVENT state t=77.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:17.592 <- BU.EVENT state t=77.64 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:17.592 <- E rmt: hw buffer too small, received symbols truncated
13:31:17.592 <- BU.EVENT state t=77.89 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:18.058 <- BU.EVENT state t=78.14 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:18.058 <- E rmt: hw buffer too small, received symbols truncated
13:31:18.058 <- I (80021) BT_HID: Found 0 HID device(s)
13:31:18.572 <- I (80021) BT_HID: No HID devices found, retrying in 2000ms...
13:31:18.572 <- BU.EVENT state t=78.39 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:18.572 <- BU.EVENT state t=78.65 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:19.086 <- BU.EVENT state t=78.90 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:19.086 <- BU.EVENT state t=79.15 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:19.086 <- E rmt: hw buffer too small, received symbols truncated
13:31:19.086 <- BU.EVENT state t=79.40 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:19.589 <- BU.EVENT state t=79.65 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:19.589 <- BU.EVENT state t=79.90 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:20.092 <- BU.EVENT state t=80.15 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:20.092 <- I (82021) BT_HID: Scanning for HID devices (3s)...
13:31:20.092 <- BU.EVENT state t=80.40 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:20.573 <- E rmt: hw buffer too small, received symbols truncated
13:31:20.573 <- E rmt: hw buffer too small, received symbols truncated
13:31:20.573 <- BU.EVENT state t=80.65 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:21.074 <- BU.EVENT state t=80.90 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:21.074 <- BU.EVENT state t=81.15 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:21.074 <- E rmt: hw buffer too small, received symbols truncated
13:31:21.074 <- BU.EVENT state t=81.40 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:21.579 <- BU.EVENT state t=81.65 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:21.579 <- BU.EVENT state t=81.90 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:22.083 <- BU.EVENT state t=82.15 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:22.590 <- BU.EVENT state t=82.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:22.590 <- BU.EVENT state t=82.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:22.590 <- BU.EVENT state t=82.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:23.069 <- E rmt: hw buffer too small, received symbols truncated
13:31:23.069 <- BU.EVENT state t=83.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:23.069 <- I (85031) BT_HID: Found 0 HID device(s)
13:31:23.583 <- I (85031) BT_HID: No HID devices found, retrying in 2000ms...
13:31:23.583 <- BU.EVENT state t=83.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:23.583 <- BU.EVENT state t=83.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:24.090 <- BU.EVENT state t=83.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:24.090 <- E rmt: hw buffer too small, received symbols truncated
13:31:24.090 <- BU.EVENT state t=84.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:24.090 <- BU.EVENT state t=84.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:24.583 <- BU.EVENT state t=84.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:24.584 <- E rmt: hw buffer too small, received symbols truncated
13:31:24.584 <- E rmt: hw buffer too small, received symbols truncated
13:31:25.081 <- BU.EVENT state t=84.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:25.081 <- BU.EVENT state t=85.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:25.081 <- E rmt: hw buffer too small, received symbols truncated
13:31:25.081 <- I (87031) BT_HID: Scanning for HID devices (3s)...
13:31:25.587 <- BU.EVENT state t=85.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:25.587 <- BU.EVENT state t=85.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:25.587 <- BU.EVENT state t=85.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:26.091 <- BU.EVENT state t=86.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:26.091 <- BU.EVENT state t=86.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:26.594 <- BU.EVENT state t=86.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:26.594 <- BU.EVENT state t=86.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:27.097 <- BU.EVENT state t=87.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:27.097 <- BU.EVENT state t=87.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:27.601 <- BU.EVENT state t=87.66 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:27.601 <- BU.EVENT state t=87.91 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:28.077 <- E rmt: hw buffer too small, received symbols truncated
13:31:28.077 <- BU.EVENT state t=88.16 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:28.077 <- I (90041) BT_HID: Found 0 HID device(s)
13:31:28.580 <- I (90041) BT_HID: No HID devices found, retrying in 2000ms...
13:31:28.580 <- BU.EVENT state t=88.41 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:28.580 <- BU.EVENT state t=88.67 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:29.084 <- BU.EVENT state t=88.92 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:29.084 <- BU.EVENT state t=89.17 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:29.590 <- BU.EVENT state t=89.42 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:29.590 <- BU.EVENT state t=89.67 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:30.091 <- BU.EVENT state t=89.92 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:30.091 <- BU.EVENT state t=90.17 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:30.091 <- I (92041) BT_HID: Scanning for HID devices (3s)...
13:31:30.593 <- BU.EVENT state t=90.42 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:30.593 <- BU.EVENT state t=90.67 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.095 <- BU.EVENT state t=90.92 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.095 <- E rmt: hw buffer too small, received symbols truncated
13:31:31.095 <- BU.EVENT state t=91.17 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.095 <- BU.EVENT state t=91.42 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.600 <- BU.EVENT state t=91.67 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.600 <- BU.EVENT state t=91.92 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:31:31.733 ->
13:31:32.105 <- BU.OK sensors.watch sec=-1 SAFETY=none DRIVE=none JACK=none AUX=none
13:31:40.108 -> BU.RELAY SENSORS ON 200
13:31:40.109 <- E rmt: hw buffer too small, received symbols truncated
13:31:40.109 <- E rmt: hw buffer too small, received symbols truncated
13:31:40.109 <- I (95051) BT_HID: Found 0 HID device(s)
13:31:40.109 <- I (95051) BT_HID: No HID devices found, retrying in 2000ms...
13:31:40.110 <- E rmt: hw buffer too small, received symbols truncated
13:31:40.110 <- I (97051) BT_HID: Scanning for HID devices (3s)...
13:31:40.110 <- E rmt: hw buffer too small, received symbols truncated
13:31:40.110 <- I (100061) BT_HID: Found 0 HID device(s)
13:31:40.612 <- I (100061) BT_HID: No HID devices found, retrying in 2000ms...
13:31:40.612 <- E rmt: hw buffer too small, received symbols truncated
13:31:40.612 <- I (102061) BT_HID: Scanning for HID devices (3s)...
13:31:40.612 <- BU.OK relay bridge=SENSORS ms=200
13:31:45.502 -> BU.RELAY DRIVE FWD 3000
13:31:45.502 <- E rmt: hw buffer too small, received symbols truncated
13:31:45.503 <- E rmt: hw buffer too small, received symbols truncated
13:31:45.503 <- E rmt: hw buffer too small, received symbols truncated
13:31:45.503 <- I (105071) BT_HID: Found 0 HID device(s)
13:31:45.503 <- I (105071) BT_HID: No HID devices found, retrying in 2000ms...
13:31:45.781 <- E rmt: hw buffer too small, received symbols truncated
13:31:45.781 <- I (107071) BT_HID: Scanning for HID devices (3s)...
13:31:45.781 <- E rmt: hw buffer too small, received symbols truncated
13:31:45.781 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.283 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.283 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.283 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.283 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.789 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.789 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.789 <- E rmt: hw buffer too small, received symbols truncated
13:31:46.789 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.292 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.292 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.292 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.795 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.795 <- E rmt: hw buffer too small, received symbols truncated
13:31:47.795 <- BU.OK relay bridge=DRIVE dir=FWD ms=2000 I_before=+0.00 I_mid=+17.88 I_after=-0.02 heat=0.004 tripped=0 edges=34
13:31:52.597 -> BU.RELAY DRIVE REV 3000
13:31:52.598 <- I (110081) BT_HID: Found 0 HID device(s)
13:31:52.598 <- I (110081) BT_HID: No HID devices found, retrying in 2000ms...
13:31:52.598 <- E rmt: hw buffer too small, received symbols truncated
13:31:52.598 <- I (112081) BT_HID: Scanning for HID devices (3s)...
13:31:53.026 <- E rmt: hw buffer too small, received symbols truncated
13:31:53.027 <- E rmt: hw buffer too small, received symbols truncated
13:31:53.027 <- E rmt: hw buffer too small, received symbols truncated
13:31:53.027 <- E rmt: hw buffer too small, received symbols truncated
13:31:53.537 <- E rmt: hw buffer too small, received symbols truncated
13:31:53.537 <- I (115091) BT_HID: Found 0 HID device(s)
13:31:53.537 <- I (115091) BT_HID: No HID devices found, retrying in 2000ms...
13:31:53.537 <- E rmt: hw buffer too small, received symbols truncated
13:31:54.041 <- E rmt: hw buffer too small, received symbols truncated
13:31:54.545 <- E rmt: hw buffer too small, received symbols truncated
13:31:55.051 <- BU.OK relay bridge=DRIVE dir=REV ms=2000 I_before=-0.03 I_mid=+21.33 I_after=-0.03 heat=0.010 tripped=0 edges=34
13:31:56.716 -> BU.RELAY JACK UP 1200
13:31:57.220 <- I (117091) BT_HID: Scanning for HID devices (3s)...
13:31:58.137 <- BU.OK relay bridge=JACK dir=UP ms=1200 I_before=+0.00 I_mid=+1.21 I_after=-0.00 heat=0.000 tripped=0 edges=0
13:38:40.740 -> BU.RELAY JACK DOWN 1200
13:38:40.741 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.741 <- I (120101) BT_HID: Found 0 HID device(s)
13:38:40.741 <- I (120101) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.741 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.741 <- I (122101) BT_HID: Scanning for HID devices (3s)...
13:38:40.741 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.742 <- I (125111) BT_HID: Found 0 HID device(s)
13:38:40.742 <- I (125111) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.742 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.742 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.742 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.743 <- I (127111) BT_HID: Scanning for HID devices (3s)...
13:38:40.743 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.743 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.743 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.743 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.744 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.744 <- I (130121) BT_HID: Found 0 HID device(s)
13:38:40.744 <- I (130121) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.744 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.744 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.744 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.744 <- I (132121) BT_HID: Scanning for HID devices (3s)...
13:38:40.744 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.745 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.745 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.745 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.745 <- I (135131) BT_HID: Found 0 HID device(s)
13:38:40.746 <- I (135131) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.746 <- I (137131) BT_HID: Scanning for HID devices (3s)...
13:38:40.746 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.746 <- I (140141) BT_HID: Found 0 HID device(s)
13:38:40.746 <- I (140141) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.746 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.746 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.746 <- I (142141) BT_HID: Scanning for HID devices (3s)...
13:38:40.746 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.747 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.747 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.747 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.747 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.748 <- I (145151) BT_HID: Found 0 HID device(s)
13:38:40.748 <- I (145151) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.748 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.748 <- I (147151) BT_HID: Scanning for HID devices (3s)...
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- I (150161) BT_HID: Found 0 HID device(s)
13:38:40.749 <- I (150161) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.749 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.749 <- I (152161) BT_HID: Scanning for HID devices (3s)...
13:38:40.750 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.750 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.750 <- I (155171) BT_HID: Found 0 HID device(s)
13:38:40.750 <- I (155171) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.751 <- I (157171) BT_HID: Scanning for HID devices (3s)...
13:38:40.751 <- E rmt: hw buffer too small, received symbols truncated
13:38:40.751 <- I (160181) BT_HID: Found 0 HID device(s)
13:38:40.751 <- I (160181) BT_HID: No HID devices found, retrying in 2000ms...
13:38:40.751 <- I (162181) BT_HID: Scanning for HID devices (3s)...

992
BRINGUP_27APR2026_1344.txt Normal file
View File

@@ -0,0 +1,992 @@
13:44:18.982
------------------------------------------------------------
Flashing COM3
------------------------------------------------------------
13:44:18.983 erase_flash @ COM3
13:44:22.473 flashing from D:\SC\SC-F001\build
13:44:22.474 files: [('0x1000', 'bootloader/bootloader.bin'), ('0x10000', 'SC-F001.bin'), ('0x8000', 'partition_table/partition-table.bin'), ('0xd000', 'ota_data_initial.bin')]
13:45:20.777 Flash complete
13:45:22.277 Connecting to COM3 @ 115200 ...
13:45:22.281 -> BU.BEGIN
13:45:22.523 <- BU.BEGIN
13:45:22.523 <-
13:45:22.523 <- BU.OK begin fw=9f4362b-dirty board=V5 t=0.00
13:45:22.525 -> BU.INFO
13:45:22.525 <- I (1751) SENS: EVENT 2
13:45:22.537 <- I (1751) SENS: FALLING
13:45:22.537 <- I (1751) SENS: SAFETY BREAK - Relays disabled
13:45:22.537 <- E rmt: hw buffer too small, received symbols truncated
13:45:22.542 <- I (1871) BT_HID: Scanning for HID devices (3s)...
13:45:22.542 <- I (1871) BT_HID: BLE HID host initialised
13:45:22.542 <- I (1871) WEBSERVER: Initializing webserver...
13:45:22.542 <- I (1871) WEBSERVER: AP LAUNCHING
13:45:22.564 <- I (1891) wifi:wifi driver task: 3ffe284c, prio:23, stack:6656, core=0
13:45:22.564 <- I (1891) wifi:wifi firmware version: ccaebfa
13:45:22.564 <- I (1891) wifi:wifi certification version: v7.0
13:45:22.564 <- I (1891) wifi:config NVS flash: enabled
13:45:22.564 <- I (1891) wifi:config nano formating: disabled
13:45:22.591 <- BU.OK info reset=POWERON heap=115088 min_heap=114096 fw=9f4362b-dirty build=2026-04-27 18:28:59
13:45:22.594 -> BU.FLASH
13:45:22.595 <- I (1901) wifi:Init data frame dynamic rx buffer num: 32
13:45:22.595 <- I (1911) wifi:Init static rx mgmt buffer num: 5
13:45:22.595 <- I (1911) wifi:Init management short buffer num: 32
13:45:22.595 <- I (1921) wifi:Init dynamic tx buffer num: 32
13:45:22.613 <- I (1921) wifi:Init static rx buffer size: 1600
13:45:22.613 <- I (1931) wifi:Init static rx buffer num: 10
13:45:22.613 <- I (1931) wifi:Init dynamic rx buffer num: 32
13:45:22.613 <- I (1941) wifi_init: rx ba win: 6
13:45:22.613 <- I (1941) wifi_init: accept mbox: 6
13:45:22.634 <- I (1941) wifi_init: tcpip mbox: 32
13:45:22.634 <- I (1951) wifi_init: udp mbox: 6
13:45:22.634 <- I (1951) wifi_init: tcp mbox: 6
13:45:22.634 <- I (1951) wifi_init: tcp tx win: 5760
13:45:22.634 <- BU.OK I (1961) wifi_init: tcp rx win: 5760
13:45:25.216 -> BU.I2C
13:45:25.217 <- flash post_part=roundtrip log_head=11 log_tail=0 partitions_size=4128768
13:45:25.217 <- I (1961) wifi_init: tcp mss: 1440
13:45:25.217 <- I (2261) wifi:mode : softAP (80:f3:da:65:45:4d)
13:45:25.217 <- I (2261) wifi:Total power save buffer number: 16
13:45:25.217 <- I (2271) wifi:Init max length of beacon: 752/752
13:45:25.217 <- I (2271) wifi:Init max length of beacon: 752/752
13:45:25.217 <- I (2271) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
13:45:25.217 <- I (2281) DNS_SERVER: DNS server started on port 53
13:45:25.217 <- I (2291) mdns_mem: mDNS task will be created from internal RAM
13:45:25.218 <- I (2291) WEBSERVER: SoftAP ready. SSID: sc.local, Channel: 6, Password: password
13:45:25.218 <- I (2301) WEBSERVER: Access at: http://sc.local.local or http://192.168.4.1
13:45:25.218 <- I (2301) WEBSERVER: STARTING HTTP
13:45:25.219 <- I (2311) WEBSERVER: HTTP server started successfully
13:45:25.219 <- I (2311) WEBSERVER: Registered URI handler: /
13:45:25.219 <- I (2321) WEBSERVER: Registered URI handler: /get
13:45:25.219 <- I (2321) WEBSERVER: Registered URI handler: /post
13:45:25.219 <- I (2331) WEBSERVER: Registered URI handler: /log
13:45:25.219 <- I (2331) WEBSERVER: Registered URI handler: /ota
13:45:25.219 <- I (2341) WEBSERVER: Registered URI handler: /*
13:45:25.219 <- I (2341) WEBSERVER: Webserver initialization complete
13:45:25.538 <- E rmt: hw buffer too small, received symbols truncated
13:45:25.538 <- E rmt: hw buffer too small, received symbols truncated
13:45:25.538 <- I (4591) I2C: POST: TCA9555 OK (port0=0x0021)
13:45:25.538 <- BU.OK i2c tca9555=ack
13:45:25.539 -> BU.LED.WATCH
13:45:25.540 <- E rmt: hw buffer too small, received symbols truncated
13:45:25.540 <- I (4881) BT_HID: Found 0 HID device(s)
13:45:26.055 <- I (4881) BT_HID: No HID devices found, retrying in 2000ms...
13:45:26.055 <- BU.EVENT led t=3.26 pressed=0
13:45:26.560 <- BU.EVENT led t=4.00 pressed=1
13:45:27.571 <- I (6881) BT_HID: Scanning for HID devices (3s)...
13:45:28.075 <- E rmt: hw buffer too small, received symbols truncated
13:45:28.581 <- BU.EVENT led t=5.98 pressed=0
13:45:29.085 <- E rmt: hw buffer too small, received symbols truncated
13:45:30.610 <- BU.EVENT led t=8.04 pressed=1
13:45:30.610 <- I (9891) BT_HID: Found 0 HID device(s)
13:45:30.610 <- I (9891) BT_HID: No HID devices found, retrying in 2000ms...
13:45:31.629 <- BU.EVENT led t=8.86 pressed=0
13:45:32.639 <- I (11891) BT_HID: Scanning for HID devices (3s)...
13:45:32.639 <- E rmt: hw buffer too small, received symbols truncated
13:45:33.962 ->
13:45:34.150 <- BU.OK led.watch done
13:45:36.621 -> BU.ADC
13:45:37.013 <- I (14901) BT_HID: Found 0 HID device(s)
13:45:37.013 <- I (14901) BT_HID: No HID devices found, retrying in 2000ms...
13:45:37.013 <- E rmt: hw buffer too small, received symbols truncated
13:45:37.013 <- BU.OK adc bat_mv=1679 bat_V=13.210 isens_mv=1673 isens_A=-1.74
13:45:55.435 -> BU.PARAM GET V_SENS_K
13:45:55.436 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.436 <- I (16901) BT_HID: Scanning for HID devices (3s)...
13:45:55.436 <- I (19911) BT_HID: Found 0 HID device(s)
13:45:55.436 <- I (19911) BT_HID: No HID devices found, retrying in 2000ms...
13:45:55.436 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.436 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.436 <- I (21911) BT_HID: Scanning for HID devices (3s)...
13:45:55.436 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- I (24921) BT_HID: Found 0 HID device(s)
13:45:55.437 <- I (24921) BT_HID: No HID devices found, retrying in 2000ms...
13:45:55.437 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- I (26921) BT_HID: Scanning for HID devices (3s)...
13:45:55.437 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.437 <- I (29931) BT_HID: Found 0 HID device(s)
13:45:55.438 <- I (29931) BT_HID: No HID devices found, retrying in 2000ms...
13:45:55.438 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.438 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.438 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.587 <- I (31931) BT_HID: Scanning for HID devices (3s)...
13:45:55.587 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.587 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.587 <- BU.OK param key=V_SENS_K value=0.00766666653
13:45:55.587 -> BU.ADC
13:45:55.587 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.824 <- E rmt: hw buffer too small, received symbols truncated
13:45:55.825 <- I (34941) BT_HID: Found 0 HID device(s)
13:45:55.825 <- I (34941) BT_HID: No HID devices found, retrying in 2000ms...
13:45:55.825 <- BU.OK adc bat_mv=1677 bat_V=13.210 isens_mv=1665 isens_A=-1.14
13:46:13.474 -> BU.PARAM SET V_SENS_OFFSET 0.043000
13:46:13.475 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.475 <- I (36941) BT_HID: Scanning for HID devices (3s)...
13:46:13.475 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.475 <- I (39951) BT_HID: Found 0 HID device(s)
13:46:13.476 <- I (39951) BT_HID: No HID devices found, retrying in 2000ms...
13:46:13.476 <- I (41951) BT_HID: Scanning for HID devices (3s)...
13:46:13.476 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.476 <- I (44961) BT_HID: Found 0 HID device(s)
13:46:13.476 <- I (44961) BT_HID: No HID devices found, retrying in 2000ms...
13:46:13.477 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.477 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.477 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.477 <- I (46961) BT_HID: Scanning for HID devices (3s)...
13:46:13.478 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.478 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.478 <- I (49971) BT_HID: Found 0 HID device(s)
13:46:13.478 <- I (49971) BT_HID: No HID devices found, retrying in 2000ms...
13:46:13.541 <- E rmt: hw buffer too small, received symbols truncated
13:46:13.541 <- I (51971) BT_HID: Scanning for HID devices (3s)...
13:46:13.541 <- I (52851) STORAGE: Parameter 34 (V_SENS_OFFSET) set (not committed)
13:46:13.541 <- I (52851) STORAGE: Committing 49 parameters to flash...
13:46:14.043 <- I (52881) STORAGE: Successfully committed all parameters to flash
13:46:14.043 <- BU.OK param key=V_SENS_OFFSET set=ok committed=yes
13:46:14.043 -> BU.ADC
13:46:14.548 <- BU.OK adc bat_mv=1671 bat_V=13.210 isens_mv=1678 isens_A=-2.12
13:46:14.554 -> BU.SENSORS.WATCH 0
13:46:15.068 <- BU.EVENT state t=52.28 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:15.068 <- BU.EVENT state t=52.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:15.574 <- E rmt: hw buffer too small, received symbols truncated
13:46:15.574 <- BU.EVENT state t=52.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:15.574 <- BU.EVENT state t=53.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:15.842 <- BU.EVENT state t=53.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:15.842 <- I (54981) BT_HID: Found 0 HID device(s)
13:46:15.842 <- I (54981) BT_HID: No HID devices found, retrying in 2000ms...
13:46:16.351 <- BU.EVENT state t=53.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:16.351 <- BU.EVENT state t=53.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:16.351 <- BU.EVENT state t=54.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:16.856 <- E rmt: hw buffer too small, received symbols truncated
13:46:16.856 <- BU.EVENT state t=54.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:16.856 <- BU.EVENT state t=54.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:17.361 <- BU.EVENT state t=54.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:17.361 <- BU.EVENT state t=55.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:17.842 <- E rmt: hw buffer too small, received symbols truncated
13:46:17.842 <- BU.EVENT state t=55.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:17.842 <- I (56981) BT_HID: Scanning for HID devices (3s)...
13:46:18.345 <- BU.EVENT state t=55.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:18.345 <- BU.EVENT state t=55.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:18.345 <- E rmt: hw buffer too small, received symbols truncated
13:46:18.849 <- BU.EVENT state t=56.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:18.849 <- E rmt: hw buffer too small, received symbols truncated
13:46:18.849 <- BU.EVENT state t=56.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:18.849 <- BU.EVENT state t=56.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:19.364 <- BU.EVENT state t=56.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:19.364 <- BU.EVENT state t=57.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:19.867 <- BU.EVENT state t=57.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:19.867 <- BU.EVENT state t=57.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:20.377 <- BU.EVENT state t=57.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:20.377 <- BU.EVENT state t=58.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:20.842 <- BU.EVENT state t=58.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:20.842 <- I (59991) BT_HID: Found 0 HID device(s)
13:46:20.842 <- I (59991) BT_HID: No HID devices found, retrying in 2000ms...
13:46:21.358 <- BU.EVENT state t=58.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:21.358 <- BU.EVENT state t=58.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:21.358 <- BU.EVENT state t=59.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:21.863 <- BU.EVENT state t=59.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:21.863 <- BU.EVENT state t=59.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:22.343 <- BU.EVENT state t=59.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:22.343 <- E rmt: hw buffer too small, received symbols truncated
13:46:22.343 <- E rmt: hw buffer too small, received symbols truncated
13:46:22.845 <- BU.EVENT state t=60.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:22.845 <- BU.EVENT state t=60.29 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:22.845 <- I (61991) BT_HID: Scanning for HID devices (3s)...
13:46:23.356 <- BU.EVENT state t=60.54 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:23.356 <- BU.EVENT state t=60.79 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:23.356 <- BU.EVENT state t=61.04 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:23.862 <- BU.EVENT state t=61.30 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:23.862 <- BU.EVENT state t=61.55 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:24.370 <- E rmt: hw buffer too small, received symbols truncated
13:46:24.370 <- BU.EVENT state t=61.81 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:24.370 <- BU.EVENT state t=62.06 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:24.876 <- BU.EVENT state t=62.31 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:24.876 <- BU.EVENT state t=62.56 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:25.382 <- BU.EVENT state t=62.81 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:25.382 <- BU.EVENT state t=63.06 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:25.862 <- BU.EVENT state t=63.31 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:25.863 <- I (65001) BT_HID: Found 0 HID device(s)
13:46:25.863 <- I (65001) BT_HID: No HID devices found, retrying in 2000ms...
13:46:26.364 <- BU.EVENT state t=63.56 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:26.364 <- BU.EVENT state t=63.81 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:26.873 <- BU.EVENT state t=64.06 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:26.873 <- BU.EVENT state t=64.31 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:26.873 <- BU.EVENT state t=64.56 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:27.379 <- BU.EVENT state t=64.81 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:27.379 <- BU.EVENT state t=65.06 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:27.883 <- BU.EVENT state t=65.31 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:27.883 <- I (67001) BT_HID: Scanning for HID devices (3s)...
13:46:27.883 <- BU.EVENT state t=65.56 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:28.391 <- BU.EVENT state t=65.81 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:28.391 <- BU.EVENT state t=66.06 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:28.898 <- BU.EVENT state t=66.31 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:28.898 <- BU.EVENT state t=66.57 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:29.402 <- BU.EVENT state t=66.82 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:29.402 <- BU.EVENT state t=67.07 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:29.911 <- BU.EVENT state t=67.32 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:29.911 <- BU.EVENT state t=67.57 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:30.414 <- BU.EVENT state t=67.82 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:30.414 <- BU.EVENT state t=68.07 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:30.872 <- BU.EVENT state t=68.32 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:30.872 <- I (70011) BT_HID: Found 0 HID device(s)
13:46:30.872 <- I (70011) BT_HID: No HID devices found, retrying in 2000ms...
13:46:30.987 ->
13:46:31.378 <- BU.EVENT state t=68.57 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:31.378 <- BU.OK sensors.watch sec=-1 SAFETY=none DRIVE=none JACK=none AUX=none
13:46:34.244 -> BU.SENSORS.WATCH 0
13:46:34.532 <- I (72011) BT_HID: Scanning for HID devices (3s)...
13:46:34.532 <- E rmt: hw buffer too small, received symbols truncated
13:46:34.532 <- BU.EVENT state t=71.97 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:35.038 <- BU.EVENT state t=72.23 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:35.038 <- BU.EVENT state t=72.48 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:35.038 <- BU.EVENT state t=72.73 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:35.543 <- BU.EVENT state t=72.98 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:35.543 <- BU.EVENT state t=73.23 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:36.033 <- I (75021) BT_HID: Found 0 HID device(s)
13:46:36.033 <- I (75021) BT_HID: No HID devices found, retrying in 2000ms...
13:46:36.033 <- BU.EVENT state t=73.48 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:36.540 <- BU.EVENT state t=73.73 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:36.540 <- BU.EVENT state t=73.98 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:36.540 <- BU.EVENT state t=74.23 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:37.047 <- BU.EVENT state t=74.48 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:37.047 <- BU.EVENT state t=74.73 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:37.552 <- BU.EVENT state t=74.98 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:37.552 <- E rmt: hw buffer too small, received symbols truncated
13:46:37.552 <- BU.EVENT state t=75.23 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:38.017 ->
13:46:38.058 <- I (77021) BT_HID: Scanning for HID devices (3s)...
13:46:38.058 <- BU.EVENT state t=75.48 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
13:46:38.058 <- BU.OK sensors.watch sec=-1 SAFETY=none DRIVE=none JACK=none AUX=none
13:46:42.314 -> BU.RELAY SENSORS ON 200
13:46:42.540 <- E rmt: hw buffer too small, received symbols truncated
13:46:42.540 <- E rmt: hw buffer too small, received symbols truncated
13:46:42.540 <- I (80031) BT_HID: Found 0 HID device(s)
13:46:42.540 <- I (80031) BT_HID: No HID devices found, retrying in 2000ms...
13:46:43.044 <- BU.OK relay bridge=SENSORS ms=200
13:46:48.584 -> BU.RELAY DRIVE FWD 3000
13:46:48.585 <- I (82031) BT_HID: Scanning for HID devices (3s)...
13:46:48.737 <- E rmt: hw buffer too small, received symbols truncated
13:46:48.737 <- I (85041) BT_HID: Found 0 HID device(s)
13:46:48.737 <- I (85041) BT_HID: No HID devices found, retrying in 2000ms...
13:46:48.737 <- I (87041) BT_HID: Scanning for HID devices (3s)...
13:46:49.249 <- E rmt: hw buffer too small, received symbols truncated
13:46:49.249 <- E rmt: hw buffer too small, received symbols truncated
13:46:49.249 <- E rmt: hw buffer too small, received symbols truncated
13:46:49.759 <- E rmt: hw buffer too small, received symbols truncated
13:46:50.265 <- E rmt: hw buffer too small, received symbols truncated
13:46:50.265 <- E rmt: hw buffer too small, received symbols truncated
13:46:50.771 <- I (90051) BT_HID: Found 0 HID device(s)
13:46:50.771 <- I (90051) BT_HID: No HID devices found, retrying in 2000ms...
13:46:50.771 <- BU.OK relay bridge=DRIVE dir=FWD ms=2000 I_before=+0.00 I_mid=+18.03 I_after=-0.02 heat=0.004 tripped=0 edges=34
13:46:52.372 -> BU.RELAY DRIVE REV 3000
13:46:52.373 <- E rmt: hw buffer too small, received symbols truncated
13:46:52.373 <- E rmt: hw buffer too small, received symbols truncated
13:46:52.373 <- E rmt: hw buffer too small, received symbols truncated
13:46:52.373 <- E rmt: hw buffer too small, received symbols truncated
13:46:52.885 <- E rmt: hw buffer too small, received symbols truncated
13:46:52.885 <- I (92051) BT_HID: Scanning for HID devices (3s)...
13:46:54.909 <- BU.OK relay bridge=DRIVE dir=REV ms=2000 I_before=-0.03 I_mid=+23.08 I_after=-0.03 heat=0.011 tripped=0 edges=34
13:46:56.411 -> BU.RELAY JACK UP 1200
13:46:56.917 <- I (95061) BT_HID: Found 0 HID device(s)
13:46:56.917 <- I (95061) BT_HID: No HID devices found, retrying in 2000ms...
13:46:56.917 <- E rmt: hw buffer too small, received symbols truncated
13:46:56.917 <- E rmt: hw buffer too small, received symbols truncated
13:46:57.926 <- I (97061) BT_HID: Scanning for HID devices (3s)...
13:46:57.926 <- BU.OK relay bridge=JACK dir=UP ms=1200 I_before=+0.00 I_mid=+2.35 I_after=-0.00 heat=0.001 tripped=0 edges=1
13:46:58.304 -> BU.RELAY JACK DOWN 1200
13:46:59.821 <- BU.OK relay bridge=JACK dir=DOWN ms=1200 I_before=-0.00 I_mid=+0.60 I_after=-0.00 heat=0.001 tripped=0 edges=1
13:47:04.669 -> BU.RELAY AUX FWD 150
13:47:04.670 <- E rmt: hw buffer too small, received symbols truncated
13:47:04.670 <- I (100071) BT_HID: Found 0 HID device(s)
13:47:04.670 <- I (100071) BT_HID: No HID devices found, retrying in 2000ms...
13:47:04.670 <- E rmt: hw buffer too small, received symbols truncated
13:47:05.183 <- I (102071) BT_HID: Scanning for HID devices (3s)...
13:47:05.183 <- E rmt: hw buffer too small, received symbols truncated
13:47:05.183 <- BU.OK relay bridge=AUX dir=FWD ms=150 I_before=+0.00 I_mid=+2.12 I_after=-0.00 heat=0.006 tripped=0 edges=0
13:47:10.963 -> BU.RF.WATCH 0
13:47:10.964 <- I (105081) BT_HID: Found 0 HID device(s)
13:47:10.964 <- I (105081) BT_HID: No HID devices found, retrying in 2000ms...
13:47:10.964 <- E rmt: hw buffer too small, received symbols truncated
13:47:10.964 <- E rmt: hw buffer too small, received symbols truncated
13:47:10.965 <- I (107081) BT_HID: Scanning for HID devices (3s)...
13:47:10.965 <- E rmt: hw buffer too small, received symbols truncated
13:47:10.965 <- E rmt: hw buffer too small, received symbols truncated
13:47:10.965 <- I (109891) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:10.966 <- I (109931) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:10.966 <- I (109971) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:10.966 <- I (110061) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:10.966 <- I (110091) BT_HID: Found 0 HID device(s)
13:47:10.966 <- I (110091) BT_HID: No HID devices found, retrying in 2000ms...
13:47:11.475 <- I (110141) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:11.680 <- I (110861) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:11.680 <- BU.EVENT rf code=0xBE9B78 t=109.23
13:47:11.680 <- I (110901) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:11.680 <- BU.EVENT rf code=0xBE9B78 t=109.28
13:47:11.681 <- I (110991) RF: GOT KEYCODE 0xbe9b78 [25]
13:47:12.122 <- BU.EVENT rf code=0xBE9B78 t=109.38
13:47:12.122 <- I (111291) RF: GOT KEYCODE 0xbe9b74 [25]
13:47:12.122 <- BU.EVENT rf code=0xBE9B74 t=109.68
13:47:12.123 <- I (111381) RF: GOT KEYCODE 0xbe9b74 [25]
13:47:12.123 <- I (111421) RF: GOT KEYCODE 0xbe9b74 [25]
13:47:12.123 <- BU.EVENT rf code=0xBE9B74 t=109.78
13:47:12.560 <- I (111471) RF: GOT KEYCODE 0xbe9b74 [25]
13:47:12.560 <- BU.EVENT rf code=0xBE9B74 t=109.83
13:47:12.560 <- I (111781) RF: GOT KEYCODE 0xbe9b72 [25]
13:47:12.560 <- BU.EVENT rf code=0xBE9B72 t=110.13
13:47:12.562 <- I (111821) RF: GOT KEYCODE 0xbe9b72 [25]
13:47:12.562 <- BU.EVENT rf code=0xBE9B72 t=110.18
13:47:12.891 <- I (111901) RF: GOT KEYCODE 0xbe9b72 [25]
13:47:12.891 <- BU.EVENT rf code=0xBE9B72 t=110.28
13:47:12.891 <- I (111991) RF: GOT KEYCODE 0xbe9b72 [25]
13:47:12.891 <- BU.EVENT rf code=0xBE9B72 t=110.38
13:47:12.893 <- I (112091) BT_HID: Scanning for HID devices (3s)...
13:47:13.248 ->
13:47:13.279 <- I (112231) RF: GOT KEYCODE 0xbe9b71 [25]
13:47:13.279 <- BU.EVENT rf code=0xBE9B71 t=110.63
13:47:13.279 <- I (112321) RF: GOT KEYCODE 0xbe9b71 [25]
13:47:13.279 <- BU.EVENT rf code=0xBE9B71 t=110.68
13:47:13.280 <- I (112411) RF: GOT KEYCODE 0xbe9b71 [25]
13:47:13.280 <- BU.EVENT rf code=0xBE9B71 t=110.78
13:47:13.795 <- BU.OK rf.watch sec=-1 seen=13
13:47:15.596 -> BU.WIFI.START
13:47:15.646 <- I (114971) WEBSERVER: Initializing webserver...
13:47:15.646 <- I (114971) WEBSERVER: AP LAUNCHING
13:47:15.646 <- I (114981) wifi:Total power save buffer number: 16
13:47:15.646 <- W (114981) DNS_SERVER: DNS server already running
13:47:15.668 <- E (114981) WEBSERVER: Failed to start DNS server: ESP_ERR_INVALID_STATE
13:47:15.668 <- I (114981) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
13:47:15.668 <- E (115001) mdns: mdns_service_add_for_host(6013): Service already exists
13:47:15.689 <- I (115001) WEBSERVER: SoftAP ready. SSID: sc.local, Channel: 6, Password: password
13:47:15.689 <- I (115011) WEBSERVER: Access at: http://sc.local.local or http://192.168.4.1
13:47:15.689 <- I (115021) WEBSERVER: Webserver initialization complete
13:47:16.201 <- BU.OK wifi.start mode=AP ssid="sc.local" ip=192.168.4.1
13:47:16.205 -> BU.WIFI.WAIT
13:47:16.206 <- I (115101) BT_HID: Found 0 HID device(s)
13:47:16.206 <- I (115101) BT_HID: No HID devices found, retrying in 2000ms...
13:47:18.226 <- I (117101) BT_HID: Scanning for HID devices (3s)...
13:47:18.226 <- E rmt: hw buffer too small, received symbols truncated
13:47:19.745 <- E rmt: hw buffer too small, received symbols truncated
13:47:20.251 <- E rmt: hw buffer too small, received symbols truncated
13:47:21.265 <- I (120111) BT_HID: Found 0 HID device(s)
13:47:21.265 <- I (120111) BT_HID: No HID devices found, retrying in 2000ms...
13:47:22.797 <- E rmt: hw buffer too small, received symbols truncated
13:47:22.797 <- I (122111) BT_HID: Scanning for HID devices (3s)...
13:47:23.302 <- E rmt: hw buffer too small, received symbols truncated
13:47:24.822 <- E rmt: hw buffer too small, received symbols truncated
13:47:25.842 <- I (125121) BT_HID: Found 0 HID device(s)
13:47:25.842 <- I (125121) BT_HID: No HID devices found, retrying in 2000ms...
13:47:26.348 <- E rmt: hw buffer too small, received symbols truncated
13:47:27.863 <- I (127121) BT_HID: Scanning for HID devices (3s)...
13:47:30.394 <- E rmt: hw buffer too small, received symbols truncated
13:47:30.394 <- E rmt: hw buffer too small, received symbols truncated
13:47:30.900 <- I (130131) BT_HID: Found 0 HID device(s)
13:47:30.900 <- I (130131) BT_HID: No HID devices found, retrying in 2000ms...
13:47:30.900 <- E rmt: hw buffer too small, received symbols truncated
13:47:31.918 <- E rmt: hw buffer too small, received symbols truncated
13:47:32.929 <- I (132131) BT_HID: Scanning for HID devices (3s)...
13:47:34.448 <- E rmt: hw buffer too small, received symbols truncated
13:47:35.967 <- E rmt: hw buffer too small, received symbols truncated
13:47:35.967 <- I (135141) BT_HID: Found 0 HID device(s)
13:47:35.967 <- I (135141) BT_HID: No HID devices found, retrying in 2000ms...
13:47:36.976 <- E rmt: hw buffer too small, received symbols truncated
13:47:37.989 <- I (137141) BT_HID: Scanning for HID devices (3s)...
13:47:41.026 <- I (140151) BT_HID: Found 0 HID device(s)
13:47:41.026 <- I (140151) BT_HID: No HID devices found, retrying in 2000ms...
13:47:41.530 <- E rmt: hw buffer too small, received symbols truncated
13:47:42.546 <- E rmt: hw buffer too small, received symbols truncated
13:47:43.053 <- I (142151) BT_HID: Scanning for HID devices (3s)...
13:47:44.068 <- E rmt: hw buffer too small, received symbols truncated
13:47:46.091 <- I (145161) BT_HID: Found 0 HID device(s)
13:47:46.091 <- I (145161) BT_HID: No HID devices found, retrying in 2000ms...
13:47:48.113 <- E rmt: hw buffer too small, received symbols truncated
13:47:48.113 <- I (147161) BT_HID: Scanning for HID devices (3s)...
13:47:49.136 <- E rmt: hw buffer too small, received symbols truncated
13:47:50.663 <- E rmt: hw buffer too small, received symbols truncated
13:47:50.663 <- E rmt: hw buffer too small, received symbols truncated
13:47:51.172 <- I (150171) BT_HID: Found 0 HID device(s)
13:47:51.172 <- I (150171) BT_HID: No HID devices found, retrying in 2000ms...
13:47:53.213 <- I (152171) BT_HID: Scanning for HID devices (3s)...
13:47:53.717 <- E rmt: hw buffer too small, received symbols truncated
13:47:54.730 <- E rmt: hw buffer too small, received symbols truncated
13:47:56.250 <- I (155181) BT_HID: Found 0 HID device(s)
13:47:56.250 <- I (155181) BT_HID: No HID devices found, retrying in 2000ms...
13:47:57.769 <- E rmt: hw buffer too small, received symbols truncated
13:47:58.275 <- I (157181) BT_HID: Scanning for HID devices (3s)...
13:48:01.319 <- I (160191) BT_HID: Found 0 HID device(s)
13:48:01.319 <- I (160191) BT_HID: No HID devices found, retrying in 2000ms...
13:48:03.346 <- I (162191) BT_HID: Scanning for HID devices (3s)...
13:48:03.346 <- E rmt: hw buffer too small, received symbols truncated
13:48:05.874 <- E rmt: hw buffer too small, received symbols truncated
13:48:05.874 <- I (165201) BT_HID: Found 0 HID device(s)
13:48:05.874 <- I (165201) BT_HID: No HID devices found, retrying in 2000ms...
13:48:07.890 <- I (167201) BT_HID: Scanning for HID devices (3s)...
13:48:09.403 <- E rmt: hw buffer too small, received symbols truncated
13:48:10.921 <- E rmt: hw buffer too small, received symbols truncated
13:48:10.921 <- I (170211) BT_HID: Found 0 HID device(s)
13:48:10.921 <- I (170211) BT_HID: No HID devices found, retrying in 2000ms...
13:48:11.425 <- E rmt: hw buffer too small, received symbols truncated
13:48:12.939 <- I (172211) BT_HID: Scanning for HID devices (3s)...
13:48:14.958 <- E rmt: hw buffer too small, received symbols truncated
13:48:15.968 <- I (175221) BT_HID: Found 0 HID device(s)
13:48:15.968 <- I (175221) BT_HID: No HID devices found, retrying in 2000ms...
13:48:17.985 <- I (177221) BT_HID: Scanning for HID devices (3s)...
13:48:19.502 <- E rmt: hw buffer too small, received symbols truncated
13:48:20.008 <- E rmt: hw buffer too small, received symbols truncated
13:48:21.030 <- I (180231) BT_HID: Found 0 HID device(s)
13:48:21.030 <- I (180231) BT_HID: No HID devices found, retrying in 2000ms...
13:48:23.052 <- I (182231) BT_HID: Scanning for HID devices (3s)...
13:48:25.071 <- E rmt: hw buffer too small, received symbols truncated
13:48:26.084 <- I (185241) BT_HID: Found 0 HID device(s)
13:48:26.084 <- I (185241) BT_HID: No HID devices found, retrying in 2000ms...
13:48:28.110 <- I (187241) BT_HID: Scanning for HID devices (3s)...
13:48:29.625 <- E rmt: hw buffer too small, received symbols truncated
13:48:29.625 <- E rmt: hw buffer too small, received symbols truncated
13:48:30.637 <- E rmt: hw buffer too small, received symbols truncated
13:48:31.140 <- I (190251) BT_HID: Found 0 HID device(s)
13:48:31.140 <- I (190251) BT_HID: No HID devices found, retrying in 2000ms...
13:48:33.168 <- E rmt: hw buffer too small, received symbols truncated
13:48:33.168 <- I (192251) BT_HID: Scanning for HID devices (3s)...
13:48:34.178 <- E rmt: hw buffer too small, received symbols truncated
13:48:34.178 <- E rmt: hw buffer too small, received symbols truncated
13:48:34.178 <- E rmt: hw buffer too small, received symbols truncated
13:48:35.695 <- E rmt: hw buffer too small, received symbols truncated
13:48:36.201 <- E rmt: hw buffer too small, received symbols truncated
13:48:36.201 <- I (195261) BT_HID: Found 0 HID device(s)
13:48:36.201 <- I (195261) BT_HID: No HID devices found, retrying in 2000ms...
13:48:37.228 <- E rmt: hw buffer too small, received symbols truncated
13:48:37.228 <- E rmt: hw buffer too small, received symbols truncated
13:48:38.243 <- I (197261) BT_HID: Scanning for HID devices (3s)...
13:48:39.253 <- E rmt: hw buffer too small, received symbols truncated
13:48:41.278 <- I (200271) BT_HID: Found 0 HID device(s)
13:48:41.278 <- I (200271) BT_HID: No HID devices found, retrying in 2000ms...
13:48:41.278 <- E rmt: hw buffer too small, received symbols truncated
13:48:42.796 <- E rmt: hw buffer too small, received symbols truncated
13:48:43.302 <- I (202271) BT_HID: Scanning for HID devices (3s)...
13:48:45.335 <- E rmt: hw buffer too small, received symbols truncated
13:48:45.841 <- E rmt: hw buffer too small, received symbols truncated
13:48:46.344 <- I (205281) BT_HID: Found 0 HID device(s)
13:48:46.344 <- I (205281) BT_HID: No HID devices found, retrying in 2000ms...
13:48:47.861 <- E rmt: hw buffer too small, received symbols truncated
13:48:48.367 <- I (207281) BT_HID: Scanning for HID devices (3s)...
13:48:48.367 <- E rmt: hw buffer too small, received symbols truncated
13:48:51.402 <- I (210291) BT_HID: Found 0 HID device(s)
13:48:51.402 <- I (210291) BT_HID: No HID devices found, retrying in 2000ms...
13:48:53.429 <- I (212291) BT_HID: Scanning for HID devices (3s)...
13:48:55.452 <- E rmt: hw buffer too small, received symbols truncated
13:48:55.957 <- I (215301) BT_HID: Found 0 HID device(s)
13:48:56.461 <- I (215301) BT_HID: No HID devices found, retrying in 2000ms...
13:48:56.461 <- E rmt: hw buffer too small, received symbols truncated
13:48:57.470 <- E rmt: hw buffer too small, received symbols truncated
13:48:57.974 <- E rmt: hw buffer too small, received symbols truncated
13:48:57.974 <- I (217301) BT_HID: Scanning for HID devices (3s)...
13:48:59.996 <- E rmt: hw buffer too small, received symbols truncated
13:49:01.010 <- I (220311) BT_HID: Found 0 HID device(s)
13:49:01.010 <- I (220311) BT_HID: No HID devices found, retrying in 2000ms...
13:49:03.034 <- I (222311) BT_HID: Scanning for HID devices (3s)...
13:49:03.540 <- E rmt: hw buffer too small, received symbols truncated
13:49:05.060 <- E rmt: hw buffer too small, received symbols truncated
13:49:05.060 <- E rmt: hw buffer too small, received symbols truncated
13:49:05.564 <- E rmt: hw buffer too small, received symbols truncated
13:49:05.564 <- E rmt: hw buffer too small, received symbols truncated
13:49:06.068 <- I (225321) BT_HID: Found 0 HID device(s)
13:49:06.068 <- I (225321) BT_HID: No HID devices found, retrying in 2000ms...
13:49:07.077 <- E rmt: hw buffer too small, received symbols truncated
13:49:08.088 <- I (227321) BT_HID: Scanning for HID devices (3s)...
13:49:09.098 <- E rmt: hw buffer too small, received symbols truncated
13:49:11.117 <- I (230331) BT_HID: Found 0 HID device(s)
13:49:11.117 <- I (230331) BT_HID: No HID devices found, retrying in 2000ms...
13:49:13.144 <- I (232331) BT_HID: Scanning for HID devices (3s)...
13:49:13.648 <- E rmt: hw buffer too small, received symbols truncated
13:49:16.180 <- I (235341) BT_HID: Found 0 HID device(s)
13:49:16.180 <- I (235341) BT_HID: No HID devices found, retrying in 2000ms...
13:49:18.195 <- I (237341) BT_HID: Scanning for HID devices (3s)...
13:49:19.707 <- E rmt: hw buffer too small, received symbols truncated
13:49:21.227 <- I (240351) BT_HID: Found 0 HID device(s)
13:49:21.227 <- I (240351) BT_HID: No HID devices found, retrying in 2000ms...
13:49:21.731 <- E rmt: hw buffer too small, received symbols truncated
13:49:23.244 <- I (242351) BT_HID: Scanning for HID devices (3s)...
13:49:26.278 <- I (245361) BT_HID: Found 0 HID device(s)
13:49:26.278 <- I (245361) BT_HID: No HID devices found, retrying in 2000ms...
13:49:28.292 <- I (247361) BT_HID: Scanning for HID devices (3s)...
13:49:28.796 <- E rmt: hw buffer too small, received symbols truncated

621
BRINGUP_27APR2026_1356.txt Normal file
View File

@@ -0,0 +1,621 @@
13:56:49.501
------------------------------------------------------------
Flashing COM3
------------------------------------------------------------
13:56:49.503 erase_flash @ COM3
13:56:52.807 flashing from D:\SC\SC-F001\build
13:56:52.809 files: [('0x1000', 'bootloader/bootloader.bin'), ('0x10000', 'SC-F001.bin'), ('0x8000', 'partition_table/partition-table.bin'), ('0xd000', 'ota_data_initial.bin')]
13:57:17.688 Flash complete
13:57:19.189 Connecting to COM3 @ 115200 ...
13:57:19.193 -> BU.BEGIN
13:57:19.218 <- <20>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>x<EFBFBD>xBU.BEGIN
13:57:19.232 <-
13:57:19.233 <- BU.BEGIN
13:57:19.237 <-
13:57:19.237 <- BU.BEGIN
13:57:19.238 <-
13:57:19.238 <- BU.BEGIN
13:57:19.238 <-
13:57:19.238 <- BU.BEGIN
13:57:19.239 <-
13:57:19.239 <- BU.BEGIN
13:57:19.239 <-
13:57:19.239 <- BU.BEGIN
13:57:19.240 <-
13:57:19.240 <- BU.BEGIN
13:57:19.240 <-
13:57:19.240 <- BU.BEGIN
13:57:19.240 <-
13:57:19.240 <- BU.BEGIN
13:57:19.241 <-
13:57:19.241 <- BU.BEGIN
13:57:19.241 <-
13:57:19.241 <- BU.BEGIN
13:57:19.241 <-
13:57:19.241 <- BU.BEGIN
13:57:19.242 <-
13:57:19.242 <- BU.BEGIN
13:57:19.242 <-
13:57:19.242 <- BU.BEGIN
13:57:19.243 <-
13:57:19.243 <- BU.BEGIN
13:57:19.243 <-
13:57:19.243 <- BU.BEGIN
13:57:19.244 <-
13:57:19.244 <- BU.BEGIN
13:57:19.244 <-
13:57:19.244 <- BU.BEGIN
13:57:19.245 <-
13:57:19.245 <- BU.BEGIN
13:57:19.245 <-
13:57:19.245 <- BU.BEGIN
13:57:19.246 <-
13:57:19.246 <- BU.BEGIN
13:57:19.246 <-
13:57:19.246 <- BU.BEGIN
13:57:19.247 <-
13:57:19.247 <- BU.BEGIN
13:57:19.247 <-
13:57:19.247 <- BU.BEGIN
13:57:19.248 <-
13:57:19.248 <- BU.BEGIN
13:57:19.249 <-
13:57:19.249 <- BU.BEGIN
13:57:19.250 <-
13:57:19.250 <- BU.BEGIN
13:57:19.250 <-
13:57:19.250 <- BU.BEGIN
13:57:19.250 <-
13:57:19.250 <- BU.BEGIN
13:57:19.250 <-
13:57:19.250 <- BU.BEGIN
13:57:19.251 <-
13:57:19.251 <- BU.BEGIN
13:57:19.251 <-
13:57:19.251 <- BU.BEGIN
13:57:19.251 <-
13:57:19.251 <- BU.BEGIN
13:57:19.252 <-
13:57:19.252 <- BU.BEGIN
13:57:19.252 <-
13:57:19.252 <- BU.BEGIN
13:57:19.253 <-
13:57:19.253 <- BU.BEGIN
13:57:19.253 <-
13:57:19.253 <- BU.BEGIN
13:57:19.254 <-
13:57:19.254 <- BU.BEGIN
13:57:19.258 <-
13:57:19.258 <- BU.BEGIN
13:57:19.258 <-
13:57:19.258 <- BU.BEGIN
13:57:19.258 <-
13:57:19.258 <- BU.BEGIN
13:57:19.259 <-
13:57:19.259 <- BU.BEGIN
13:57:19.259 <-
13:57:19.259 <- BU.BEGIN
13:57:19.260 <-
13:57:19.260 <- BU.BEGIN
13:57:19.260 <-
13:57:19.260 <- BU.BEGIN
13:57:19.260 <-
13:57:19.260 <- BU.BEGIN
13:57:19.261 <-
13:57:19.261 <- BU.BEGIN
13:57:19.261 <-
13:57:19.262 <- BU.BEGIN
13:57:19.264 <-
13:57:19.265 <- BU.BEGIN
13:57:19.266 <-
13:57:19.267 <- BU.BEGIN
13:57:19.268 <-
13:57:19.268 <- BU.BEGIN
13:57:19.269 <-
13:57:19.269 <- BU.BEGIN
13:57:19.270 <-
13:57:19.270 <- BU.BEGIN
13:57:19.272 <-
13:57:19.272 <- BU.BEGIN
13:57:19.273 <-
13:57:19.273 <- BU.BEGIN
13:57:19.273 <-
13:57:19.273 <- BU.BEGIN
13:57:19.273 <-
13:57:19.273 <- BU.BEGIN
13:57:19.274 <-
13:57:19.274 <- BU.BEGIN
13:57:19.274 <-
13:57:19.274 <- BU.BEGIN
13:57:19.275 <-
13:57:19.275 <- BU.BEGIN
13:57:19.275 <-
13:57:19.275 <- BU.BEGIN
13:57:19.275 <-
13:57:19.275 <- BU.BEGIN
13:57:19.276 <-
13:57:19.276 <- BU.BEGIN
13:57:19.276 <-
13:57:19.276 <- BU.BEGIN
13:57:19.277 <-
13:57:19.277 <- BU.BEGIN
13:57:19.277 <-
13:57:19.277 <- BU.BEGIN
13:57:19.277 <-
13:57:19.277 <- BU.BEGIN
13:57:19.278 <-
13:57:19.278 <- BU.BEGIN
13:57:19.278 <-
13:57:19.279 <- BU.BEGIN
13:57:19.279 <-
13:57:19.279 <- BU.BEGIN
13:57:19.280 <-
13:57:19.280 <- BU.BEGIN
13:57:19.280 <-
13:57:19.280 <- BU.BEGIN
13:57:19.281 <-
13:57:19.281 <- BU.BEGIN
13:57:19.281 <-
13:57:19.281 <- BU.BEGIN
13:57:19.282 <-
13:57:19.282 <- BU.BEGIN
13:57:19.283 <-
13:57:19.283 <- BU.BEGIN
13:57:19.284 <-
13:57:19.284 <- BU.BEGIN
13:57:19.285 <-
13:57:19.285 <- BU.BEGIN
13:57:19.285 <-
13:57:19.285 <- BU.BEGIN
13:57:19.285 <-
13:57:19.285 <- BU.BEGIN
13:57:19.286 <-
13:57:19.286 <- BU.BEGIN
13:57:19.289 <-
13:57:19.289 <- BU.BEGIN
13:57:19.289 <-
13:57:19.290 <- BU.BEGIN
13:57:19.290 <-
13:57:19.290 <- BU.BEGIN
13:57:19.291 <-
13:57:19.291 <- BU.BEGIN
13:57:19.291 <-
13:57:19.291 <- BU.BEGIN
13:57:19.292 <-
13:57:19.292 <- BU.BEGIN
13:57:19.292 <-
13:57:19.292 <- BU.BEGIN
13:57:19.292 <-
13:57:19.292 <- BU.BEGIN
13:57:19.293 <-
13:57:19.293 <- BU.BEGIN
13:57:19.344 <-
13:57:19.344 <- BU.BEGIN
13:57:19.345 <-
13:57:19.345 <- BU.BEGIN
13:57:19.347 <-
13:57:19.347 <- BU.BEGIN
13:57:19.348 <-
13:57:19.348 <- BU.BEGIN
13:57:19.348 <-
13:57:19.348 <- BU.BEGIN
13:57:19.349 <-
13:57:19.349 <- BU.BEGIN
13:57:19.349 <-
13:57:19.349 <- BU.OK begin fw=9f4362b-dirty board=V5 t=0.00
13:57:19.350 -> BU.INFO
13:57:19.350 <- I (1751) SENS: EVENT 2
13:57:19.350 <- I (1751) SENS: FALLING
13:57:19.350 <- I (1751) SENS: SAFETY BREAK - Relays disabled
13:57:19.446 <- E rmt: hw buffer too small, received symbols truncated
13:57:19.446 <- BU.OK info reset=POWERON heap=150292 min_heap=148304 fw=9f4362b-dirty build=2026-04-27 18:56:21
13:57:49.053 -> BU.FLASH
13:57:49.053 <- I (1871) BT_HID: Scanning for HID devices (3s)...
13:57:49.054 <- I (1871) BT_HID: BLE HID host initialised
13:57:49.054 <- I (1871) WEBSERVER: Initializing webserver...
13:57:49.054 <- I (1871) WEBSERVER: AP LAUNCHING
13:57:49.054 <- I (1891) wifi:wifi driver task: 3ffe2838, prio:23, stack:6656, core=0
13:57:49.054 <- I (1891) wifi:wifi firmware version: ccaebfa
13:57:49.054 <- I (1891) wifi:wifi certification version: v7.0
13:57:49.054 <- I (1891) wifi:config NVS flash: enabled
13:57:49.054 <- I (1891) wifi:config nano formating: disabled
13:57:49.054 <- I (1901) wifi:Init data frame dynamic rx buffer num: 32
13:57:49.055 <- I (1901) wifi:Init static rx mgmt buffer num: 5
13:57:49.055 <- I (1911) wifi:Init management short buffer num: 32
13:57:49.055 <- I (1911) wifi:Init dynamic tx buffer num: 32
13:57:49.055 <- I (1911) wifi:Init static rx buffer size: 1600
13:57:49.055 <- I (1921) wifi:Init static rx buffer num: 10
13:57:49.055 <- I (1921) wifi:Init dynamic rx buffer num: 32
13:57:49.055 <- I (1931) wifi_init: rx ba win: 6
13:57:49.056 <- I (1931) wifi_init: accept mbox: 6
13:57:49.056 <- I (1931) wifi_init: tcpip mbox: 32
13:57:49.056 <- I (1941) wifi_init: udp mbox: 6
13:57:49.056 <- I (1941) wifi_init: tcp mbox: 6
13:57:49.056 <- I (1951) wifi_init: tcp tx win: 5760
13:57:49.056 <- I (1951) wifi_init: tcp rx win: 5760
13:57:49.056 <- I (1951) wifi_init: tcp mss: 1440
13:57:49.056 <- I (2241) wifi:mode : softAP (80:f3:da:65:45:4d)
13:57:49.056 <- I (2251) wifi:Total power save buffer number: 16
13:57:49.056 <- I (2251) wifi:Init max length of beacon: 752/752
13:57:49.056 <- I (2251) wifi:Init max length of beacon: 752/752
13:57:49.057 <- I (2251) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
13:57:49.057 <- I (2261) DNS_SERVER: DNS server started on port 53
13:57:49.057 <- I (2271) mdns_mem: mDNS task will be created from internal RAM
13:57:49.057 <- I (2271) WEBSERVER: SoftAP ready. SSID: sc.local, Channel: 6, Password: password
13:57:49.058 <- I (2281) WEBSERVER: Access at: http://sc.local.local or http://192.168.4.1
13:57:49.058 <- I (2291) WEBSERVER: STARTING HTTP
13:57:49.058 <- I (2301) WEBSERVER: HTTP server started successfully
13:57:49.058 <- I (2301) WEBSERVER: Registered URI handler: /
13:57:49.058 <- I (2301) WEBSERVER: Registered URI handler: /get
13:57:49.058 <- I (2311) WEBSERVER: Registered URI handler: /post
13:57:49.058 <- I (2311) WEBSERVER: Registered URI handler: /log
13:57:49.059 <- I (2321) WEBSERVER: Registered URI handler: /ota
13:57:49.059 <- I (2321) WEBSERVER: Registered URI handler: /*
13:57:49.059 <- I (2331) WEBSERVER: Webserver initialization complete
13:57:49.059 <- I (4881) BT_HID: Found 0 HID device(s)
13:57:49.060 <- I (4881) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.060 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.060 <- I (6881) BT_HID: Scanning for HID devices (3s)...
13:57:49.060 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.060 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.060 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.060 <- I (9891) BT_HID: Found 0 HID device(s)
13:57:49.060 <- I (9891) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.061 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.061 <- I (11891) BT_HID: Scanning for HID devices (3s)...
13:57:49.061 <- I (14901) BT_HID: Found 0 HID device(s)
13:57:49.061 <- I (14901) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.061 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.062 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.062 <- I (16901) BT_HID: Scanning for HID devices (3s)...
13:57:49.062 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.062 <- I (19911) BT_HID: Found 0 HID device(s)
13:57:49.062 <- I (19911) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.062 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.062 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.062 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.063 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.063 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.063 <- I (21911) BT_HID: Scanning for HID devices (3s)...
13:57:49.063 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.063 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.064 <- I (24921) BT_HID: Found 0 HID device(s)
13:57:49.064 <- I (24921) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.064 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.064 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.064 <- I (26921) BT_HID: Scanning for HID devices (3s)...
2mI (29931) BT_HID: Found 0 HID device(s)
13:57:49.065 <- I (29931) BT_HID: No HID devices found, retrying in 2000ms...
13:57:49.573 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.573 <- E rmt: hw buffer too small, received symbols truncated
13:57:49.573 <- BU.OK flash post_part=roundtrip log_head=11 log_tail=0 partitions_size=4128768
13:57:50.410 -> BU.I2C
13:57:50.411 <- I (31931) BT_HID: Scanning for HID devices (3s)...
13:57:50.921 <- E rmt: hw buffer too small, received symbols truncated
13:57:50.921 <- E rmt: hw buffer too small, received symbols truncated
13:57:50.921 <- I (32861) I2C: POST: TCA9555 OK (port0=0x0023)
13:57:50.921 <- BU.OK i2c tca9555=ack
13:57:50.923 -> BU.LED.WATCH
13:57:51.430 <- BU.EVENT led t=31.73 pressed=0
13:57:52.707 <- E rmt: hw buffer too small, received symbols truncated
13:57:52.707 <- I (34941) BT_HID: Found 0 HID device(s)
13:57:52.707 <- I (34941) BT_HID: No HID devices found, retrying in 2000ms...
13:57:52.707 <- BU.EVENT led t=33.33 pressed=1
13:57:53.221 <- E rmt: hw buffer too small, received symbols truncated
13:57:53.221 <- BU.EVENT led t=33.51 pressed=0
13:57:53.221 <- E rmt: hw buffer too small, received symbols truncated
13:57:54.231 <- E rmt: hw buffer too small, received symbols truncated
13:57:54.737 <- I (36941) BT_HID: Scanning for HID devices (3s)...
13:57:55.744 <- E rmt: hw buffer too small, received symbols truncated
13:57:56.250 <- BU.EVENT led t=36.69 pressed=1
13:57:57.258 <- E rmt: hw buffer too small, received symbols truncated
13:57:57.258 <- BU.EVENT led t=37.91 pressed=0
13:57:57.762 <- I (39951) BT_HID: Found 0 HID device(s)
13:57:57.762 <- I (39951) BT_HID: No HID devices found, retrying in 2000ms...
13:57:58.265 <- E rmt: hw buffer too small, received symbols truncated
13:57:59.050 ->
13:57:59.272 <- BU.OK led.watch done
13:58:00.441 -> BU.ADC
13:58:00.954 <- I (41951) BT_HID: Scanning for HID devices (3s)...

BIN
BRINGUP_27APR2026_1407.txt Normal file

Binary file not shown.

316
BRINGUP_27APR2026_1541.txt Normal file
View File

@@ -0,0 +1,316 @@
15:41:24.233
------------------------------------------------------------
Flashing COM3
------------------------------------------------------------
15:41:24.235 erase_flash @ COM3
15:41:27.392 flashing from D:\SC\SC-F001\build
15:41:27.393 files: [('0x1000', 'bootloader/bootloader.bin'), ('0x10000', 'SC-F001.bin'), ('0x8000', 'partition_table/partition-table.bin'), ('0xd000', 'ota_data_initial.bin')]
15:41:52.476 Flash complete
15:41:53.977 Connecting to COM3 @ 115200 ...
15:41:53.983 -> BU.BEGIN
15:41:54.223 <- BU.BEGIN
15:41:54.223 <-
15:41:54.223 <-
15:41:54.223 <- BU.OK begin fw=9f4362b-dirty board=V5 t=0.00
15:41:54.225 -> BU.INFO
15:41:54.225 <- I (1741) SENS: EVENT 2
15:41:54.237 <- I (1741) SENS: FALLING
15:41:54.237 <- I (1741) SENS: SAFETY BREAK - Relays disabled
15:41:54.237 <- E rmt: hw buffer too small, received symbols truncated
15:41:54.243 <- I (1861) BT_HID: Scanning for HID devices (3s)...
15:41:54.243 <- I (1861) BT_HID: BLE HID host initialised
15:41:54.243 <- I (1861) WEBSERVER: Initializing webserver...
15:41:54.243 <- I (1861) WEBSERVER: AP LAUNCHING
15:41:54.264 <- I (1881) wifi:wifi driver task: 3ffe284c, prio:23, stack:6656, core=0
15:41:54.264 <-
15:41:54.264 <- BU.OK info reset=POWERON heap=118580 min_heap=118492 fw=9f4362b-dirty build=2026-04-27 20:32:37
15:41:57.947 -> BU.FLASH
15:41:57.947 <- I (1881) wifi:wifi firmware version: ccaebfa
15:41:57.947 <- I (1881) wifi:wifi certification version: v7.0
15:41:57.947 <- I (1891) wifi:config NVS flash: enabled
15:41:57.948 <- I (1891) wifi:config nano formating: disabled
15:41:57.948 <- I (1901) wifi:Init data frame dynamic rx buffer num: 32
15:41:57.948 <- I (1901) wifi:Init static rx mgmt buffer num: 5
15:41:57.948 <- I (1901) wifi:Init management short buffer num: 32
15:41:57.948 <- I (1911) wifi:Init dynamic tx buffer num: 32
15:41:57.948 <- I (1911) wifi:Init static rx buffer size: 1600
15:41:57.949 <- I (1921) wifi:Init static rx buffer num: 10
15:41:57.949 <- I (1921) wifi:Init dynamic rx buffer num: 32
15:41:57.949 <- I (1931) wifi_init: rx ba win: 6
15:41:57.949 <- I (1931) wifi_init: accept mbox: 6
15:41:57.949 <- I (1931) wifi_init: tcpip mbox: 32
15:41:57.949 <- I (1941) wifi_init: udp mbox: 6
15:41:57.949 <- I (1941) wifi_init: tcp mbox: 6
15:41:57.949 <- I (1941) wifi_init: tcp tx win: 5760
15:41:57.949 <- I (1951) wifi_init: tcp rx win: 5760
15:41:57.949 <- I (1951) wifi_init: tcp mss: 1440
15:41:57.950 <- I (2241) wifi:mode : softAP (80:f3:da:65:45:4d)
15:41:57.950 <- I (2251) wifi:Total power save buffer number: 16
15:41:57.950 <- I (2251) wifi:Init max length of beacon: 752/752
15:41:57.950 <- I (2251) wifi:Init max length of beacon: 752/752
15:41:57.950 <- I (2251) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
15:41:57.950 <- I (2261) DNS_SERVER: DNS server started on port 53
15:41:57.950 <- I (2271) mdns_mem: mDNS task will be created from internal RAM
15:41:57.951 <- I (2271) WEBSERVER: SoftAP ready. SSID: sc.local, Channel: 6, Password: password
15:41:57.951 <- I (2281) WEBSERVER: Access at: http://sc.local.local or http://192.168.4.1
15:41:57.951 <- I (2291) WEBSERVER: STARTING HTTP
15:41:57.951 <- I (2291) WEBSERVER: HTTP server started successfully
15:41:57.952 <- I (2301) WEBSERVER: Registered URI handler: /
15:41:57.952 <- I (2301) WEBSERVER: Registered URI handler: /get
15:41:57.952 <- I (2311) WEBSERVER: Registered URI handler: /post
15:41:57.952 <- I (2311) WEBSERVER: Registered URI handler: /log
15:41:57.977 <- I (2321) WEBSERVER: Registered URI handler: /ota
15:41:57.977 <- I (2321) WEBSERVER: Registered URI handler: /*
15:41:57.977 <- I (2331) WEBSERVER: Webserver initialization complete
15:41:57.977 <- I (4871) BT_HID: Found 0 HID device(s)
15:41:57.977 <- I (4871) BT_HID: No HID devices found, retrying in 2000ms...
15:41:57.977 <-
15:41:58.486 <- BU.OK flash post_part=roundtrip log_head=11 log_tail=0 partitions_size=4128768
15:41:59.355 -> BU.I2C
15:41:59.863 <- I (6871) BT_HID: Scanning for HID devices (3s)...
15:41:59.863 <- I (7021) I2C: POST: TCA9555 OK (port0=0x0021)
15:41:59.863 <-
15:41:59.863 <- BU.OK i2c tca9555=ack
15:41:59.865 -> BU.LED.WATCH
15:42:00.367 <-
15:42:00.367 <- BU.EVENT led t=5.89 pressed=0
15:42:01.883 <- E rmt: hw buffer too small, received symbols truncated
15:42:01.883 <- E rmt: hw buffer too small, received symbols truncated
15:42:02.387 <- I (9881) BT_HID: Found 0 HID device(s)
15:42:02.387 <- I (9881) BT_HID: No HID devices found, retrying in 2000ms...
15:42:02.693 ->
15:42:02.893 <-
15:42:02.893 <- BU.OK led.watch done
15:42:04.011 -> BU.ADC
15:42:04.527 <-
15:42:04.527 <- BU.OK adc bat_mv=1695 bat_V=13.395 isens_mv=1672 isens_A=-1.67
15:42:04.533 -> BU.PARAM GET V_SENS_K
15:42:04.533 <- I (11881) BT_HID: Scanning for HID devices (3s)...
15:42:05.036 <-
15:42:05.036 <- BU.OK param key=V_SENS_K value=0.00766666653
15:42:05.036 -> BU.ADC
15:42:05.541 <-
15:42:05.541 <- BU.OK adc bat_mv=1686 bat_V=13.326 isens_mv=1674 isens_A=-1.82
15:42:20.017 -> BU.PARAM SET V_SENS_OFFSET 0.094000
15:42:20.018 <- E rmt: hw buffer too small, received symbols truncated
15:42:20.018 <- I (14891) BT_HID: Found 0 HID device(s)
15:42:20.018 <- I (14891) BT_HID: No HID devices found, retrying in 2000ms...
15:42:20.018 <- I (16891) BT_HID: Scanning for HID devices (3s)...
15:42:20.018 <- I (19901) BT_HID: Found 0 HID device(s)
15:42:20.018 <- I (19901) BT_HID: No HID devices found, retrying in 2000ms...
15:42:20.018 <- E rmt: hw buffer too small, received symbols truncated
15:42:20.018 <- I (21901) BT_HID: Scanning for HID devices (3s)...
15:42:20.044 <- E rmt: hw buffer too small, received symbols truncated
15:42:20.044 <- I (24911) BT_HID: Found 0 HID device(s)
15:42:20.044 <- I (24911) BT_HID: No HID devices found, retrying in 2000ms...
15:42:20.044 <- I (26911) BT_HID: Scanning for HID devices (3s)...
15:42:20.553 <- I (27681) STORAGE: Parameter 34 (V_SENS_OFFSET) set (not committed)
15:42:20.553 <- I (27681) STORAGE: Committing 49 parameters to flash...
15:42:20.553 <- I (27711) STORAGE: Successfully committed all parameters to flash
15:42:20.553 <-
15:42:20.553 <- BU.OK param key=V_SENS_OFFSET set=ok committed=yes
15:42:20.553 -> BU.PARAM GET V_SENS_OFFSET
15:42:21.059 <-
15:42:21.059 <- BU.OK param key=V_SENS_OFFSET value=0.0939999968
15:42:21.059 -> BU.ADC
15:42:21.060 <- E rmt: hw buffer too small, received symbols truncated
15:42:21.060 <- E rmt: hw buffer too small, received symbols truncated
15:42:21.565 <-
15:42:21.565 <- BU.OK adc bat_mv=1688 bat_V=13.035 isens_mv=1666 isens_A=-1.21
15:42:21.571 -> BU.SENSORS.WATCH 0
15:42:22.073 <-
15:42:22.073 <- BU.EVENT state t=27.59 SAFETY=0 DRIVE=0 JACK=0 AUX=0 isr_s=0 isr_d=0 isr_j=3 isr_a=0
15:42:22.073 <-
15:42:22.073 <- BU.EVENT sensor name=JACK edge=make t=27.69
15:42:22.076 <-
15:42:22.076 <- BU.EVENT state t=27.85 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:22.353 <-
15:42:22.353 <- BU.EVENT state t=28.10 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:22.353 <- I (29921) BT_HID: Found 0 HID device(s)
15:42:22.353 <- I (29921) BT_HID: No HID devices found, retrying in 2000ms...
15:42:22.353 <-
15:42:22.854 <- BU.EVENT state t=28.35 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:22.854 <-
15:42:22.854 <- BU.EVENT state t=28.60 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:22.855 <-
15:42:23.355 <- BU.EVENT state t=28.85 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:23.355 <-
15:42:23.355 <- BU.EVENT state t=29.10 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:23.355 <- E rmt: hw buffer too small, received symbols truncated
15:42:23.355 <-
15:42:23.865 <- BU.EVENT state t=29.35 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:23.865 <-
15:42:23.865 <- BU.EVENT state t=29.60 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:23.865 <- E rmt: hw buffer too small, received symbols truncated
15:42:23.865 <-
15:42:23.865 <- BU.EVENT state t=29.85 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:24.372 <-
15:42:24.372 <- BU.EVENT state t=30.10 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:24.372 <- I (31921) BT_HID: Scanning for HID devices (3s)...
15:42:24.372 <-
15:42:24.372 <- BU.EVENT state t=30.35 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:24.875 <-
15:42:24.875 <- BU.EVENT state t=30.60 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:24.875 <- E rmt: hw buffer too small, received symbols truncated
15:42:24.875 <-
15:42:24.875 <- BU.EVENT state t=30.85 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:25.382 <-
15:42:25.382 <- BU.EVENT state t=31.10 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:25.382 <-
15:42:25.382 <- BU.EVENT state t=31.35 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:25.886 <-
15:42:25.886 <- BU.EVENT state t=31.60 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:25.886 <-
15:42:25.886 <- BU.EVENT state t=31.85 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:26.390 <-
15:42:26.390 <- BU.EVENT state t=32.10 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:26.390 <-
15:42:26.390 <- BU.EVENT state t=32.35 SAFETY=0 DRIVE=0 JACK=1 AUX=0 isr_s=0 isr_d=0 isr_j=4 isr_a=0
15:42:26.894 <-

BIN
BRINGUP_27APR2026_1606.txt Normal file

Binary file not shown.

BIN
BRINGUP_27APR2026_1623.txt Normal file

Binary file not shown.

BIN
BRINGUP_27APR2026_1654.txt Normal file

Binary file not shown.

BIN
BRINGUP_27APR2026_1717.txt Normal file

Binary file not shown.

View File

@@ -130,40 +130,50 @@ def main() -> int:
t.passed, t.failed, t.warnings, t.skipped = snap
try:
for stage in stages:
while True:
snap = _snapshot(tally)
try:
stage(link, tally)
except TimeoutError as e:
print(f" TIMEOUT: {e}")
tally.note_fail()
except Exception as e:
print(f" EXCEPTION in stage: {e!r}")
tally.note_fail()
if tally.failed > snap[1]:
ans = input(fmt.prompt(" Stage had FAILs — retry? [y/n]") + ": ").strip().lower()
if ans.startswith("y"):
_restore(tally, snap)
continue
break
except KeyboardInterrupt:
print(fmt.warn("\nAborted by operator"))
try:
link.send("BU.END")
for stage in stages:
while True:
snap = _snapshot(tally)
try:
stage(link, tally)
except TimeoutError as e:
print(f" TIMEOUT: {e}")
tally.note_fail()
except Exception as e:
print(f" EXCEPTION in stage: {e!r}")
tally.note_fail()
if tally.failed > snap[1]:
ans = input(fmt.prompt(" Stage had FAILs — retry? [y/n]") + ": ").strip().lower()
if ans.startswith("y"):
_restore(tally, snap)
continue
break
except KeyboardInterrupt:
print(fmt.warn("\nAborted by operator"))
try:
link.send("BU.END")
except Exception:
pass
print(fmt.stage("Bring-up summary"))
print(fmt.summary_line(tally.passed, tally.failed, tally.warnings, tally.skipped))
if tally.failed == 0:
print(f" {fmt.pass_('ALL PASS')}")
else:
print(f" {fmt.fail('FAILURES PRESENT — review above')}")
finally:
# Close link + transcript deterministically — Python would clean up
# on interpreter exit, but on KeyboardInterrupt or other unexpected
# exits the file handle should be released as soon as we leave main.
try:
link.close()
except Exception:
pass
print(fmt.stage("Bring-up summary"))
print(fmt.summary_line(tally.passed, tally.failed, tally.warnings, tally.skipped))
if tally.failed == 0:
print(f" {fmt.pass_('ALL PASS')}")
else:
print(f" {fmt.fail('FAILURES PRESENT — review above')}")
link.close()
if transcript_file:
transcript_file.close()
if transcript_file:
try:
transcript_file.close()
except Exception:
pass
return 0 if tally.failed == 0 else 1

View File

@@ -3,11 +3,12 @@ runnable from the operator prompt — no implicit sequencing between them."""
from __future__ import annotations
import time
from dataclasses import dataclass
from typing import Callable
import fmt
from protocol import Link, Response, Event
from protocol import Link, Response, Event, parse_line
@dataclass
@@ -23,18 +24,9 @@ class Tally:
def note_warn(self) -> None: self.warnings += 1
def _prompt(msg: str, accept_skip: bool = True) -> str:
"""Block for operator input. Returns 'run', 'skip', or 'quit'."""
hint = fmt.dim(" [Enter=run" + (", s=skip" if accept_skip else "") + ", q=quit]")
ans = input(fmt.prompt(msg) + hint + ": ").strip().lower()
if ans in ("", "y", "yes", "r", "run"):
return "run"
if ans in ("s", "skip") and accept_skip:
return "skip"
if ans in ("q", "quit", "exit"):
return "quit"
# anything else — treat as run, operator can always quit with Ctrl-C
return "run"
def _prompt(msg: str) -> None:
"""Block until operator presses Enter (Ctrl-C still aborts)."""
input(fmt.prompt(msg) + fmt.dim(" [Enter to continue]") + ": ")
def _show_response(label: str, r: Response) -> None:
@@ -66,8 +58,7 @@ def stage_begin(link: Link, t: Tally) -> None:
def stage_flash(link: Link, t: Tally) -> None:
print(fmt.stage("Stage 1 — Flash & storage"))
if _prompt(" Run flash roundtrip + log head/tail check") != "run":
t.note_skip(); return
_prompt(" Run flash roundtrip + log head/tail check")
r = link.request("BU.FLASH", overall_timeout_s=10)
_show_response("flash", r)
(t.note_pass if r.status == "OK" else t.note_fail)()
@@ -81,8 +72,7 @@ def stage_i2c_led(link: Link, t: Tally) -> None:
import threading
print(fmt.stage("Stage 2 — I2C / TCA9555 / LEDs"))
if _prompt(" Probe TCA9555 and run LED check") != "run":
t.note_skip(); return
_prompt(" Probe TCA9555 and run LED check")
r = link.request("BU.I2C")
_show_response("i2c", r)
@@ -133,8 +123,7 @@ def stage_i2c_led(link: Link, t: Tally) -> None:
def stage_adc(link: Link, t: Tally, calibrate: bool = True) -> None:
print(fmt.stage("Stage 3 — Analog front-end"))
if _prompt(" Read ADC snapshot (battery / motor current)") != "run":
t.note_skip(); return
_prompt(" Read ADC snapshot (battery / motor current)")
r = link.request("BU.ADC")
_show_response("adc", r)
@@ -158,12 +147,6 @@ def _run_battery_cal(link: Link, t: Tally) -> None:
from calibrate import single_point_offset, verify
print(fmt.section("Battery voltage calibration"))
while True:
ans = input(" Run calibration now? [y/n]: ").strip().lower()
if ans.startswith("n"):
t.note_skip(); return
if ans.startswith("y"):
break
# Read current K and raw mV.
k_r = link.request("BU.PARAM GET V_SENS_K")
@@ -173,8 +156,10 @@ def _run_battery_cal(link: Link, t: Tally) -> None:
adc_r = link.request("BU.ADC")
bat_mv = adc_r.getf("bat_mv")
if bat_mv == 0.0:
print(" ADC read looks bogus (mv=0)"); t.note_fail(); return
# ADC noise rarely lands on exactly 0; check against a small range so a
# near-floor reading still flags as bogus.
if bat_mv < 50:
print(f" ADC read looks bogus (mv={bat_mv:.0f})"); t.note_fail(); return
raw_ans = input(" Measure the battery at the board terminals with a DMM.\n"
" Enter true voltage (V): ").strip()
@@ -183,29 +168,55 @@ def _run_battery_cal(link: Link, t: Tally) -> None:
except ValueError:
print(" Not a number — skipping cal"); t.note_skip(); return
# Sanity-check the operator-supplied true voltage. The system runs on a
# nominal 12-24 V battery; values outside 5..30 V are almost certainly a
# typo or DMM unit mistake (e.g. mV instead of V).
if not (5.0 <= v_true <= 30.0):
print(f" v_true={v_true:.3f} V is outside plausible 5..30 V range")
t.note_fail(); return
cal = single_point_offset(bat_mv, v_true, k)
predicted = verify(bat_mv, cal)
print(f" bat_mv={bat_mv:.0f} K={k:.10f} new OFFSET={cal.offset:+.6f} V")
print(f" predicted V_bat after cal = {predicted:.3f} (true = {v_true:.3f})")
if input(" Write this to the device? [y/n]: ").strip().lower().startswith("y"):
wr = link.request(f"BU.PARAM SET V_SENS_OFFSET {cal.offset:.6f}")
_show_response("param.set", wr)
if wr.status != "OK":
t.note_fail(); return
# Verify by re-reading the ADC
check = link.request("BU.ADC")
new_V = check.getf("bat_V")
err = new_V - v_true
print(f" Post-cal bat_V = {new_V:.3f} (err {err*1000:+.1f} mV)")
if abs(err) < 0.05:
t.note_pass()
else:
print(" WARN: residual error > 50 mV")
t.note_warn()
# Sanity-check the computed offset. Default is 0.4 V; |offset| > 2 V means
# something else is wrong (broken divider, wrong K, ADC ref off).
if abs(cal.offset) > 2.0:
print(f" {fmt.fail('FAIL')}: |offset|={abs(cal.offset):.3f} V exceeds 2 V — "
f"check divider / K / DMM units")
t.note_fail(); return
wr = link.request(f"BU.PARAM SET V_SENS_OFFSET {cal.offset:.6f}")
_show_response("param.set", wr)
if wr.status != "OK":
t.note_fail(); return
# Read it back to confirm storage actually persisted what we sent.
rb = link.request("BU.PARAM GET V_SENS_OFFSET")
if rb.status != "OK":
print(" Could not read back V_SENS_OFFSET"); t.note_fail(); return
stored = rb.getf("value")
if abs(stored - cal.offset) > 1e-4:
print(f" {fmt.fail('FAIL')}: readback {stored:+.6f} != written {cal.offset:+.6f}")
t.note_fail(); return
# Verify by re-reading the ADC. Firmware's cmd_adc_once now bypasses the
# EMA, so bat_V here reflects the new offset immediately.
check = link.request("BU.ADC")
new_V = check.getf("bat_V")
err = new_V - v_true
print(f" Post-cal bat_V = {new_V:.3f} (err {err*1000:+.1f} mV)")
abs_err = abs(err)
if abs_err < 0.020:
print(f" {fmt.pass_('PASS')}: cal residual within ±20 mV")
t.note_pass()
elif abs_err < 0.050:
print(f" {fmt.warn('WARN')}: residual {err*1000:+.1f} mV (>20, <50 mV)")
t.note_warn()
else:
print(" Calibration not written (operator declined)")
t.note_skip()
print(f" {fmt.fail('FAIL')}: residual {err*1000:+.1f} mV exceeds 50 mV")
t.note_fail()
# ---------------------------------------------------------------------------
@@ -293,11 +304,11 @@ def stage_sensors(link: Link, t: Tally) -> None:
# check_edges → bridge has an encoder-style sensor; pulse must produce
# at least one edge on it.
RELAY_TESTS = [
("SENSORS", "ON", 200, (0.0, 0.0), False),
("DRIVE", "FWD", 1000, (0.5, 25.0), True),
("DRIVE", "REV", 1000, (0.5, 25.0), True),
("JACK", "UP", 500, (0.2, 25.0), True),
("JACK", "DOWN", 500, (0.2, 25.0), True),
("SENSORS", "ON", 500, (0.0, 0.0), False),
("DRIVE", "FWD", 3000, (0.5, 25.0), True),
("DRIVE", "REV", 3000, (0.5, 25.0), True),
("JACK", "UP", 1200, (0.2, 25.0), True),
("JACK", "DOWN", 1200, (0.2, 25.0), True),
("AUX", "FWD", 150, (0.1, 25.0), False),
]
@@ -308,13 +319,9 @@ def stage_relays(link: Link, t: Tally) -> None:
print(" - Battery connected, fuse in place")
print(" - Drive wheels off ground / disengaged")
print(" - Safety interlock asserted (SAFETY sensor HIGH)")
if _prompt(" Proceed with live relay tests", accept_skip=True) != "run":
print(" Relay stage SKIPPED"); t.note_skip(); return
for bridge, direction, ms, (lo, hi), check_edges in RELAY_TESTS:
prompt = f" Pulse {bridge} {direction} for {ms} ms"
if _prompt(prompt) != "run":
t.note_skip(); continue
_prompt(f" Pulse {bridge} {direction} for {ms} ms")
r = link.request(f"BU.RELAY {bridge} {direction} {ms}",
overall_timeout_s=ms / 1000.0 + 5.0)
_show_response(f"{bridge}/{direction}", r)
@@ -330,9 +337,12 @@ def stage_relays(link: Link, t: Tally) -> None:
delta = abs(i_mid - i_before)
tripped = r.geti("tripped") == 1
edges = r.geti("edges")
stop = r.get("stop", "time")
actual_ms = r.geti("actual_ms", ms)
edge_str = f" edges={edges}" if check_edges else ""
stop_str = f" stop={stop} ({actual_ms}/{ms} ms)" if stop != "time" else ""
print(f" |ΔI| = {delta:.2f} A (expected {lo}-{hi}) "
f"tripped={tripped}{edge_str}")
f"tripped={tripped}{edge_str}{stop_str}")
if tripped:
print(f" {fmt.fail('FAIL')}: efuse tripped"); t.note_fail(); continue
@@ -354,8 +364,7 @@ def stage_rf(link: Link, t: Tally) -> None:
import threading
print(fmt.stage("Stage 6a — RF 433 MHz"))
if _prompt(" Watch for RF remote codes") != "run":
t.note_skip(); return
_prompt(" Watch for RF remote codes")
print(" Press buttons on the RF remote. Codes will print live.")
print(" Press Enter to stop.")
@@ -388,8 +397,7 @@ def stage_rf(link: Link, t: Tally) -> None:
def stage_wifi(link: Link, t: Tally) -> None:
print(fmt.stage("Stage 6b — WiFi + web UI"))
if _prompt(" Start SoftAP and wait for a client to load the web UI") != "run":
t.note_skip(); return
_prompt(" Start SoftAP and wait for a client to load the web UI")
r = link.request("BU.WIFI.START", overall_timeout_s=20)
_show_response("wifi.start", r)
if r.status != "OK":
@@ -407,6 +415,22 @@ def stage_wifi(link: Link, t: Tally) -> None:
break
except KeyboardInterrupt:
print(" WiFi wait aborted by operator"); t.note_skip()
# Push a byte so the firmware's cmd_wifi_wait breaks out of its
# loop and unblocks the bring-up dispatcher; otherwise BU.END
# never reaches the device and the reboot doesn't happen.
# Then drain the resulting wifi.wait OK so it doesn't get
# mistaken for the response to a later command.
try:
link.send("")
deadline = time.monotonic() + 2.0
while time.monotonic() < deadline:
line = link._readline(deadline)
if line is None:
break
if isinstance(parse_line(line), Response):
break
except Exception:
pass
# ---------------------------------------------------------------------------
@@ -415,9 +439,7 @@ def stage_wifi(link: Link, t: Tally) -> None:
def stage_end(link: Link, t: Tally) -> None:
print(fmt.stage("Stage — End"))
if _prompt(" Exit bring-up mode (device will reboot)") != "run":
print(" Leaving device in bring-up mode — reset manually to resume normal firmware.")
return
_prompt(" Exit bring-up mode (device will reboot)")
r = link.request("BU.END", overall_timeout_s=5)
_show_response("end", r)
# Device reboots; no further response expected.

View File

@@ -28,51 +28,48 @@ def _row(e: dict) -> list:
e.get('time_str', ''),
name,
f"{e.get('bat_V', 0):.3f}",
f"{e.get('drive_A', 0):.2f}",
f"{e.get('jack_A', 0):.2f}",
f"{e.get('aux_A', 0):.2f}",
f"{e.get('current_A', 0):.2f}",
str(e.get('counter', 0)),
_sensor_str(e.get('sensors_stable', 0)),
_sensor_str(e.get('sensors_raw', 0)),
f"{e.get('drive_heat', 0):.1f}",
f"{e.get('jack_heat', 0):.1f}",
f"{e.get('aux_heat', 0):.1f}",
f"{e.get('heat', 0):.1f}",
f"0x{e.get('i2c_out', 0):04X}",
]
elif t == LOG_TYPE_BAT:
return [
e.get('time_str', ''),
'BAT',
f"{e.get('bat_V', 0):.3f}",
'', '', '', '', '', '', '', '', '',
'', '', '', '', '', '',
]
elif t == LOG_TYPE_CRASH:
return [
e.get('time_str', ''),
f"*** CRASH: {e.get('reason_str', '?')}",
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '',
]
elif t == LOG_TYPE_BOOT:
return [
e.get('time_str', ''),
f"BOOT rst={e.get('reason_str', '?')} wake={e.get('wake_str', '?')}",
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '',
]
elif t == LOG_TYPE_TIME_SET:
return [
e.get('time_str', ''),
'TIME_SET',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '',
]
else:
return [
e.get('time_str', ''),
name,
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '',
]
_HEADERS = ['Time', 'State', 'Bat(V)', 'Drive(A)', 'Jack(A)', 'Aux(A)',
'Counter', 'Stable', 'Raw', 'DrHeat', 'JkHeat', 'AxHeat']
_HEADERS = ['Time', 'State', 'Bat(V)', 'Cur(A)',
'Counter', 'Stable', 'Raw', 'Heat', 'I2COut']
def print_table(entries: list, type_filter: str = None):

View File

@@ -73,15 +73,12 @@ def show_plots(entries: list, title: str = "SC-F001 Log"):
add_crash_lines(ax0)
ax0.grid(True, alpha=0.3)
# 2. Currents
# 2. Current (single channel — V5 has one shared sensor)
ax1 = axes[1]
ax1.set_ylabel('Current (A)')
if fsm:
ts = to_dt(_ts_arr(fsm))
ax1.plot(ts, _val_arr(fsm, 'drive_A'), label='Drive', linewidth=1)
ax1.plot(ts, _val_arr(fsm, 'jack_A'), label='Jack', linewidth=1)
ax1.plot(ts, _val_arr(fsm, 'aux_A'), label='Aux', linewidth=1)
ax1.legend(fontsize=8, loc='upper right')
ax1.plot(ts, _val_arr(fsm, 'current_A'), color='orange', linewidth=1)
add_crash_lines(ax1)
ax1.grid(True, alpha=0.3)
@@ -102,15 +99,12 @@ def show_plots(entries: list, title: str = "SC-F001 Log"):
add_crash_lines(ax2)
ax2.grid(True, alpha=0.3)
# 4. Thermal accumulators
# 4. Thermal accumulator (single — max of bridge heats)
ax3 = axes[3]
ax3.set_ylabel('Heat (I²t)')
if fsm:
ts = to_dt(_ts_arr(fsm))
ax3.plot(ts, _val_arr(fsm, 'drive_heat'), label='Drive', linewidth=1)
ax3.plot(ts, _val_arr(fsm, 'jack_heat'), label='Jack', linewidth=1)
ax3.plot(ts, _val_arr(fsm, 'aux_heat'), label='Aux', linewidth=1)
ax3.legend(fontsize=8, loc='upper right')
ax3.plot(ts, _val_arr(fsm, 'heat'), color='red', linewidth=1)
add_crash_lines(ax3)
ax3.grid(True, alpha=0.3)
@@ -140,17 +134,11 @@ def live_plot(url: str, interval_s: float = 2.0):
ax.grid(True, alpha=0.3)
lines = {
'bat': axes[0].plot([], [], color='green', linewidth=1)[0],
'drive': axes[1].plot([], [], label='Drive', linewidth=1)[0],
'jack': axes[1].plot([], [], label='Jack', linewidth=1)[0],
'aux': axes[1].plot([], [], label='Aux', linewidth=1)[0],
'state': axes[2].step([], [], where='post', linewidth=1, color='navy')[0],
'drheat': axes[3].plot([], [], label='Drive', linewidth=1)[0],
'jkheat': axes[3].plot([], [], label='Jack', linewidth=1)[0],
'axheat': axes[3].plot([], [], label='Aux', linewidth=1)[0],
'bat': axes[0].plot([], [], color='green', linewidth=1)[0],
'current': axes[1].plot([], [], color='orange', linewidth=1)[0],
'state': axes[2].step([], [], where='post', linewidth=1, color='navy')[0],
'heat': axes[3].plot([], [], color='red', linewidth=1)[0],
}
axes[1].legend(fontsize=8, loc='upper right')
axes[3].legend(fontsize=8, loc='upper right')
axes[3].xaxis.set_major_formatter(mdates.AutoDateFormatter(axes[3].xaxis.get_major_locator()))
state = {'current_tail': 0, 'first': True}
@@ -181,13 +169,9 @@ def live_plot(url: str, interval_s: float = 2.0):
if fsm:
ts = to_dt([e['ts_ms'] for e in fsm])
lines['drive'].set_data(ts, [e.get('drive_A', 0) for e in fsm])
lines['jack'].set_data( ts, [e.get('jack_A', 0) for e in fsm])
lines['aux'].set_data( ts, [e.get('aux_A', 0) for e in fsm])
lines['current'].set_data(ts, [e.get('current_A', 0) for e in fsm])
lines['state'].set_data(ts, [e.get('entry_type', 0) for e in fsm])
lines['drheat'].set_data(ts, [e.get('drive_heat', 0) for e in fsm])
lines['jkheat'].set_data(ts, [e.get('jack_heat', 0) for e in fsm])
lines['axheat'].set_data(ts, [e.get('aux_heat', 0) for e in fsm])
lines['heat'].set_data(ts, [e.get('heat', 0) for e in fsm])
all_bat = sorted(
[e for e in all_entries if 'bat_V' in e],

View File

@@ -109,28 +109,32 @@ def _ts_to_str(ts_ms: int) -> str:
def _unpack_fsm(payload: bytes, fsm_states: dict) -> dict:
if len(payload) < 27:
raise ValueError(f"FSM payload too short: {len(payload)} < 27")
ts_ms, bat_V, drive_A, jack_A, aux_A, counter, sensors = \
struct.unpack_from('<QffffhB', payload, 0)
drive_heat = jack_heat = aux_heat = 0.0
if len(payload) >= 31:
drive_heat, = struct.unpack_from('<f', payload, 27)
if len(payload) >= 39:
jack_heat, aux_heat = struct.unpack_from('<ff', payload, 31)
"""Single-current FSM payload (25 bytes):
ts(8) bat(4) current(4) counter(2) sensors(1) heat(4) i2c_out(2).
V5 hardware has one shared current sensor; V4 had three but only one
bridge is active at a time, so the single channel suffices.
i2c_out is the last-written 16-bit TCA9555 output state
(high byte = OUTPUT0 / LEDs, low byte = OUTPUT1 / relays)."""
if len(payload) < 19:
raise ValueError(f"FSM payload too short: {len(payload)} < 19")
ts_ms, bat_V, current_A, counter, sensors = \
struct.unpack_from('<QffhB', payload, 0)
heat = 0.0
i2c_out = 0
if len(payload) >= 23:
heat, = struct.unpack_from('<f', payload, 19)
if len(payload) >= 25:
i2c_out, = struct.unpack_from('<H', payload, 23)
return {
'ts_ms': ts_ms,
'time_str': _ts_to_str(ts_ms),
'bat_V': round(bat_V, 3),
'drive_A': round(drive_A, 3),
'jack_A': round(jack_A, 3),
'aux_A': round(aux_A, 3),
'current_A': round(current_A, 3),
'counter': counter,
'sensors_stable': sensors & 0x0F,
'sensors_raw': (sensors >> 4) & 0x0F,
'drive_heat': round(drive_heat, 2),
'jack_heat': round(jack_heat, 2),
'aux_heat': round(aux_heat, 2),
'heat': round(heat, 2),
'i2c_out': i2c_out,
}

View File

@@ -80,15 +80,29 @@ static float elapsed_s(void)
/* -------- output helpers -------- */
/* Build the line in a stack buffer and emit with a single write so concurrent
* ESP_LOGx output (notably the wifi driver during BU.WIFI.START) cannot slice
* into the middle of it. Leading '\n' protects against partial lines that
* another task may have written without a terminator. */
__attribute__((format(printf, 2, 3)))
static void emit(const char *kind, const char *fmt, ...)
{
printf("BU.%s ", kind);
char buf[256];
/* Reserve one byte at the end for the trailing '\n' so a long line is
* truncated within the body rather than dropping the newline. Without
* this, a body that filled the buffer would produce a line glued to
* whatever came next on the wire. */
const int cap = (int)sizeof(buf) - 1; // room for '\n'
int n = snprintf(buf, cap, "\nBU.%s ", kind);
if (n < 0) n = 0;
if (n > cap) n = cap;
va_list ap;
va_start(ap, fmt);
vprintf(fmt, ap);
int m = vsnprintf(buf + n, cap - n, fmt, ap);
va_end(ap);
printf("\n");
if (m > 0) n += (m < cap - n) ? m : cap - n;
buf[n++] = '\n';
fwrite(buf, 1, n, stdout);
fflush(stdout);
}
@@ -295,7 +309,12 @@ static void cmd_led_watch(char *args)
static void cmd_adc_once(void)
{
int bat_mv = get_bat_raw_mv();
float bat_V = get_battery_V();
/* Bypass the EMA — process_battery_voltage() runs in the FSM task,
* which is paused while bring-up is active, so get_battery_V() returns
* a stale value that never reflects V_SENS_K / V_SENS_OFFSET writes
* issued during calibration. Compute fresh from raw mV + current params. */
float bat_V = bat_mv * get_param_value_t(PARAM_V_SENS_K).f32
+ get_param_value_t(PARAM_V_SENS_OFFSET).f32;
#ifdef BOARD_V5
/* VOC and FAULT pins are unusable on V5 (input-only ESP32 GPIOs
* without external pulls — see README "V5 hardware caveats"); skip. */
@@ -345,6 +364,9 @@ static void cmd_sensors_watch(char *args)
* on UART0 (operator hit Enter on the host side).
* sec > 0 → watch for that many seconds, then return.
*/
/* Force the sensor rail (P10) up before we observe — covers cases where
* the FSM or sensor task drove it low between boot and BU.BEGIN. */
i2c_relays_idle();
char *s = args;
char *t = next_tok(&s);
int sec = t ? atoi(t) : 0;
@@ -462,7 +484,12 @@ static void cmd_relay(char *args)
if (ms < 10) ms = 10;
if (ms > 2000) ms = 2000;
if (!get_is_safe()) { SKIP("relay reason=\"safety open\""); return; }
/* Read SAFETY directly: sensors_check() runs in the FSM task, which is
* paused while bring-up is active, so is_safe / get_is_safe() are stale.
* Safety pin is active-LOW. */
extern uint8_t sensor_pins[N_SENSORS];
#define _BU_SAFETY_OPEN() (gpio_get_level(sensor_pins[SENSOR_SAFETY]) != 0)
if (_BU_SAFETY_OPEN()) { SKIP("relay reason=\"safety open\""); return; }
/* P10 / sensor power rail. Default is ON; pulse it OFF to prove the line
* can be driven, then restore. */
@@ -511,11 +538,44 @@ static void cmd_relay(char *args)
last_relay_state = rs;
i2c_set_relays(rs);
vTaskDelay(pdMS_TO_TICKS(ms / 2));
fsm_now = esp_timer_get_time();
process_bridge_current(b);
float I_mid = get_bridge_A(b);
vTaskDelay(pdMS_TO_TICKS(ms - ms / 2));
/* JACK DOWN should stop as soon as the JACK sensor goes active (LOW) so
* the bring-up pulse can't drive the actuator into its mechanical limit.
* Other directions/bridges run for the full requested duration. SAFETY
* is checked every iteration regardless of bridge — multi-second pulses
* during bring-up must still kill the motor on a safety break. */
bool jack_down = (b == BRIDGE_JACK && dir == BRIDGE_REV);
bool stopped_by_sensor = false;
bool stopped_by_safety = false;
int64_t pulse_start_us = esp_timer_get_time();
int64_t mid_us = pulse_start_us + (int64_t)(ms / 2) * 1000;
int64_t end_us = pulse_start_us + (int64_t)ms * 1000;
float I_mid = NAN;
while (esp_timer_get_time() < end_us) {
if (_BU_SAFETY_OPEN()) {
stopped_by_safety = true;
break;
}
if (jack_down && gpio_get_level(sensor_pins[SENSOR_JACK]) == 0) {
stopped_by_sensor = true;
break;
}
if (isnan(I_mid) && esp_timer_get_time() >= mid_us) {
fsm_now = esp_timer_get_time();
process_bridge_current(b);
I_mid = get_bridge_A(b);
}
esp_task_wdt_reset();
vTaskDelay(pdMS_TO_TICKS(10));
}
if (isnan(I_mid)) {
/* Sensor tripped before we hit the midpoint; sample current now so
* the response still has a meaningful I_mid. */
fsm_now = esp_timer_get_time();
process_bridge_current(b);
I_mid = get_bridge_A(b);
}
relay_port_t idle = {.bridges = {.SENSORS = 1}};
last_relay_state = idle;
@@ -530,8 +590,15 @@ static void cmd_relay(char *args)
? get_sensor_isr_edges(which_sensor) : 0;
uint32_t edges = edges_after - edges_before;
OK("relay bridge=%s dir=%s ms=%d I_before=%+.2f I_mid=%+.2f I_after=%+.2f heat=%.3f tripped=%d edges=%u",
t_bridge, t_dir, ms, I_before, I_mid, I_after, heat, tripped, (unsigned)edges);
int actual_ms = (int)((esp_timer_get_time() - pulse_start_us) / 1000);
const char *stop_reason =
stopped_by_safety ? "safety" :
stopped_by_sensor ? "sensor" : "time";
OK("relay bridge=%s dir=%s ms=%d actual_ms=%d stop=%s "
"I_before=%+.2f I_mid=%+.2f I_after=%+.2f heat=%.3f tripped=%d edges=%u",
t_bridge, t_dir, ms, actual_ms, stop_reason,
I_before, I_mid, I_after, heat, tripped, (unsigned)edges);
#undef _BU_SAFETY_OPEN
}
static void cmd_rf_watch(char *args)
@@ -588,7 +655,24 @@ static void cmd_wifi_wait(char *args)
(void)args; /* no timeout — BRINGUP.md §4 Stage 6. Operator aborts via Ctrl+C. */
wifi_sta_list_t sta = {0};
int last_n = 0;
bool aborted = false;
while (1) {
/* Abort on any UART input — the host sends a stray byte to break out
* of the wait so that a follow-up BU.END is actually dispatched
* (otherwise the dispatcher stays blocked here forever). */
size_t available = 0;
if (uart_get_buffered_data_len(UART_NUM_0, &available) == ESP_OK
&& available > 0) {
uint8_t drain[64];
while (available > 0) {
int n = uart_read_bytes(UART_NUM_0, drain, sizeof(drain), 0);
if (n <= 0) break;
available = (size_t)n < available ? available - (size_t)n : 0;
}
aborted = true;
break;
}
if (esp_wifi_ap_get_sta_list(&sta) == ESP_OK && sta.num > last_n) {
EVT("wifi.assoc n=%d t=%.2f", sta.num, elapsed_s());
last_n = sta.num;
@@ -599,7 +683,8 @@ static void cmd_wifi_wait(char *args)
esp_task_wdt_reset();
vTaskDelay(pdMS_TO_TICKS(200));
}
OK("wifi.wait clients=%d http_reqs=%d", last_n, s_http_reqs);
OK("wifi.wait clients=%d http_reqs=%d aborted=%d",
last_n, s_http_reqs, aborted ? 1 : 0);
}
static void cmd_fsm(char *args)
@@ -652,6 +737,11 @@ static void cmd_param(char *args)
}
if (strcmp(op, "SET") == 0) {
/* SET writes flash. Require BU.BEGIN to prevent accidental persistence
* from stray BU.PARAM lines outside of an active bring-up session. */
if (!s_active) {
ERR("param reason=\"BU.BEGIN required first\""); return;
}
char *val = next_tok(&s);
if (!val) { ERR("param reason=\"missing value\""); return; }
esp_err_t e = ESP_OK;
@@ -673,6 +763,12 @@ static void cmd_param(char *args)
if (e != ESP_OK) { ERR("param reason=\"set failed\" err=%s", esp_err_to_name(e)); return; }
e = commit_params();
if (e != ESP_OK) { ERR("param reason=\"commit failed\" err=%s", esp_err_to_name(e)); return; }
/* If the conversion params changed, refresh the battery EMA so
* get_battery_V() returns a value consistent with the new K/OFFSET
* immediately rather than decaying through the EMA. */
if (idx == PARAM_V_SENS_K || idx == PARAM_V_SENS_OFFSET) {
reset_battery_ema();
}
OK("param key=%s set=ok committed=yes", key);
return;
}
@@ -680,6 +776,33 @@ static void cmd_param(char *args)
ERR("param reason=\"unknown op\" op=%s", op);
}
/* BU.FACTORY_RESET — wipe all params back to defaults, erase log partition,
* then reboot. Equivalent to the cold-boot button-hold path in main.c, but
* reachable from a host without physical access. Destructive — operator
* must explicitly invoke it. */
static void cmd_factory_reset(char *args)
{
(void)args;
/* Refuse without an explicit BU.BEGIN. Without this guard, any party
* that can write to UART0 can wipe params/log just by sending the
* command — and uart_comms.c forwards bare BU.* lines to the dispatcher
* even when bring-up mode is off. */
if (!s_active) {
ERR("factory_reset reason=\"BU.BEGIN required first\"");
return;
}
OK("factory_reset stage=start");
esp_err_t e = factory_reset();
if (e != ESP_OK) {
ERR("factory_reset stage=apply err=%s", esp_err_to_name(e));
return;
}
OK("factory_reset stage=done reboot=2s");
fflush(stdout);
vTaskDelay(pdMS_TO_TICKS(2000));
esp_restart();
}
/* -------- dispatcher -------- */
typedef void (*cmd_fn)(char *args);
@@ -707,6 +830,7 @@ static const struct cmd_entry CMDS[] = {
{ "FSM", cmd_fsm },
{ "SOLAR.TICK", cmd_solar_tick },
{ "PARAM", cmd_param },
{ "FACTORY_RESET", cmd_factory_reset},
};
void bringup_handle_line(char *line)

View File

@@ -168,6 +168,7 @@ esp_err_t comms_handle_post(cJSON *root, cJSON **response_json) {
bool reboot_requested = false;
bool wifi_params_changed = false;
bool wifi_restart_requested = false;
bool refresh_battery_ema = false;
const char *error_msg = NULL;
int params_updated = 0;
int params_failed = 0;
@@ -183,8 +184,8 @@ esp_err_t comms_handle_post(cJSON *root, cJSON **response_json) {
// Process remaining_dist if present
cJSON *remaining_dist = cJSON_GetObjectItem(root, "remaining_dist");
if (cJSON_IsNumber(remaining_dist)) {
int64_t new_dist = (int64_t)cJSON_GetNumberValue(remaining_dist);
ESP_LOGI(TAG, "Setting remaining_dist to %lld", new_dist);
float new_dist = (float)cJSON_GetNumberValue(remaining_dist);
ESP_LOGI(TAG, "Setting remaining_dist to %.3f", new_dist);
fsm_set_remaining_distance(new_dist);
}
@@ -363,6 +364,12 @@ esp_err_t comms_handle_post(cJSON *root, cJSON **response_json) {
wifi_params_changed = true;
}
/* If the battery conversion params change, refresh the EMA
* so get_battery_V() reflects the new K/OFFSET immediately. */
if (param_idx == PARAM_V_SENS_K || param_idx == PARAM_V_SENS_OFFSET) {
refresh_battery_ema = true;
}
cJSON *value_json = cJSON_GetObjectItem(parameters, key);
// Set parameter value based on type
@@ -440,6 +447,9 @@ esp_err_t comms_handle_post(cJSON *root, cJSON **response_json) {
if (params_updated > 0) {
rtc_schedule_next_alarm();
commit_params();
if (refresh_battery_ema) {
reset_battery_ema();
}
if (wifi_params_changed) {
ESP_LOGI(TAG, "WiFi params changed — restarting WiFi AP");
wifi_restart_requested = true;

View File

@@ -40,8 +40,14 @@ esp_err_t fsm_get_error() { return fsm_error; }
void fsm_clear_error() { fsm_error = ESP_OK; }
/* override_time + override_cmd are written from RF/BT/comms tasks and read
* from the control task. int64_t isn't atomic on a 32-bit MCU, so we wrap
* read/write in a critical section to prevent torn reads (which could land
* override_time far in the future and run a motor for seconds longer than
* RF_PULSE_LENGTH). */
static portMUX_TYPE override_spin = portMUX_INITIALIZER_UNLOCKED;
int64_t override_time = -1;
fsm_override_t override_cmd;
fsm_override_t override_cmd = FSM_OVERRIDE_DRIVE_FWD;
bool enabled = false;
float this_move_dist = 0.0f;
@@ -82,11 +88,22 @@ void pulse_override(fsm_override_t cmd) {
if (soft_idle_is_active()) return;
if (current_state == STATE_IDLE) {
rtc_reset_shutdown_timer();
int64_t deadline = fsm_now + (int64_t)get_param_value_t(PARAM_RF_PULSE_LENGTH).u32;
portENTER_CRITICAL(&override_spin);
override_cmd = cmd;
override_time = fsm_now + get_param_value_t(PARAM_RF_PULSE_LENGTH).u32;
override_time = deadline;
portEXIT_CRITICAL(&override_spin);
}
}
/* Atomic snapshot of override_time + override_cmd for the control task. */
static inline void override_snapshot(int64_t *time_out, fsm_override_t *cmd_out) {
portENTER_CRITICAL(&override_spin);
*time_out = override_time;
*cmd_out = override_cmd;
portEXIT_CRITICAL(&override_spin);
}
int64_t fsm_cal_t, fsm_cal_e;
int64_t fsm_get_cal_t(){return fsm_cal_t;}
int64_t fsm_get_cal_e(){return fsm_cal_e;}
@@ -130,49 +147,69 @@ int8_t fsm_get_current_progress(int8_t denominator) {
#define JACK_TIME get_param_value_t(PARAM_JACK_KT).f32 * get_param_value_t(PARAM_JACK_DIST ).f32
#define JACK_DOWN_TIME (jack_finish_us - jack_start_us) * 105/100
/* Symmetric jack-down duration: how long jack-up actually ran, plus 5%.
* If jack_start_us / jack_finish_us are zero or negative (panic recovery,
* or a transition that skipped the normal path) the delta is unsafe — fall
* back to the parameter-derived JACK_TIME as a floor so we don't either
* (a) cut the jack-down to ~0 and leave the actuator extended, or (b) run
* forever. */
static inline int64_t _jack_down_time_us(void) {
int64_t delta = jack_finish_us - jack_start_us;
int64_t floor_us = (int64_t)JACK_TIME;
if (delta < floor_us) delta = floor_us;
return delta * 105 / 100;
}
#define JACK_DOWN_TIME _jack_down_time_us()
#define DRIVE_TIME get_param_value_t(PARAM_DRIVE_KT).f32 * this_move_dist
#define DRIVE_DIST get_param_value_t(PARAM_DRIVE_KE).f32 * this_move_dist
int64_t last_log_time = 0;
#define LOGSIZE 39
/* FSM log payload (single current channel — V5 has one shared ACS sensor; V4
* had three but the per-bridge values are redundant since only one bridge is
* active at a time). Layout:
* [0:8] ts_ms u64
* [8:12] bat_V f32
* [12:16] current_A f32 — sum of bridge currents (mutually exclusive)
* [16:18] counter i16
* [18:19] sensors u8
* [19:23] heat f32 — max bridge heat
* [23:25] i2c_out u16 — last 16-bit TCA9555 output state
* (high byte = OUTPUT0 / LEDs, low = OUTPUT1 / relays) */
#define LOGSIZE 25
esp_err_t send_fsm_log() {
if(!rtc_is_set()) return ESP_OK;
uint8_t entry[LOGSIZE] = {};
// Pack 64-bit timestamp into bytes 1-8
uint64_t be_timestamp = rtc_get_ms();
memcpy(&entry[0], &be_timestamp, 8);
// Pack 32-bit voltages/currents into bytes 9-24
float be_voltage = get_battery_V();
memcpy(&entry[8], &be_voltage, 4);
float be_current1 = get_bridge_raw_A(BRIDGE_DRIVE);
memcpy(&entry[12], &be_current1, 4);
float be_current2 = get_bridge_raw_A(BRIDGE_JACK);
memcpy(&entry[16], &be_current2, 4);
float be_current3 = get_bridge_raw_A(BRIDGE_AUX);
memcpy(&entry[20], &be_current3, 4);
float current_A = get_bridge_raw_A(BRIDGE_DRIVE)
+ get_bridge_raw_A(BRIDGE_JACK)
+ get_bridge_raw_A(BRIDGE_AUX);
memcpy(&entry[12], &current_A, 4);
int16_t be_counter = get_sensor_counter(SENSOR_DRIVE);
memcpy(&entry[24], &be_counter, 2);
memcpy(&entry[16], &be_counter, 2);
entry[26] = pack_sensors();
entry[18] = pack_sensors();
float heat = efuse_get_heat(BRIDGE_DRIVE);
float h2 = efuse_get_heat(BRIDGE_JACK);
float h3 = efuse_get_heat(BRIDGE_AUX);
if (h2 > heat) heat = h2;
if (h3 > heat) heat = h3;
memcpy(&entry[19], &heat, 4);
float heat1 = efuse_get_heat(BRIDGE_DRIVE);
memcpy(&entry[27], &heat1, 4);
float heat2 = efuse_get_heat(BRIDGE_JACK);
memcpy(&entry[31], &heat2, 4);
float heat3 = efuse_get_heat(BRIDGE_AUX);
memcpy(&entry[35], &heat3, 4);
uint16_t i2c_out = i2c_get_outputs();
memcpy(&entry[23], &i2c_out, 2);
last_log_time = esp_timer_get_time();
log_write(entry, LOGSIZE, fsm_get_state());
//ESP_LOGI(TAG, "WROTE LOG; %lld / %ld/%ld; %5.2f %5.2f %5.2f", (long long)rtc_get_ms(), (unsigned long)log_get_tail(), (unsigned long)log_get_head(), heat1, heat2, heat3);
@@ -257,6 +294,11 @@ void control_task(void *param) {
ESP_LOGI(TAG, "STARTING");
fsm_error = ESP_OK; // if everything is OK now, we're OK.
/* Zero jack timestamps so JACK_DOWN_TIME on this cycle
* never inherits a stale value from a prior run. */
jack_start_us = 0;
jack_trans_us = 0;
jack_finish_us = 0;
current_state = STATE_MOVE_START_DELAY;
log = true;
set_timer(TRANSITION_DELAY_US);
@@ -454,12 +496,25 @@ void control_task(void *param) {
current_state = STATE_UNDO_JACK_START;
set_timer(JACK_DOWN_TIME);
log = true;
} else {
} else if (efuse_get(BRIDGE_DRIVE)) {
// Fault — deduct actual distance traveled (may be partial).
// Checked before the normal-completion branch so a tick
// that satisfies both conditions doesn't double-deduct
// remaining_distance.
int32_t current_encoder = get_sensor_counter(SENSOR_DRIVE);
int32_t ticks_traveled = current_encoder - move_start_encoder;
float ke = get_param_value_t(PARAM_DRIVE_KE).f32;
float distance_traveled = ticks_traveled / ke;
remaining_distance -= distance_traveled;
if (remaining_distance < 0.0f) remaining_distance = 0.0f;
fsm_error = SC_ERR_EFUSE_TRIP_1;
current_state = STATE_UNDO_JACK_START;
set_timer(JACK_DOWN_TIME);
log = true;
} else {
int32_t current_encoder = get_sensor_counter(SENSOR_DRIVE);
if (timer_done() || current_encoder > 0) {
// Normal completion — deduct planned distance from leash
remaining_distance -= this_move_dist;
@@ -468,28 +523,23 @@ void control_task(void *param) {
log = true;
set_timer(TRANSITION_DELAY_US);
}
if (efuse_get(BRIDGE_DRIVE)) {
// Fault — deduct actual distance traveled (may be partial)
remaining_distance -= distance_traveled;
if (remaining_distance < 0.0f) remaining_distance = 0.0f;
fsm_error = SC_ERR_EFUSE_TRIP_1;
current_state = STATE_UNDO_JACK_START;
set_timer(JACK_DOWN_TIME);
log = true;
}
}
break;
case STATE_DRIVE_END_DELAY:
// 1s pause after drive — then lower jack
// 1s pause after drive — then lower jack normally.
// Goes straight to STATE_JACK_DOWN so the LED/comms message
// reads "MOVING…" rather than "CANCELLING MOVE" on a normal
// cycle. STATE_UNDO_JACK_START remains the path for explicit
// undo / safety-break / efuse-trip recovery.
if (!get_is_safe()) {
fsm_error = SC_ERR_SAFETY_TRIP;
current_state = STATE_UNDO_JACK_START;
set_timer(JACK_DOWN_TIME);
log = true;
} else if (timer_done()) {
current_state = STATE_UNDO_JACK_START;
current_state = STATE_JACK_DOWN;
set_timer(JACK_DOWN_TIME);
log = true;
}
break;
@@ -551,10 +601,14 @@ void control_task(void *param) {
/**** SET OUTPUTS ****/
switch (current_state) {
case STATE_IDLE:
// In idle we still accept override commands
if (override_time > fsm_now) {
switch(override_cmd) {
case STATE_IDLE: {
// In idle we still accept override commands. Snapshot both fields
// atomically to defend against the int64 torn read on writers.
int64_t local_time;
fsm_override_t local_cmd;
override_snapshot(&local_time, &local_cmd);
if (local_time > fsm_now) {
switch(local_cmd) {
case FSM_OVERRIDE_DRIVE_FWD:
if (efuse_get(BRIDGE_DRIVE)){
drive_relays((relay_port_t){.bridges = {
@@ -653,6 +707,7 @@ void control_task(void *param) {
}});
}
break;
} /* close STATE_IDLE block scope */
case STATE_CALIBRATE_JACK_MOVE:
case STATE_JACK_UP_START:
case STATE_JACK_UP:

View File

@@ -12,6 +12,11 @@
static bool i2c_initted = false;
//static bool safety_ok = false; // Safety interlock
static uint8_t last_relay_request = 0; // Track last relay request
/* Cached last-written values for the two TCA9555 output ports. Used by
* i2c_get_outputs() so the FSM log can record the full 16-bit output state
* without paying for an extra I2C read each tick. */
static uint8_t last_output0 = 0;
static uint8_t last_output1 = 0;
// === I2C LOW-LEVEL ===
static esp_err_t tca_write_word_8(uint8_t reg, uint8_t value) {
@@ -65,6 +70,7 @@ esp_err_t i2c_post(void) {
}
esp_err_t i2c_set_relays(relay_port_t states) {
last_output1 = states.raw;
return tca_write_word_8(TCA_REG_OUTPUT1, states.raw);
}
@@ -77,12 +83,27 @@ esp_err_t i2c_relays_sleep(void) {
}
esp_err_t i2c_set_led1(uint8_t state) {
// push 3 LSB to top
return tca_write_word_8(TCA_REG_OUTPUT0, state<<5);
/* P05-P07 are LEDs (outputs); P00-P04 are buttons / unused INPUTS
* (CONFIG0 = 0b00000011 sets P00/P01 as inputs; P02-P04 are unused
* but also configured as inputs). Writing the whole OUTPUT0 register
* is therefore safe — the input-bit slots in OUTPUT0 are don't-cares
* because the pin direction prevents the value from driving the line.
* If P02-P04 ever become outputs, switch this to read-modify-write. */
uint8_t v = state << 5;
last_output0 = v;
return tca_write_word_8(TCA_REG_OUTPUT0, v);
}
uint16_t i2c_get_outputs(void) {
/* OUTPUT0 in the high byte (P00..P07), OUTPUT1 in the low byte
* (P10..P17). Reflects the last value written by this driver. */
return ((uint16_t)last_output0 << 8) | last_output1;
}
esp_err_t i2c_stop() {
if (!i2c_initted) return ESP_OK;
last_output0 = 0;
last_output1 = 0;
tca_write_word_8(TCA_REG_OUTPUT0, 0);
tca_write_word_8(TCA_REG_OUTPUT1, 0);
return ESP_OK;
@@ -147,21 +168,22 @@ bool i2c_get_button_repeat(uint8_t btn) {
}
int8_t i2c_get_button_repeats(uint8_t btn) {
if (!i2c_get_button_state(btn))
return 0;
/* Returns -1 on out-of-range button index (was previously `false` = 0,
* which conflated error with "no repeat"). 0 means button not pressed
* or no new repeat this poll. >=1 is a valid repeat count. */
if (btn >= N_BTNS) return -1;
if (!i2c_get_button_state(btn)) return 0;
if (btn >= N_BTNS || !debounced_state[btn]) return false;
uint64_t now = esp_timer_get_time() / 1000;
if (now + DEBOUNCE_MS < last_change_time[btn]) return false;
if (now + DEBOUNCE_MS < last_change_time[btn]) return 0;
if ((now - last_change_time[btn]) > (REPEAT_START_MS + REPEAT_MS * claimed_repeats[btn])) {
claimed_repeats[btn]++;
if (claimed_repeats[btn] > 100)
claimed_repeats[btn] = 100;
ESP_LOGI("BTN", "RPT %d", (uint8_t)claimed_repeats[btn]+2);
ESP_LOGI("BTN", "RPT %d", (uint8_t)(claimed_repeats[btn]+1));
return claimed_repeats[btn]+1;
}
if (debounced_state[btn] && !last_known_state[btn]) {
ESP_LOGI("BTN", "FST %d", 1);
return 1;
}

View File

@@ -55,6 +55,11 @@ esp_err_t i2c_stop(void);
esp_err_t i2c_set_relays(relay_port_t states);
esp_err_t i2c_set_led1(uint8_t state);
/* Returns the last-written 16-bit TCA9555 output state.
* High byte: OUTPUT0 (P00..P07, LEDs in P05..P07).
* Low byte: OUTPUT1 (P10..P17, relay_port_t.raw). */
uint16_t i2c_get_outputs(void);
/* Normal run state: all bridges off, but P10 (sensor rail) held high.
* Use whenever "everything off" is really "all motors off, system is still on". */
esp_err_t i2c_relays_idle(void);

View File

@@ -150,7 +150,8 @@ void drive_leds(led_mode_t mode) {
}
}
void app_main(void) {esp_task_wdt_add(NULL);
void app_main(void) {
esp_task_wdt_add(NULL);
ESP_LOGI(TAG, "Firmware: %s", FIRMWARE_STRING);
ESP_LOGI(TAG, "Version: %s", FIRMWARE_VERSION);

View File

@@ -143,16 +143,11 @@ esp_err_t drive_relays(relay_port_t relay_state) {
BRIDGE_TRANSITION_LOGIC(JACK)
BRIDGE_TRANSITION_LOGIC(AUX)
/* Sensor rail (P10) powered only when FSM is actively doing something.
* In STATE_IDLE we cut it to save power. Overrides energize a motor
* while FSM is technically IDLE — keep the rail up in that case too
* so overrides that consult sensor state (e.g. JACK_DOWN, which checks
* SENSOR_JACK) still work. */
bool motor_requested = (relay_state.bridges.DRIVE != BRIDGE_OFF ||
relay_state.bridges.JACK != BRIDGE_OFF ||
relay_state.bridges.AUX != BRIDGE_OFF);
relay_state.bridges.SENSORS =
(fsm_get_state() != STATE_IDLE || motor_requested) ? 1 : 0;
/* Sensor rail (P10) is on whenever the device is awake — including
* STATE_IDLE — so the SAFETY input can be observed continuously.
* It is dropped only in soft_idle_enter() (sleep) via i2c_relays_sleep,
* and toggled explicitly by the bring-up tool's BU.RELAY SENSORS cmd. */
relay_state.bridges.SENSORS = 1;
if (!get_is_safe())
relay_state.bridges.DRIVE = 0;
@@ -287,6 +282,20 @@ float get_raw_battery_voltage(void) {
return voltage_mv * get_param_value_t(PARAM_V_SENS_K).f32 + get_param_value_t(PARAM_V_SENS_OFFSET).f32; // same as / 1000.0 * 1150.0 / 150.0;
}
void reset_battery_ema(void)
{
/* Next process_battery_voltage() call re-seeds from raw. Also refresh
* immediately from a fresh raw read so callers that read get_battery_V()
* before the FSM ticks again (e.g. during bringup) see the new value. */
float raw = get_raw_battery_voltage();
if (!isnan(raw)) {
ema_battery = raw;
ema_battery_init = true;
} else {
ema_battery_init = false;
}
}
esp_err_t process_battery_voltage(void)
{
float raw = get_raw_battery_voltage();
@@ -364,6 +373,20 @@ static bool v5_any_bridge_active(void) {
v5_bridge_is_active(BRIDGE_JACK) ||
v5_bridge_is_active(BRIDGE_AUX);
}
/* True if any currently-active bridge is still inside its INRUSH_US window.
* The shared ACS reading is unattributable per-bridge during a co-active
* inrush — the full combined current is attributed to each active bridge in
* process_bridge_current(), so a quieter bridge (e.g. AUX during DRIVE start)
* sees an inflated I_norm and would spuriously instant-trip on KINST. */
static bool v5_any_bridge_in_inrush(void) {
int64_t inrush_us = (int64_t)get_param_value_t(PARAM_EFUSE_INRUSH_US).u32;
for (bridge_t b = 0; b < N_BRIDGES; b++) {
if (!v5_bridge_is_active(b)) continue;
if (fsm_now < isens[b].on_us + inrush_us) return true;
}
return false;
}
#endif
esp_err_t process_bridge_current(bridge_t bridge) {
@@ -440,10 +463,11 @@ esp_err_t process_bridge_current(bridge_t bridge) {
} else {
float alpha = get_param_value_t(PARAM_ADC_ALPHA_ISENS).f32;
if (isnan(channel->raw_current)) {
//ESP_LOGI(TAG, "RAW BATTERY IS NAN");
channel->ema_current = NAN;
} else {
if (isnan(ema_battery) || isnan(alpha)) {
/* Reset the per-bridge EMA if it (or alpha) is NaN — using
* the per-bridge value, not the unrelated battery EMA. */
if (isnan(channel->ema_current) || isnan(alpha)) {
channel->ema_current = channel->raw_current;
} else {
channel->ema_current = alpha * channel->raw_current + (1.0f - alpha) * channel->ema_current;
@@ -470,9 +494,10 @@ esp_err_t process_bridge_current(bridge_t bridge) {
} else {
float alpha = get_param_value_t(PARAM_ADC_ALPHA_IAZ).f32;
if (isnan(channel->raw_current)) {
//ESP_LOGI(TAG, "RAW BATTERY IS NAN");
/* skip — no fresh sample */
} else {
if (isnan(ema_battery) || isnan(alpha)) {
/* Reset the autozero offset if it (or alpha) is NaN. */
if (isnan(channel->az_offset) || isnan(alpha)) {
channel->az_offset = channel->ema_current;
} else {
channel->az_offset = alpha * channel->ema_current +
@@ -512,9 +537,17 @@ esp_err_t process_bridge_current(bridge_t bridge) {
// Normalize the current as a fraction of rated current
float I_norm = fabsf(channel->current / I_nominal);
// Instant trip on extreme overcurrent
// Instant trip on extreme overcurrent. On V5, also require that no
// *other* active bridge is still in its inrush window — during a
// co-active inrush the shared ACS reading is attributed to each
// active bridge, which inflates the quieter bridge's I_norm and
// would otherwise cause a spurious instant-trip there.
if (fsm_now > channel->on_us + get_param_value_t(PARAM_EFUSE_INRUSH_US).u32
&& I_norm >= get_param_value_t(PARAM_EFUSE_KINST).f32) {
&& I_norm >= get_param_value_t(PARAM_EFUSE_KINST).f32
#ifdef BOARD_V5
&& !v5_any_bridge_in_inrush()
#endif
) {
// Check if overcurrent has persisted long enough
channel->tripped = true;
channel->trip_time = fsm_now;

View File

@@ -46,6 +46,13 @@ bool get_bridge_spike(bridge_t bridge, float threshold);
esp_err_t process_bridge_current(bridge_t bridge);
esp_err_t process_battery_voltage();
/* Force the battery EMA to re-seed from the next raw read. Call after a
* V_SENS_K / V_SENS_OFFSET change so get_battery_V() reflects the new
* calibration immediately instead of decaying through the EMA — which
* otherwise stays stale across bringup mode (FSM is paused, so
* process_battery_voltage doesn't tick) until alpha catches up. */
void reset_battery_ema(void);
esp_err_t adc_init();
esp_err_t adc_post(void);
esp_err_t power_init();

View File

@@ -37,8 +37,13 @@ typedef struct {
size_t num_symbols;
} rf_code_t;
int learn_flag = -1;
bool controls_enabled = true;
/* These are written by the comms task (HTTP/UART) and read by the RF
* receiver task. `volatile` forces the RF task to re-read each iteration
* rather than caching in a register; on a dual-core ESP32 the writer's
* memory is also flushed by the FreeRTOS task switch / queue ops the
* comms task does around updates. */
volatile int learn_flag = -1;
volatile bool controls_enabled = true;
// Temporary storage for learned keycodes (not committed to params yet)
static int64_t temp_keycodes[NUM_RF_BUTTONS] = {0};

View File

@@ -140,28 +140,36 @@ esp_err_t sensors_init() {
}
void sensors_check() {
sensor_event_t evt;
/* Drain ALL queued events with a non-blocking receive. Previously this
* was a single blocking receive with a 10 ms timeout, which (a) chewed up
* half the FSM tick window waiting on quiet sensors, and (b) consumed
* only one edge per tick — encoder bursts above 50 Hz overflowed the
* 16-entry queue and undercounted distance. Now each tick consumes the
* full queue contents and applies a per-sensor debounce. */
sensor_event_t evt;
static uint64_t last_counted_us[N_SENSORS] = {0};
while (xQueueReceive(sensor_event_queue, &evt, 0) == pdTRUE) {
uint8_t i = evt.sensor_id;
if (i >= N_SENSORS) continue;
uint8_t i = 0;
/* Use the ISR-captured level (snapshot at edge time) rather than a
* fresh GPIO read here — by the time the FSM tick drains the queue,
* the line may have toggled again and a re-read would miss the
* transition we're processing. */
bool current_raw = evt.level;
if (xQueueReceive(sensor_event_queue, &evt, pdMS_TO_TICKS(10)) == pdTRUE) {
i = evt.sensor_id;
ESP_LOGI("SENS", "EVENT %d", i);
bool current_raw = !gpio_get_level(sensor_pins[i]);
/* Software debounce on non-safety sensors. The safety sensor has its
* own asymmetric debouncer below, so we don't double-count there. */
uint64_t now = esp_timer_get_time();
if (i != SENSOR_SAFETY) {
if (now - last_counted_us[i] < DEBOUNCE_TIME_US) continue;
}
last_counted_us[i] = now;
sensor_stable_state[i] = current_raw;
if (current_raw && !last_raw_state[i]){
ESP_LOGI("SENS", "FALLING");
if (current_raw != last_raw_state[i]) {
sensor_count[i]++;
}
if (!current_raw && last_raw_state[i]){
ESP_LOGI("SENS", "RISING");
sensor_count[i]++;
}
last_raw_state[i] = current_raw;
}
@@ -214,8 +222,7 @@ bool get_sensor(sensor_t i) {
}
bool get_is_safe(void) {
return true;
//return is_safe;
return is_safe;
}
int16_t get_sensor_counter(sensor_t i) {

View File

@@ -37,7 +37,11 @@ esp_err_t solar_run_fsm() {
int64_t now = rtc_get_ms();
//ESP_LOGI("BAT", "FSM STATE %d", current_charge_state);
/* `now` is in milliseconds; CHG_BULK_S / CHG_LOW_S are in seconds.
* Scale the parameter to ms before comparing. Initialize the timer on
* first run rather than leaving it at -1 (which would otherwise make
* `now > timer + threshold` true after just `threshold` ms). */
if (timer < 0) timer = now;
float vbat = get_battery_V();
@@ -47,27 +51,26 @@ esp_err_t solar_run_fsm() {
- After a period of time in bulk, switch to float
*/
//if (rtc_is_set()) {
switch(current_charge_state) {
case CHG_STATE_BULK:
if (now > timer+get_param_value_t(PARAM_CHG_BULK_S).u32) {
current_charge_state = CHG_STATE_FLOAT;
}
switch(current_charge_state) {
case CHG_STATE_BULK:
if (now > timer + (int64_t)get_param_value_t(PARAM_CHG_BULK_S).u32 * 1000) {
current_charge_state = CHG_STATE_FLOAT;
}
break;
case CHG_STATE_FLOAT:
// if we have sufficient voltage, reset the timer
if (vbat > get_param_value_t(PARAM_CHG_LOW_V).f32) {
timer = now;
}
break;
case CHG_STATE_FLOAT:
// if we have sufficient voltage, reset the timer
if (vbat > get_param_value_t(PARAM_CHG_LOW_V).f32) {
timer = now;
}
if (now > timer+get_param_value_t(PARAM_CHG_LOW_S).u32) {
timer = now;
current_charge_state = CHG_STATE_BULK;
}
if (now > timer + (int64_t)get_param_value_t(PARAM_CHG_LOW_S).u32 * 1000) {
timer = now;
current_charge_state = CHG_STATE_BULK;
}
break;
}
break;
}
/*} else {
reset_solar_fsm();
ESP_LOGI(TAG, "RESET SOLAR FSM");

View File

@@ -37,20 +37,9 @@ typedef struct {
uint8_t type;
} log_queue_entry_t;
// ============================================================================
// LOG TYPE DEFINITIONS (Magic values 0xC0-0xCF)
// ============================================================================
#define LOG_TYPE_DATA 0xC0 // Generic data log
#define LOG_TYPE_EVENT 0xC1 // Event marker
#define LOG_TYPE_ERROR 0xC2 // Error log
#define LOG_TYPE_DEBUG 0xC3 // Debug message
#define LOG_TYPE_SENSOR 0xC4 // Sensor reading
#define LOG_TYPE_COMMAND 0xC5 // Command executed
#define LOG_TYPE_STATUS 0xC6 // Status update
#define LOG_TYPE_CUSTOM 0xCF // Custom/user-defined
// Helper macro to check if a byte is a valid log type
#define IS_VALID_LOG_TYPE(x) ((x) >= 0xC0 && (x) <= 0xCF)
/* LOG_TYPE_* + IS_VALID_LOG_TYPE moved to storage.h as the single source
* of truth. The duplicate set previously here disagreed with the header
* (different LOG_TYPE_CUSTOM* names). */
// ============================================================================
// PARAMETER TABLE GENERATION
@@ -272,6 +261,10 @@ esp_err_t set_param_value_t(param_idx_t id, param_value_t val) {
return ESP_ERR_INVALID_ARG;
}
parameter_table[id] = val;
/* Run bounds/NaN validation immediately so callers that read between
* set and the next commit_params() see a clamped value rather than a
* raw out-of-range one. */
validate_param(id);
ESP_LOGI(TAG, "Parameter %d (%s) set (not committed)", id, parameter_names[id]);
return ESP_OK;
}
@@ -518,6 +511,20 @@ esp_err_t commit_params(void) {
esp_err_t factory_reset(void) {
ESP_LOGI(TAG, "Performing factory reset...");
/* Stop the log writer task before erasing the log partition so an
* in-flight write doesn't race against esp_partition_erase_range. We
* also take log_mutex for the rest of this function so any pre-existing
* writer that's mid-write completes before we erase, and any new writer
* (if log_task_running observation lagged) blocks. The caller is about
* to esp_restart, so we never give the mutex back. */
if (log_task_running) {
log_task_running = false;
/* Give the writer task time to observe the flag (its queue receive
* has a 100 ms timeout) and finish any in-flight write. */
vTaskDelay(pdMS_TO_TICKS(150));
}
if (log_mutex) xSemaphoreTake(log_mutex, portMAX_DELAY);
// Reset all parameters to defaults
for (int i = 0; i < NUM_PARAMS; i++) {
memcpy(&parameter_table[i], &parameter_defaults[i], sizeof(param_value_t));
@@ -753,11 +760,6 @@ static bool is_sector_full(uint32_t x) {
return (buf != 0xFF);
}
static inline void find_head_tail(int32_t num_sectors, int32_t *head, int32_t *tail) {
}
// Replace log_write with this non-blocking version:
esp_err_t log_write(const uint8_t* buf, uint8_t len, uint8_t type) {
if (!log_initialized || log_partition == NULL) {
@@ -811,11 +813,28 @@ static esp_err_t log_write_blocking(const uint8_t* buf, uint8_t len, uint8_t typ
// check if we will overrun the sector
if (log_head_offset + len+2 >= log_sector_end(log_head_offset)) {
// zero the rest of sector
char zeros[256] = {0};
esp_partition_write(log_partition,
log_head_offset, &zeros,
log_sector_end(log_head_offset)-log_head_offset);
/* Zero the remainder of the current sector. The gap can be up to
* one full sector (FLASH_SECTOR_SIZE = 4096); a single 256-byte
* stack buffer would have caused the partition driver to read past
* the buffer and write arbitrary stack contents to flash. Use a
* static-zero buffer (`.bss` is implicitly zero-initialized) and
* chunk the write so an oversize buffer is never required. */
static const uint8_t zeros[256] = {0};
size_t gap = log_sector_end(log_head_offset) - log_head_offset;
size_t written = 0;
while (written < gap) {
size_t chunk = MIN(sizeof(zeros), gap - written);
esp_err_t we = esp_partition_write(log_partition,
log_head_offset + written,
zeros, chunk);
if (we != ESP_OK) {
ESP_LOGW(TAG, "Failed zero-pad write: %s", esp_err_to_name(we));
/* Bump head to the next sector regardless — readers tolerate
* 0xFF or 0x00 padding between entries. */
break;
}
written += chunk;
}
// set head to next sector, and check for wrap
log_head_offset = log_sector_end(log_head_offset);
@@ -851,10 +870,25 @@ static esp_err_t log_write_blocking(const uint8_t* buf, uint8_t len, uint8_t typ
}
len++; // account for type bit
esp_partition_write(log_partition, log_head_offset, &len, 1);
esp_partition_write(log_partition, log_head_offset+1, buf, len-1);
esp_partition_write(log_partition, log_head_offset+len, &type, 1);
/* Check each write — a partial failure here leaves a corrupt entry that
* the recovery scan has to skip past. On any failure, bump head to the
* next sector so the next write starts clean. */
esp_err_t we;
we = esp_partition_write(log_partition, log_head_offset, &len, 1);
if (we == ESP_OK) {
we = esp_partition_write(log_partition, log_head_offset+1, buf, len-1);
}
if (we == ESP_OK) {
we = esp_partition_write(log_partition, log_head_offset+len, &type, 1);
}
if (we != ESP_OK) {
ESP_LOGE(TAG, "log_write_blocking partial-write fail: %s",
esp_err_to_name(we));
log_head_offset = log_sector_end(log_head_offset);
if (log_head_offset >= log_partition->size) log_head_offset = 0;
if (log_mutex) xSemaphoreGive(log_mutex);
return we;
}
log_head_offset+=len+1;
ESP_LOGI(TAG, "Wrote; Tail/Head are now %lu/%lu",

View File

@@ -11,26 +11,39 @@
// ============================================================================
#define FLASH_SECTOR_SIZE 4096
// ============================================================================
// LOG ENTRY TYPE DEFINITIONS (Magic values 0xC0-0xCF)
// ============================================================================
#define LOG_TYPE_DATA 0xC0 // Generic data log
#define LOG_TYPE_EVENT 0xC1 // Event marker
#define LOG_TYPE_ERROR 0xC2 // Error log
#define LOG_TYPE_DEBUG 0xC3 // Debug message
#define LOG_TYPE_SENSOR 0xC4 // Sensor reading
#define LOG_TYPE_COMMAND 0xC5 // Command executed
#define LOG_TYPE_STATUS 0xC6 // Status update
#define LOG_TYPE_CUSTOM_1 0xC7 // Custom type 1
#define LOG_TYPE_CUSTOM_2 0xC8 // Custom type 2
#define LOG_TYPE_CUSTOM_3 0xC9 // Custom type 3
/* LOG ENTRY TYPES.
*
* Two ranges are emitted by the firmware in practice:
* 0..13 — FSM state-tagged data entries (see LOG_FSM_NAMES in
* webpage.html and send_fsm_log() in control_fsm.c).
* 100..103 — System events: BAT, CRASH, BOOT, TIME_SET (see
* control_fsm.h LOG_TYPE_BAT/CRASH/BOOT/TIME_SET).
*
* Constants in the 0xC0-0xCF range are reserved for legacy/future use; the
* webpage parser does not currently understand them.
*/
#define LOG_TYPE_DATA 0xC0 // reserved
#define LOG_TYPE_EVENT 0xC1
#define LOG_TYPE_ERROR 0xC2
#define LOG_TYPE_DEBUG 0xC3
#define LOG_TYPE_SENSOR 0xC4
#define LOG_TYPE_COMMAND 0xC5
#define LOG_TYPE_STATUS 0xC6
#define LOG_TYPE_CUSTOM_1 0xC7
#define LOG_TYPE_CUSTOM_2 0xC8
#define LOG_TYPE_CUSTOM_3 0xC9
// 0xCA-0xCF reserved for future use
// Maximum payload size per log entry (255 max due to 1-byte size field)
#define LOG_MAX_PAYLOAD 200
// Helper macro to check if a byte is a valid log type
#define IS_VALID_LOG_TYPE(x) ((x) >= 0xC0 && (x) <= 0xCF)
/* Helper macro to check if a byte is a valid log type. Includes the
* 0..13 FSM-state range, the 100..103 system-event range, and the legacy
* 0xC0-0xCF magic range. Used as a soft sanity check during log_read —
* unknown types are still surfaced to callers, just with a warning. */
#define IS_VALID_LOG_TYPE(x) (((x) <= 13) || \
((x) >= 100 && (x) <= 103) || \
((x) >= 0xC0 && (x) <= 0xCF))
// ============================================================================
// LOG ENTRY STRUCTURE
@@ -61,11 +74,11 @@ typedef struct {
PARAM_DEF(NUM_MOVES, u32, 0, "", 0, 1000) \
PARAM_DEF(MOVE_START, u32, 0, "s", 0, 86400) \
PARAM_DEF(MOVE_END, u32, 0, "s", 0, 86400) \
PARAM_DEF(DRIVE_DIST, f32, 10, "ft", 0.0, 100.0) \
PARAM_DEF(JACK_DIST, f32, 5, "in", 0.0, 10.0) \
PARAM_DEF(DRIVE_DIST, f32, 4, "ft", 0.0, 100.0) \
PARAM_DEF(JACK_DIST, f32, 1.5, "in", 0.0, 10.0) \
PARAM_DEF(DRIVE_KE, f32, 29.2, "n/ft", 1.0, 1e9) \
PARAM_DEF(DRIVE_KT, f32, 1440000, "us/ft", 1.0, 1e9) /* div-critical */ \
PARAM_DEF(JACK_KT, f32, 1428571, "ms/in", 1.0, 1e9) /* div-critical */ \
PARAM_DEF(JACK_KT, f32, 1725698, "ms/in", 1.0, 1e9) /* div-critical */ \
PARAM_DEF(KEYCODE_0, u32, 0, "", 0, 0) /* skip */ \
PARAM_DEF(KEYCODE_1, u32, 0, "", 0, 0) \
PARAM_DEF(KEYCODE_2, u32, 0, "", 0, 0) \

File diff suppressed because one or more lines are too long

View File

@@ -1,55 +1,136 @@
<!DOCTYPE html>
<html>
<!--
tan: #ba965b
light tan: #efede9
white: #ffffff
green: #2a493d
black: #2f2f2f
-->
<head>
<meta charset="utf-8">
<title>Control Panel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* === COLOR TOKENS ===
* Single source of truth for every color used in the UI. Item 14:
* green/red/yellow each appear in exactly one place here and are
* referenced everywhere else via var(--…). */
:root {
--green: #38B000;
--red: #C1121F;
--yellow: #FFDD00;
/* Dark theme surfaces (item 15) */
--bg: #1a1a1a; /* page background */
--surface: #262626; /* cards, inputs, popups */
--surface-2: #333333; /* hover / readonly tint */
--text: #f0f0f0; /* primary text */
--text-dim: #a0a0a0; /* secondary text */
--border: #444444;
--accent: #ba965b; /* brand tan kept as accent */
}
html, body { background-color: var(--bg); color: var(--text); }
body { text-align: center; margin: 0; padding: 0; }
#wrapper { text-align: center; box-sizing: border-box; }
#content { max-width: 500px; margin: auto; padding: 0 10px; }
body { text-align: center; margin: 0; padding: 0; }
* {
font-size: 1.2rem;
background-color: #ffffff;
color: #2f2f2f;
font-family: "Noto Sans", "Verdana", sans-serif;
font-size: 1.2rem;
color: var(--text);
font-family: system-ui, sans-serif;
background-color: transparent;
}
input, button { width: 100%; }
input, button { background-color: #efede9; text-align: right; box-sizing: border-box; border: 1px; border-radius: 5px; margin: 5px;}
input[type="text"], input[type="number"],input[type="time"] { font-family: monospace;border: 1px solid #ba965b; border-radius: 5px; }
/* === FORM CONTROLS === */
input, button {
width: 100%;
background-color: var(--surface);
color: var(--text);
text-align: right;
box-sizing: border-box;
border: 1px solid var(--border);
border-radius: 5px;
margin: 5px;
}
input[type="text"], input[type="number"], input[type="time"] {
/* Numerical / freeform-text inputs keep monospace per CHANGELIST. */
font-family: monospace;
border: 1px solid var(--accent);
}
input[readonly] {
background-color: var(--surface-2);
color: var(--text-dim);
}
input[readonly] { background-color: #e4e4e4; border-radius: 5px;}
button {
text-align: center;
border: 1px solid var(--accent);
border-radius: 5px;
cursor: pointer;
}
button:hover { background-color: var(--surface-2); }
/* Save / Discard footer buttons. */
.changed, #commit_btn { background-color: var(--green) !important; color: #ffffff !important; border-color: var(--green) !important; }
#cancel_btn { background-color: var(--red) !important; color: #ffffff !important; border-color: var(--red) !important; }
#commit_btn, #cancel_btn { width: 45%; margin-top: 10px; padding: 10px; font-weight: bold; }
#commit_btn[disabled], #cancel_btn[disabled] {
background-color: var(--surface-2) !important;
color: var(--text-dim) !important;
border-color: var(--border) !important;
cursor: not-allowed;
}
button { text-align: center; border: 1px solid #ba965b; border-radius: 5px; }
.changed, #commit_btn { background-color: #2a493d !important; color: #ffffff !important; }
#cancel_btn { background-color: #723 !important; color: #ffffff !important; }
#commit_btn, #cancel_btn { width: 45%; margin-top: 10px; padding: 10px; cursor: pointer; border: none; font-weight: bold; }
#commit_btn[disabled], #cancel_btn[disabled] { background-color: #444 !important; color: #888; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td { padding: 8px; border-bottom: 1px solid #efede9; }
td { padding: 8px; border-bottom: 1px solid var(--border); }
#log_viewer_table td { padding: 2px 6px; font-size: 0.65rem; }
#log_viewer_table td:first-child { white-space: nowrap; }
summary { border-radius: 5px; font-weight: bold; text-align: left; color: #fff; background-color: #723; padding: 0.3rem;}
.cmd { font-size: 1.5rem; border: none;}
summary {
border-radius: 5px;
font-weight: bold;
text-align: left;
color: #ffffff;
background-color: var(--red);
padding: 0.3rem;
cursor: pointer;
}
#msg {text-align: center;}
/* === ACTION BUTTON ROW (item 12) ===
* Flex layout instead of a table: each button gets exactly 50% of
* the row width with a 10px gap, regardless of label width. The
* `.cmd` text wraps when "START MOVE" doesn't fit on one line. */
.action_row {
display: flex;
gap: 10px;
padding: 5px 0;
align-items: stretch;
}
.action_row > button {
flex: 1 1 0; /* equal width — both buttons take 50% */
margin: 0;
min-height: 64px;
}
.cmd {
font-size: 1.5rem;
font-weight: bold;
white-space: normal;
word-break: break-word;
border: none;
line-height: 1.15;
}
.cmd_action { background-color: var(--green); color: #ffffff; }
.cmd_action.moving { background-color: var(--yellow); color: #1a1a1a; }
.cmd_estop { background-color: var(--red); color: #ffffff; }
/* Status box: state label plus a flex row of per-error pills. */
#msg { text-align: center; }
/* === STATUS BOX === */
#status_box { text-align: center; padding: 6px 0; }
#status_state { font-weight: bold; font-size: 1.3rem; padding: 4px 0; color: #2a493d; }
#status_state.error { color: #c33; }
/* Item 13: status text always uses the default theme color — no
* error-class override that flips it red. The pill row below does
* the error signaling. */
#status_state {
font-weight: bold;
font-size: 1.3rem;
padding: 4px 0;
color: var(--text);
}
#status_indicators { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
#status_indicators:empty { display: none; }
.status_pill {
@@ -58,18 +139,19 @@ black: #2f2f2f
font-size: 0.85rem;
font-weight: bold;
color: #ffffff;
background-color: #888;
background-color: var(--surface-2);
white-space: nowrap;
}
.status_pill.error { background-color: #c33; }
.status_pill.warn { background-color: #c90; }
.status_pill.info { background-color: #479; }
.status_pill.error { background-color: var(--red); }
.status_pill.warn { background-color: var(--yellow); color: #1a1a1a; }
.status_pill.info { background-color: var(--accent); }
h1 {
font-size: 2.5rem;
font-size: 2.5rem;
color: var(--text);
}
/* Popup modal styles */
/* === POPUP MODAL === */
#popup-overlay {
display: none;
position: fixed;
@@ -77,101 +159,87 @@ black: #2f2f2f
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
background-color: rgba(0, 0, 0, 0.75);
z-index: 1000;
justify-content: center;
align-items: center;
}
#popup-content {
background-color: #2a493d;
color: #ffffff;
background-color: var(--surface);
color: var(--text);
padding: 30px;
border-radius: 10px;
border: 1px solid var(--border);
text-align: center;
max-width: 400px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
#popup-content h2 {
margin-top: 0;
color: #ffffff;
background-color: #2a493d;
}
#popup-content h2,
#popup-content p {
background-color: #2a493d;
color: #ffffff;
font-size: 1.1rem;
background-color: var(--surface);
color: var(--text);
}
#popup-content h2 { margin-top: 0; }
#popup-content p { font-size: 1.1rem; }
@media screen and (max-width: 350px) {
#content { max-width: 100%; padding: 0 5px; }
/* Stack table cells vertically on mobile for better usability,
* but exempt the log viewer — it stays as a wide table with
* horizontal scroll provided by its wrapping div. */
/* Stack table cells vertically on mobile, but exempt the log
* viewer — it stays as a wide table with horizontal scroll. */
table:not(#log_viewer_table) tr td { display: block; width: 100%; box-sizing: border-box; }
table:not(#log_viewer_table) tr { display: block; margin-bottom: 10px; }
}
#popup-buttons {
background-color: #2a493d;
background-color: var(--surface);
margin-top: 20px;
display: flex;
gap: 10px;
justify-content: center;
flex-wrap: wrap;
}
#popup-buttons button {
background-color: #efede9;
color: #2f2f2f;
border: 1px solid #ba965b;
background-color: var(--surface-2);
color: var(--text);
border: 1px solid var(--accent);
padding: 10px 20px;
cursor: pointer;
border-radius: 5px;
font-weight: bold;
min-width: 100px;
}
#popup-buttons button:hover {
background-color: #ba965b;
color: #ffffff;
background-color: var(--accent);
color: #1a1a1a;
}
#popup-buttons button.primary {
background-color: #ba965b;
color: #ffffff;
background-color: var(--accent);
color: #1a1a1a;
}
#popup-buttons button.primary:hover {
background-color: #8a7045;
background-color: #d4b27e;
}
#popup-input-container {
background-color: #2a493d;
background-color: var(--surface);
margin: 20px 0;
}
#popup-input {
width: 100%;
padding: 10px;
border: 1px solid #ba965b;
border: 1px solid var(--accent);
border-radius: 5px;
background-color: #efede9;
color: #2f2f2f;
background-color: var(--surface-2);
color: var(--text);
text-align: center;
font-size: 1.1rem;
}
.sqbtn {
width: 35%;
padding: 30px;
font-weight: bold;
width: 35%;
padding: 30px;
font-weight: bold;
}
</style>
</head>
<body>
@@ -181,13 +249,10 @@ black: #2f2f2f
<h1>CluckCommand</h1>
<table>
<tr>
<td><button class="cmd" onclick="sendCommand('start')">START</button></td>
<td><button class="cmd" onclick="sendCommand('stop')" style="background-color:#723; color: #fff">STOP</button></td>
<td><button class="cmd" onclick="sendCommand('undo')">UNDO</button></td>
</tr>
</table>
<div class="action_row">
<button class="cmd cmd_action" id="action_btn" onclick="actionBtnClick()">START MOVE</button>
<button class="cmd cmd_estop" onclick="sendCommand('stop')">E-STOP</button>
</div>
@@ -325,7 +390,7 @@ black: #2f2f2f
<br/>
<details id="log_viewer_details">
<summary style="background-color:#2a493d;">EVENT LOG</summary>
<summary style="background-color:var(--surface-2);">EVENT LOG</summary>
<!-- Body breaks out of the 500px #content column so the table has
room to breathe. The summary above stays inside the column. -->
<div id="log_viewer_body" style="position:relative;width:100vw;left:50%;margin-left:-50vw;padding:0 8px;box-sizing:border-box;">
@@ -365,8 +430,8 @@ black: #2f2f2f
</table>
<table id="table"></table>
<button class="cmd" onclick="sendCommand('reboot')" style="background-color:#723; color: #fff">REBOOT</button>
<button class="cmd" onclick="sendCommand('sleep')" style="background-color:#237; color: #fff">SLEEP</button>
<button class="cmd" onclick="sendCommand('reboot')" style="background-color:var(--red); color:#fff">REBOOT</button>
<button class="cmd" onclick="sendCommand('sleep')" style="background-color:var(--surface-2); color:var(--text)">SLEEP</button>
</details>
</div>
</div>
@@ -665,6 +730,14 @@ black: #2f2f2f
}
}
// Single action-button dispatcher. STATE_IDLE (0) → start, anything else
// → undo. Uses last polled FSM state so the click matches what the
// operator sees on the button label.
function actionBtnClick() {
const isIdle = !data.state || data.state === 0;
sendCommand(isIdle ? 'start' : 'undo');
}
async function sendCommand(cmdName) {
if (cmdName === 'start') {
if (!await modalConfirm("Will begin moving - please confirm."))
@@ -930,6 +1003,16 @@ black: #2f2f2f
stateEl.textContent = state || '—';
stateEl.classList.toggle('error', activePills.length > 0);
// Action button: STATE_IDLE (0) → "START MOVE" (green);
// any other state → "UNDO" (yellow). Single button replaces
// the old separate START/UNDO controls.
const actionBtn = ge('action_btn');
if (actionBtn) {
const isIdle = !data.state || data.state === 0;
actionBtn.textContent = isIdle ? 'START MOVE' : 'UNDO';
actionBtn.classList.toggle('moving', !isIdle);
}
const box = ge('status_indicators');
box.innerHTML = '';
for (const [, label, kind] of activePills) {
@@ -1557,15 +1640,22 @@ black: #2f2f2f
const payloadStart = i + 1;
const entry = { type };
try {
if (type >= 0 && type <= 13 && payloadSize >= 27) {
entry.ts_ms = Number(dv.getBigUint64(payloadStart + 0, true));
entry.bat_V = dv.getFloat32(payloadStart + 8, true);
entry.drive_A = dv.getFloat32(payloadStart + 12, true);
entry.jack_A = dv.getFloat32(payloadStart + 16, true);
entry.aux_A = dv.getFloat32(payloadStart + 20, true);
entry.counter = dv.getInt16(payloadStart + 24, true);
entry.sensors = bytes[payloadStart + 26];
entry.name = LOG_FSM_NAMES[type] || `STATE_${type}`;
if (type >= 0 && type <= 13 && payloadSize >= 19) {
// Single-current FSM payload (25 bytes):
// ts(8) bat(4) current(4) counter(2) sensors(1)
// heat(4) i2c_out(2)
entry.ts_ms = Number(dv.getBigUint64(payloadStart + 0, true));
entry.bat_V = dv.getFloat32(payloadStart + 8, true);
entry.current_A = dv.getFloat32(payloadStart + 12, true);
entry.counter = dv.getInt16(payloadStart + 16, true);
entry.sensors = bytes[payloadStart + 18];
if (payloadSize >= 23) {
entry.heat = dv.getFloat32(payloadStart + 19, true);
}
if (payloadSize >= 25) {
entry.i2c_out = dv.getUint16(payloadStart + 23, true);
}
entry.name = LOG_FSM_NAMES[type] || `STATE_${type}`;
} else if (type === LOG_TYPE_BAT && payloadSize >= 12) {
entry.ts_ms = Number(dv.getBigUint64(payloadStart, true));
entry.bat_V = dv.getFloat32(payloadStart + 8, true);
@@ -1596,16 +1686,22 @@ black: #2f2f2f
const sensorHex = e.sensors !== undefined
? '0x' + e.sensors.toString(16).padStart(2,'0')
: '';
const i2cHex = e.i2c_out !== undefined
? '0x' + e.i2c_out.toString(16).padStart(4,'0')
: '';
return [
{ text: _logFormatTs(e.ts_ms) },
{ text: e.name || '' },
{ text: e.bat_V !== undefined ? e.bat_V.toFixed(2) : '' },
{ text: e.drive_A !== undefined ? e.drive_A.toFixed(2) : '' },
{ text: e.jack_A !== undefined ? e.jack_A.toFixed(2) : '' },
{ text: e.aux_A !== undefined ? e.aux_A.toFixed(2) : '' },
{ text: e.counter !== undefined ? String(e.counter) : '' },
{ text: e.bat_V !== undefined ? e.bat_V.toFixed(2) : '' },
{ text: e.current_A !== undefined ? e.current_A.toFixed(2) : '' },
{ text: e.counter !== undefined ? String(e.counter) : '' },
{ text: sensorHex,
title: e.sensors !== undefined ? _decodeSensors(e.sensors) : undefined },
{ text: e.heat !== undefined ? e.heat.toFixed(2) : '' },
{ text: i2cHex,
title: e.i2c_out !== undefined
? '0b' + e.i2c_out.toString(2).padStart(16,'0')
: undefined },
{ text: e.reason || '' },
];
}
@@ -1635,7 +1731,7 @@ black: #2f2f2f
function _renderLogEntries(entries) {
const table = ge('log_viewer_table');
table.innerHTML = '';
const cols = ['Time','Type','Battery V','Drive A','Jack A','Aux A','Counter','Sensors','Extra'];
const cols = ['Time','Type','Battery V','Current A','Counter','Sensors','Heat','I2C Out','Extra'];
_appendRow(table, cols.map(h => ({ text: h, bold: true })));
// Walk newest-first, group contiguous entries sharing the same
@@ -1663,10 +1759,11 @@ black: #2f2f2f
const header = _appendRow(table, [{
text: `[+] ${name} × ${group.length} ${firstTs}${lastTs}`,
colSpan: cols.length,
style: { cursor: 'pointer', background: '#efede9',
style: { cursor: 'pointer', background: 'var(--surface-2)',
color: 'var(--text)',
fontWeight: 'bold', fontSize: '0.7rem' },
}], {
style: { background: '#efede9' },
style: { background: 'var(--surface-2)' },
});
// Defer wiring the onclick until we've appended the child rows.
const childRows = group.map(e =>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -21,6 +21,7 @@
#include "string.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_task_wdt.h"
#include "esp_wifi.h"
#include "esp_system.h"
@@ -61,7 +62,32 @@ extern const uint8_t prvtkey_pem_end[] asm("_binary_prvtkey_pem_end");
static httpd_handle_t http_server_instance = NULL;
/* Shared scratch buffer used by log/post/ota handlers. The httpd default
* config uses a single worker task, so handlers don't normally race — but
* with config.lru_purge_enable + 7 sockets some IDF configurations allow
* concurrent invocations. The mutex below is defense in depth: each
* handler that touches http_buffer takes it on entry via the wrap_*
* dispatcher below and releases on exit. */
char http_buffer[4096];
static SemaphoreHandle_t http_buffer_mutex = NULL;
static esp_err_t with_http_buffer(httpd_req_t *req,
esp_err_t (*body)(httpd_req_t *)) {
if (http_buffer_mutex != NULL) {
if (xSemaphoreTake(http_buffer_mutex, pdMS_TO_TICKS(2000)) != pdTRUE) {
/* esp_http_server's httpd_err_code_t enum doesn't include 503,
* so emit it via the lower-level set_status + send pair. */
ESP_LOGW(TAG, "http_buffer busy — rejecting request");
httpd_resp_set_status(req, "503 Service Unavailable");
httpd_resp_set_type(req, "text/plain");
httpd_resp_send(req, "busy", HTTPD_RESP_USE_STRLEN);
return ESP_FAIL;
}
}
esp_err_t ret = body(req);
if (http_buffer_mutex != NULL) xSemaphoreGive(http_buffer_mutex);
return ret;
}
/* Handler to serve the HTML page */
static esp_err_t root_get_handler(httpd_req_t *req) {
@@ -107,7 +133,11 @@ static const esp_partition_t *cached_log_partition = NULL;
// In webserver.c - Replace the log_handler function
static esp_err_t log_handler_locked(httpd_req_t *req);
static esp_err_t log_handler(httpd_req_t *req) {
return with_http_buffer(req, log_handler_locked);
}
static esp_err_t log_handler_locked(httpd_req_t *req) {
if (req == NULL) {
ESP_LOGE(TAG, "Null request pointer");
return ESP_FAIL;
@@ -443,7 +473,11 @@ static void webserver_restart_wifi_cb(void *arg) { webserver_restart_wifi(); }
/**
* Unified POST handler - handles commands, parameter updates, time updates
*/
static esp_err_t post_handler_locked(httpd_req_t *req);
static esp_err_t post_handler(httpd_req_t *req) {
return with_http_buffer(req, post_handler_locked);
}
static esp_err_t post_handler_locked(httpd_req_t *req) {
ESP_LOGI(TAG, "post_handler");
if (req == NULL) {
@@ -575,7 +609,11 @@ static esp_err_t post_handler(httpd_req_t *req) {
return err;
}
static esp_err_t ota_post_handler_locked(httpd_req_t *req);
static esp_err_t ota_post_handler(httpd_req_t *req) {
return with_http_buffer(req, ota_post_handler_locked);
}
static esp_err_t ota_post_handler_locked(httpd_req_t *req) {
ESP_LOGI(TAG, "OTA POST request received");
if (req == NULL) {
@@ -670,8 +708,10 @@ static esp_err_t ota_post_handler(httpd_req_t *req) {
remaining -= recv_len;
received += recv_len;
// Log progress every 10%
if (total_len > 0 && (received % (total_len / 10)) < recv_len) {
// Log progress every 10%. Guard against total_len < 10 (would
// otherwise divide by zero in the modulo) and total_len == 0
// (chunked transfer with unknown length).
if (total_len >= 10 && (received % (total_len / 10)) < recv_len) {
ESP_LOGI(TAG, "OTA progress: %d%%", (received * 100) / total_len);
}
}
@@ -834,6 +874,9 @@ static bool s_wifi_initted = false;
static esp_err_t start_http_server(void) {
if (server_running) return ESP_OK;
ESP_LOGI(TAG, "STARTING HTTP");
if (http_buffer_mutex == NULL) {
http_buffer_mutex = xSemaphoreCreateMutex();
}
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.server_port = 80;
config.max_open_sockets = 7;
@@ -891,20 +934,33 @@ static esp_err_t stop_http_server(void) {
int n_connected = 0;
/* Signaled by the WiFi event task when the AP fully stops. Used by
* webserver_restart_wifi() to deterministically wait for teardown to
* complete instead of racing on a fixed delay. */
static SemaphoreHandle_t s_ap_stopped_sem = NULL;
static void wifi_event_handler(void* arg, esp_event_base_t event_base,
int32_t event_id, void* event_data) {
if (event_base == WIFI_EVENT) {
if (event_id == WIFI_EVENT_AP_STOP) {
ESP_LOGI(TAG, "WIFI_EVENT_AP_STOP");
if (s_ap_stopped_sem) xSemaphoreGive(s_ap_stopped_sem);
return;
}
if (event_id == WIFI_EVENT_AP_STACONNECTED) {
wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
ESP_LOGI(TAG, "Station connected, AID=%d", event->aid);
rtc_reset_shutdown_timer();
n_connected++;
if (n_connected > 0) start_http_server();
/* HTTP lifecycle is no longer tied to client count — the server
* is started once in webserver_init() and stays up. Tying
* start/stop to events created races where rapid connect/
* disconnect bursts could call httpd_start twice or stop on
* the wrong tick. */
} else if (event_id == WIFI_EVENT_AP_STADISCONNECTED) {
wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
ESP_LOGI(TAG, "Station disconnected, AID=%d", event->aid);
n_connected--;
if (n_connected <= 0) stop_http_server();
if (n_connected > 0) n_connected--;
}
}
}
@@ -939,11 +995,24 @@ static esp_err_t wifi_common_init(void) {
return err;
}
if (s_ap_stopped_sem == NULL) {
s_ap_stopped_sem = xSemaphoreCreateBinary();
}
s_wifi_initted = true;
return ESP_OK;
}
static esp_err_t launch_soft_ap(void) {
/* If WiFi is already up, don't re-issue set_mode/set_config/start —
* those modify driver state on a running AP and can de-associate
* existing clients. The caller (typically webserver_init or
* BU.WIFI.START) just gets ESP_OK as if a fresh launch succeeded. */
if (s_wifi_running) {
ESP_LOGI(TAG, "AP already running — launch_soft_ap is a no-op");
return ESP_OK;
}
ESP_LOGI(TAG, "AP LAUNCHING");
if (s_ap_netif == NULL) {
@@ -987,7 +1056,15 @@ static esp_err_t launch_soft_ap(void) {
wifi_config.ap.channel = 6;
}
wifi_config.ap.ssid_len = strlen(ssid_str);
/* Clamp explicitly: the param store currently caps SSIDs at 16 bytes so
* the value is always within `wifi_config.ap.ssid` (32-byte) bounds, but
* if the param size ever grows the WiFi driver would read past the
* buffer. */
{
size_t len = strlen(ssid_str);
if (len > sizeof(wifi_config.ap.ssid)) len = sizeof(wifi_config.ap.ssid);
wifi_config.ap.ssid_len = (uint8_t)len;
}
err = esp_wifi_set_mode(WIFI_MODE_AP);
if (err != ESP_OK) { ESP_LOGE(TAG, "set_mode AP: %s", esp_err_to_name(err)); return err; }
@@ -1049,11 +1126,20 @@ esp_err_t webserver_restart_wifi(void) {
stop_http_server();
if (s_wifi_running) {
/* Drain any pre-existing token so xSemaphoreTake below blocks for a
* fresh AP_STOP event rather than returning immediately on stale
* state. */
if (s_ap_stopped_sem) xSemaphoreTake(s_ap_stopped_sem, 0);
esp_wifi_stop();
s_wifi_running = false;
/* Allow the event loop to drain the AP-stop event that
* esp_wifi_stop() queues asynchronously before we relaunch. */
vTaskDelay(pdMS_TO_TICKS(200));
/* Wait for the WiFi driver to finish tearing the AP down. The
* 1-second deadline is generous; on healthy hardware the event
* arrives within a few tens of ms. */
if (s_ap_stopped_sem) {
xSemaphoreTake(s_ap_stopped_sem, pdMS_TO_TICKS(1000));
} else {
vTaskDelay(pdMS_TO_TICKS(200));
}
}
esp_err_t err = start_wifi(false); // called from esp_timer task, not subscribed to WDT