get tcp working
This commit is contained in:
parent
f107bfb55b
commit
65ad286add
2 changed files with 23 additions and 28 deletions
14
node1.c
14
node1.c
|
|
@ -145,13 +145,13 @@ static bool cb_30(__unused struct repeating_timer *t) {
|
||||||
current_bem280_reading.humidity);
|
current_bem280_reading.humidity);
|
||||||
printf("Sending data to backend server...\n");
|
printf("Sending data to backend server...\n");
|
||||||
printf("MSG: %s", msg);
|
printf("MSG: %s", msg);
|
||||||
// bool success = tcp_client_send_message(&tcp_config, msg);
|
bool success = tcp_client_send_message(&tcp_config, msg);
|
||||||
// if (success) {
|
if (success) {
|
||||||
// printf("✓ Data sent successfully\n");
|
printf("✓ Data sent successfully\n");
|
||||||
// comms_led_blink();
|
comms_led_blink();
|
||||||
// } else {
|
} else {
|
||||||
// printf("✗ Failed to send data\n");
|
printf("✗ Failed to send data\n");
|
||||||
// }
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("WiFi not connected, skipping send\n");
|
printf("WiFi not connected, skipping send\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -232,13 +232,8 @@ bool tcp_client_send_message(tcp_client_config *config, const char *message) {
|
||||||
state->success = false;
|
state->success = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PICO_CYW43_ARCH_POLL
|
|
||||||
cyw43_arch_poll();
|
cyw43_arch_poll();
|
||||||
cyw43_arch_wait_for_work_until(make_timeout_time_ms(100));
|
cyw43_arch_wait_for_work_until(make_timeout_time_ms(100));
|
||||||
#else
|
|
||||||
sleep_ms(100);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = state->success;
|
bool success = state->success;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue