fix: correct XIAO RS485 UART pin mapping

This commit is contained in:
2026-07-26 18:26:36 -06:00
parent fea549d1e2
commit 753d13157e
9 changed files with 19 additions and 7 deletions
@@ -1,6 +1,6 @@
#pragma once
static const char *DASHBOARD_VERSION = "0.1.131-rs485-sensor-stats";
static const char *DASHBOARD_VERSION = "0.1.132-rs485-raw-diagnostics";
// First-boot defaults. Credentials are stored in Preferences/NVS after setup.
static const char *DASHBOARD_DEFAULT_CARGO_WIFI_SSID = "OverlandController";
@@ -687,6 +687,12 @@ static void update_diagnostics_overlay()
text += String(sensor_node.framesDropped);
text += "/";
text += String(sensor_node.parseErrors + sensor_node.oversizedFrames);
text += "\n Raw bytes/age: ";
text += String(sensor_node.bytesReceived);
text += "/";
text += sensor_node.bytesReceived
? String(millis() - sensor_node.lastByteMs) + " ms"
: String("--");
text += "\n Frame age: ";
text += sensor_node.frameReceived
? String(millis() - sensor_node.lastFrameMs) + " ms"
@@ -117,6 +117,8 @@ void initSensorNodeRs485() {
void processSensorNodeRs485() {
while (sensorNodeSerial.available() > 0) {
char value = (char)sensorNodeSerial.read();
sensorNodeStatus.bytesReceived++;
sensorNodeStatus.lastByteMs = millis();
if (value == '\r') continue;
if (value != '\n') {
@@ -16,6 +16,7 @@ struct SensorNodeDashboardStatus {
uint32_t framesDropped = 0;
uint32_t parseErrors = 0;
uint32_t oversizedFrames = 0;
uint32_t bytesReceived = 0;
uint32_t nodeRestarts = 0;
uint32_t satellites = 0;
float pitchDegrees = 0;
@@ -29,6 +30,7 @@ struct SensorNodeDashboardStatus {
String stability = "unknown";
String firmwareVersion;
String utcTime;
unsigned long lastByteMs = 0;
unsigned long lastFrameMs = 0;
};
+1 -1
View File
@@ -4,7 +4,7 @@ This Arduino sketch reads a BNO086 IMU and MAX-M10S GPS and publishes versioned,
| Function | XIAO pin |
| --- | --- |
| RS485 DE / TX / RX | D2 / D4 / D5 |
| RS485 DE / RX / TX | D2 / D4 / D5 |
| BNO086 SDA / SCL | D7 / D8 |
| GPS TX to XIAO RX | D9 |
| GPS RX from XIAO TX | D10 |
@@ -2,11 +2,11 @@
#include <Arduino.h>
#define SENSOR_NODE_NAME "xiao_c6_sensor_node"
#define SENSOR_NODE_FIRMWARE_VERSION "0.2.0"
#define SENSOR_NODE_FIRMWARE_VERSION "0.2.1"
#define SENSOR_NODE_SCHEMA_VERSION 1
#define RS485_DE_PIN D2
#define RS485_TX_PIN D4
#define RS485_RX_PIN D5
#define RS485_RX_PIN D4
#define RS485_TX_PIN D5
#define BNO086_SDA_PIN D7
#define BNO086_SCL_PIN D8
#define GPS_RX_PIN D9