clean up cmake and swap humidity and pressure
This commit is contained in:
parent
d96ada276d
commit
eac8412475
3 changed files with 6 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
13
node1.c
13
node1.c
|
|
@ -15,18 +15,9 @@
|
|||
#include <hardware/watchdog.h>
|
||||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue