clean up cmake and swap humidity and pressure

This commit is contained in:
Travis Shears 2025-12-25 14:15:47 +01:00
parent d96ada276d
commit eac8412475
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
3 changed files with 6 additions and 15 deletions

View file

@ -24,8 +24,8 @@ pico_sdk_init()
set(WIFI_SSID "${WIFI_SSID}" CACHE INTERNAL "wifi ssid") set(WIFI_SSID "${WIFI_SSID}" CACHE INTERNAL "wifi ssid")
set(WIFI_PASSWORD "${WIFI_PASSWORD}" CACHE INTERNAL "wifi password") set(WIFI_PASSWORD "${WIFI_PASSWORD}" CACHE INTERNAL "wifi password")
# TODO: Update this to the real server not my macbook # TODO: Update this to the real server not my macbook
set(BACKEND_SERVER_IP "192.168.1.153" CACHE STRING "Backend server IP") set(BACKEND_SERVER_IP "192.168.1.156" CACHE STRING "Backend server IP")
set(BACKEND_SERVER_PORT "8080" CACHE STRING "Backend server port") set(BACKEND_SERVER_PORT "5025" CACHE STRING "Backend server port")
# the executable # the executable
add_executable(node1 node1.c bme280.c pms5003.c tcp_client.c) add_executable(node1 node1.c bme280.c pms5003.c tcp_client.c)

View file

@ -98,12 +98,12 @@ func (app *App) handleMsg(message *Message) {
slog.Error("Error parsing temperature", "error", err) slog.Error("Error parsing temperature", "error", err)
return return
} }
humidity, err := strconv.ParseFloat(message.Data[1], 32) humidity, err := strconv.ParseFloat(message.Data[2], 32)
if err != nil { if err != nil {
slog.Error("Error parsing humidity", "error", err) slog.Error("Error parsing humidity", "error", err)
return return
} }
pressure, err := strconv.ParseFloat(message.Data[2], 32) pressure, err := strconv.ParseFloat(message.Data[1], 32)
if err != nil { if err != nil {
slog.Error("Error parsing pressure", "error", err) slog.Error("Error parsing pressure", "error", err)
return return

13
node1.c
View file

@ -15,18 +15,9 @@
#include <hardware/watchdog.h> #include <hardware/watchdog.h>
// 5 sec loop is for testing // 5 sec loop is for testing
#define LOOP_INTERVAL_MS 5000 // #define LOOP_INTERVAL_MS 5000
// #define LOOP_INTERVAL_MS 10000 // #define LOOP_INTERVAL_MS 10000
// #define LOOP_INTERVAL_MS 30000 #define LOOP_INTERVAL_MS 30000
// WiFi and Backend Server Configuration
#ifndef BACKEND_SERVER_IP
#define BACKEND_SERVER_IP "192.168.1.153"
#endif
#ifndef BACKEND_SERVER_PORT
#define BACKEND_SERVER_PORT 8080
#endif
/** /**
* Balcony Weather Station Node 1 * Balcony Weather Station Node 1