Compare commits
2 Commits
7eba8c7286
...
8a84748a83
| Author | SHA1 | Date |
|---|---|---|
|
|
8a84748a83 | |
|
|
578d84c25e |
|
|
@ -117,8 +117,8 @@ size_t csi_serialize_frame(const wifi_csi_info_t *info, uint8_t *buf, size_t buf
|
|||
uint32_t magic = CSI_MAGIC;
|
||||
memcpy(&buf[0], &magic, 4);
|
||||
|
||||
/* Node ID */
|
||||
buf[4] = (uint8_t)CONFIG_CSI_NODE_ID;
|
||||
/* Node ID (from NVS runtime config, not compile-time Kconfig) */
|
||||
buf[4] = g_nvs_config.node_id;
|
||||
|
||||
/* Number of antennas */
|
||||
buf[5] = n_antennas;
|
||||
|
|
@ -273,7 +273,7 @@ void csi_collector_init(void)
|
|||
}
|
||||
|
||||
ESP_LOGI(TAG, "CSI collection initialized (node_id=%d, channel=%u)",
|
||||
CONFIG_CSI_NODE_ID, (unsigned)csi_channel);
|
||||
g_nvs_config.node_id, (unsigned)csi_channel);
|
||||
}
|
||||
|
||||
/* ---- ADR-029: Channel hopping ---- */
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@
|
|||
*/
|
||||
|
||||
#include "display_ui.h"
|
||||
#include "nvs_config.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
extern nvs_config_t g_nvs_config;
|
||||
|
||||
#if CONFIG_DISPLAY_ENABLE
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -347,11 +350,7 @@ void display_ui_update(void)
|
|||
{
|
||||
char buf[48];
|
||||
|
||||
#ifdef CONFIG_CSI_NODE_ID
|
||||
snprintf(buf, sizeof(buf), "Node: %d", CONFIG_CSI_NODE_ID);
|
||||
#else
|
||||
snprintf(buf, sizeof(buf), "Node: --");
|
||||
#endif
|
||||
snprintf(buf, sizeof(buf), "Node: %d", g_nvs_config.node_id);
|
||||
lv_label_set_text(s_sys_node, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), "Heap: %lu KB free",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
*/
|
||||
|
||||
#include "edge_processing.h"
|
||||
#include "nvs_config.h"
|
||||
#include "mmwave_sensor.h"
|
||||
|
||||
/* Runtime config — declared in main.c, loaded from NVS at boot. */
|
||||
extern nvs_config_t g_nvs_config;
|
||||
#include "wasm_runtime.h"
|
||||
#include "stream_sender.h"
|
||||
|
||||
|
|
@ -426,11 +430,7 @@ static void send_compressed_frame(const uint8_t *iq_data, uint16_t iq_len,
|
|||
uint32_t magic = EDGE_COMPRESSED_MAGIC;
|
||||
memcpy(&pkt[0], &magic, 4);
|
||||
|
||||
#ifdef CONFIG_CSI_NODE_ID
|
||||
pkt[4] = (uint8_t)CONFIG_CSI_NODE_ID;
|
||||
#else
|
||||
pkt[4] = 0;
|
||||
#endif
|
||||
pkt[4] = g_nvs_config.node_id;
|
||||
pkt[5] = channel;
|
||||
memcpy(&pkt[6], &iq_len, 2);
|
||||
memcpy(&pkt[8], &comp_len, 2);
|
||||
|
|
@ -548,11 +548,7 @@ static void send_vitals_packet(void)
|
|||
memset(&pkt, 0, sizeof(pkt));
|
||||
|
||||
pkt.magic = EDGE_VITALS_MAGIC;
|
||||
#ifdef CONFIG_CSI_NODE_ID
|
||||
pkt.node_id = (uint8_t)CONFIG_CSI_NODE_ID;
|
||||
#else
|
||||
pkt.node_id = 0;
|
||||
#endif
|
||||
pkt.node_id = g_nvs_config.node_id;
|
||||
|
||||
pkt.flags = 0;
|
||||
if (s_presence_detected) pkt.flags |= 0x01;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#include "sdkconfig.h"
|
||||
#include "wasm_runtime.h"
|
||||
#include "nvs_config.h"
|
||||
|
||||
extern nvs_config_t g_nvs_config;
|
||||
|
||||
#if defined(CONFIG_WASM_ENABLE) && defined(WASM3_AVAILABLE)
|
||||
|
||||
|
|
@ -380,11 +383,7 @@ static void send_wasm_output(uint8_t slot_id)
|
|||
memset(&pkt, 0, sizeof(pkt));
|
||||
|
||||
pkt.magic = WASM_OUTPUT_MAGIC;
|
||||
#ifdef CONFIG_CSI_NODE_ID
|
||||
pkt.node_id = (uint8_t)CONFIG_CSI_NODE_ID;
|
||||
#else
|
||||
pkt.node_id = 0;
|
||||
#endif
|
||||
pkt.node_id = g_nvs_config.node_id;
|
||||
pkt.module_id = slot_id;
|
||||
pkt.event_count = n_filtered;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,11 +113,11 @@ export function buildApiUrl(endpoint, params = {}) {
|
|||
|
||||
// Helper function to build WebSocket URLs
|
||||
export function buildWsUrl(endpoint, params = {}) {
|
||||
// Use secure WebSocket (wss://) when serving over HTTPS or on non-localhost
|
||||
// Use ws:// only for localhost development
|
||||
const isLocalhost = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
|
||||
// Match WebSocket protocol to page protocol: https → wss, http → ws.
|
||||
// Previous logic forced wss:// on non-localhost HTTP, breaking LAN/Docker
|
||||
// deployments served over plain HTTP. See issue #272.
|
||||
const isSecure = window.location.protocol === 'https:';
|
||||
const protocol = (isSecure || !isLocalhost)
|
||||
const protocol = isSecure
|
||||
? API_CONFIG.WSS_PREFIX
|
||||
: API_CONFIG.WS_PREFIX;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue