diff --git a/CmakeLists.txt b/CmakeLists.txt index d522ed3..df4acde 100644 --- a/CmakeLists.txt +++ b/CmakeLists.txt @@ -24,8 +24,8 @@ pico_sdk_init() set(WIFI_SSID "${WIFI_SSID}" CACHE INTERNAL "wifi ssid") set(WIFI_PASSWORD "${WIFI_PASSWORD}" CACHE INTERNAL "wifi password") # 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_PORT "8080" CACHE STRING "Backend server port") +set(BACKEND_SERVER_IP "192.168.1.156" CACHE STRING "Backend server IP") +set(BACKEND_SERVER_PORT "5025" CACHE STRING "Backend server port") # the executable add_executable(node1 node1.c bme280.c pms5003.c tcp_client.c) diff --git a/event_proxy/main.go b/event_proxy/main.go index 26d4843..d55d680 100644 --- a/event_proxy/main.go +++ b/event_proxy/main.go @@ -98,12 +98,12 @@ func (app *App) handleMsg(message *Message) { slog.Error("Error parsing temperature", "error", err) return } - humidity, err := strconv.ParseFloat(message.Data[1], 32) + humidity, err := strconv.ParseFloat(message.Data[2], 32) if err != nil { slog.Error("Error parsing humidity", "error", err) return } - pressure, err := strconv.ParseFloat(message.Data[2], 32) + pressure, err := strconv.ParseFloat(message.Data[1], 32) if err != nil { slog.Error("Error parsing pressure", "error", err) return diff --git a/node1.c b/node1.c index a02010e..4982697 100644 --- a/node1.c +++ b/node1.c @@ -15,18 +15,9 @@ #include // 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 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 +#define LOOP_INTERVAL_MS 30000 /** * Balcony Weather Station Node 1