Skip to content

DO-NOT-MERGE: Changes from leeUpdates to release_candidate #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
247cbf4
makefile: Update library versions
LeeLeahy2 May 13, 2025
e9c5b13
RTK_Everywhere: Reorder initial defines, make L_BAND conditional on ZED
LeeLeahy2 May 13, 2025
7134dc8
Add bash scripts to simplify testing and rebase operations
LeeLeahy2 May 4, 2025
c116ab1
Fix various bugs
LeeLeahy2 May 13, 2025
c019312
Cleanup spacing
LeeLeahy2 May 12, 2025
5885abe
GNSS: Updates from release_candidate
LeeLeahy2 May 12, 2025
02b793d
Rename routines and variables
LeeLeahy2 May 12, 2025
cd8f5f9
ESPNOW: Update use of espNowBroadcastAddr and espNowAddPeer
LeeLeahy2 May 12, 2025
3134305
ESPNOW: Move routines
LeeLeahy2 May 12, 2025
b30a441
ESPNOW: Display error code name
LeeLeahy2 May 12, 2025
be31336
Switch from digitalRead to readAnalogPinAsDigital
LeeLeahy2 May 12, 2025
8904a0e
Display: Include release_candidate changes
LeeLeahy2 May 12, 2025
8e2ebb3
PointPerfect: Update with release_candidate changes
LeeLeahy2 May 12, 2025
6955cb8
Simplify periodically display off state reason
LeeLeahy2 May 12, 2025
d8985bf
MQTT_Client: Add mqttClientPrintSubscribedTopics
LeeLeahy2 May 12, 2025
1fd4afc
NTP: Add comments, restrict to Ethernet
LeeLeahy2 May 12, 2025
fe630d4
NtripServer: Simplify server index lookup
LeeLeahy2 May 12, 2025
d077a76
Wrap some lines
LeeLeahy2 May 12, 2025
c277e40
Network: Add new routines
LeeLeahy2 May 13, 2025
731765f
Network: Remove fileName and lineNumber from *InternetConnectionLost
LeeLeahy2 May 13, 2025
2694141
Network: Determine if the current interface has internet access
LeeLeahy2 May 13, 2025
773fcba
TcpServer: Check for soft AP or internet access
LeeLeahy2 May 13, 2025
89f1d3c
WebServer: Add comments and stack size variable
LeeLeahy2 May 13, 2025
732db3e
WiFi: Add wifiSoftApGetIpAddress, and move routines
LeeLeahy2 May 13, 2025
1c49b35
States: Start WiFi and ESPNOW if configured in ROVER mode
LeeLeahy2 May 13, 2025
33b4207
States: Don't allow Base to be in an unknown mode, set SURVEY_IN early
LeeLeahy2 May 13, 2025
c1ce569
menuCommands: Add code from release_candidate
LeeLeahy2 May 13, 2025
5509dde
icons: Add code from release_candidate
LeeLeahy2 May 13, 2025
c6abbde
menuFirmware: Add otaPullErrorText routine
LeeLeahy2 May 13, 2025
15c9463
menuMain: Add more debug output, update comments
LeeLeahy2 May 13, 2025
b5ffebb
menuPP: Simplify logic
LeeLeahy2 May 13, 2025
d82c4c8
menuPP: Merge release_candidate changes
LeeLeahy2 May 13, 2025
8c309de
menuPorts: Add changes from release_candidate
LeeLeahy2 May 13, 2025
b92a7d5
settings: Add NETCONSUMER_NTRIP_SERVER
LeeLeahy2 May 13, 2025
85b3161
settings: Include changes from release_candidate to remove dead code
LeeLeahy2 May 13, 2025
ee48e12
RTK_Everywhere: Add changes from release_candidate
LeeLeahy2 May 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ void beginSD()
}

// Load firmware file from the microSD card if it is present
microSdScanForFirmware();
microSDScanForFirmware();

// Mark card not yet usable for logging
sdCardSize = 0;
Expand Down
4 changes: 2 additions & 2 deletions Firmware/RTK_Everywhere/Buttons.ino
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void powerDown(bool displayInfo)
{
// Platforms with power control won't get here
// Postcard will get here if the battery is too low

systemPrintln("Device powered down");
delay(5000);

Expand Down Expand Up @@ -224,4 +224,4 @@ bool buttonPressedFor(uint8_t buttonNumber, uint16_t maxTime)
uint8_t buttonLastPressed()
{
return (gpioExpander_lastReleased);
}
}
8 changes: 4 additions & 4 deletions Firmware/RTK_Everywhere/Developer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ void webServerVerifyTables() {}

#ifndef COMPILE_ESPNOW

bool espnowGetState() {return ESPNOW_OFF;}
bool espNowGetState() {return ESPNOW_OFF;}
bool espNowIsPaired() {return false;}
void espNowProcessRTCM(byte incoming) {}
bool espNowProcessRxPairedMessage() {return true;}
esp_err_t espNowRemovePeer(uint8_t *peerMac) {return ESP_OK;}
esp_err_t espNowSendPairMessage() {return ESP_OK;}
bool espnowSetChannel(uint8_t channelNumber) {return false;}
esp_err_t espNowRemovePeer(const uint8_t *peerMac) {return ESP_OK;}
esp_err_t espNowSendPairMessage(const uint8_t *sendToMac) {return ESP_OK;}
bool espNowSetChannel(uint8_t channelNumber) {return false;}
bool espNowStart() {return true;}
void espNowStaticPairing() {}
bool espNowStop() {return true;}
Expand Down
311 changes: 209 additions & 102 deletions Firmware/RTK_Everywhere/Display.ino

Large diffs are not rendered by default.

138 changes: 63 additions & 75 deletions Firmware/RTK_Everywhere/ESPNOW.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@

#ifdef COMPILE_ESPNOW

//****************************************
// Constants
//****************************************

const uint8_t espNowBroadcastAddr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

//****************************************
// Types
//****************************************
Expand All @@ -51,18 +45,12 @@ unsigned long espNowLastAdd; // Tracks how long since the last byte was added to
unsigned long espNowLastRssiUpdate;
uint8_t espNowOutgoing[250]; // ESP NOW has max of 250 characters
uint8_t espNowOutgoingSpot; // ESP Now has a max of 250 characters
uint8_t espNowReceivedMAC[6]; // Holds the broadcast MAC during pairing
uint8_t espNowReceivedMAC[6]; // Holds the MAC received during pairing
ESPNOWState espNowState;

//****************************************
// Forward routine declarations
//****************************************

esp_err_t espNowSendPairMessage(const uint8_t *sendToMac = espNowBroadcastAddr);

//*********************************************************************
// Add a peer to the ESP-NOW network
esp_err_t espNowAddPeer(const uint8_t * peerMac)
esp_err_t espNowAddPeer(const uint8_t * peerMac, bool encrypt)
{
esp_now_peer_info_t peerInfo;

Expand All @@ -76,24 +64,26 @@ esp_err_t espNowAddPeer(const uint8_t * peerMac)
if (settings.debugEspNow)
systemPrintf("Calling esp_now_add_peer\r\n");
esp_err_t result = esp_now_add_peer(&peerInfo);
if (settings.debugEspNow == true)
if (result != ESP_OK)
{
if (result != ESP_OK)
systemPrintf("ERROR: Failed to add ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, result: %s\r\n",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5],
esp_err_to_name(result));
else
systemPrintf("Added ESP-NOW %s peer %02x:%02x:%02x:%02x:%02x:%02x\r\n",
peerInfo.encrypt ? "encrypted" : "unencrypted",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5]);
systemPrintf("ERROR: Failed to add ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, result: %d (%s)\r\n",
peerMac[0], peerMac[1], peerMac[2], peerMac[3],
peerMac[4], peerMac[5], result, esp_err_to_name(result));
}
else if (settings.debugEspNow)
systemPrintf("Added ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x\r\n",
peerMac[0], peerMac[1], peerMac[2], peerMac[3],
peerMac[4], peerMac[5]);
return result;
}

//*********************************************************************
// Add a given MAC address to the peer list
esp_err_t espNowAddPeer(const uint8_t *peerMac)
{
return espNowAddPeer(peerMac, true); // Encrypt by default
}

//*********************************************************************
// Start ESP-Now if needed, put ESP-Now into broadcast state
void espNowBeginPairing()
Expand All @@ -102,7 +92,7 @@ void espNowBeginPairing()
wifiEspNowOn(__FILE__, __LINE__);

// To begin pairing, we must add the broadcast MAC to the peer list
espNowAddPeer(espNowBroadcastAddr);
espNowAddPeer(espNowBroadcastAddr, false); // Encryption is not supported for multicast addresses

espNowSetState(ESPNOW_PAIRING);
}
Expand Down Expand Up @@ -220,28 +210,6 @@ void espNowProcessRTCM(byte incoming)
}
}

//*********************************************************************
// Remove a given MAC address from the peer list
esp_err_t espNowRemovePeer(const uint8_t *peerMac)
{
esp_err_t result = esp_now_del_peer(peerMac);
if (settings.debugEspNow == true)
{
if (result != ESP_OK)
systemPrintf("ERROR: Failed to remove ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, result: %s\r\n",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5],
esp_err_to_name(result));
else
systemPrintf("Removed ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x\r\n",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5]);
}
return result;
}

//*********************************************************************
// Update the state of the ESP Now state machine
//
Expand Down Expand Up @@ -318,6 +286,47 @@ bool espNowProcessRxPairedMessage()
return (true);
}

//*********************************************************************
// Remove a given MAC address from the peer list
esp_err_t espNowRemovePeer(const uint8_t *peerMac)
{
esp_err_t result = esp_now_del_peer(peerMac);
if (settings.debugEspNow == true)
{
if (result != ESP_OK)
systemPrintf("ERROR: Failed to remove ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, result: %s\r\n",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5],
esp_err_to_name(result));
else
systemPrintf("Removed ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x\r\n",
peerMac[0], peerMac[1],
peerMac[2], peerMac[3],
peerMac[4], peerMac[5]);
}
return result;
}

//*********************************************************************
// Create special pair packet to a given MAC
esp_err_t espNowSendPairMessage(const uint8_t *sendToMac)
{
// Assemble message to send
ESP_NOW_PAIR_MESSAGE pairMessage;

// Get unit MAC address
memcpy(pairMessage.macAddress, wifiMACAddress, 6);
pairMessage.encrypt = false;
pairMessage.channel = 0;

pairMessage.crc = 0; // Calculate CRC
for (int x = 0; x < 6; x++)
pairMessage.crc += wifiMACAddress[x];

return (esp_now_send(sendToMac, (uint8_t *)&pairMessage, sizeof(pairMessage))); // Send packet to given MAC
}

//*********************************************************************
// Update the state of the ESP-NOW subsystem
void espNowSetState(ESPNOWState newState)
Expand Down Expand Up @@ -365,25 +374,6 @@ void espNowSetState(ESPNOWState newState)
espNowState = newState;
}

//*********************************************************************
// Create special pair packet to a given MAC
esp_err_t espNowSendPairMessage(const uint8_t *sendToMac)
{
// Assemble message to send
ESP_NOW_PAIR_MESSAGE pairMessage;

// Get unit MAC address
memcpy(pairMessage.macAddress, wifiMACAddress, 6);
pairMessage.encrypt = false;
pairMessage.channel = 0;

pairMessage.crc = 0; // Calculate CRC
for (int x = 0; x < 6; x++)
pairMessage.crc += wifiMACAddress[x];

return (esp_now_send(sendToMac, (uint8_t *)&pairMessage, sizeof(pairMessage))); // Send packet to given MAC
}

//*********************************************************************
// Start ESP-NOW layer
bool espNowStart()
Expand Down Expand Up @@ -446,7 +436,7 @@ bool espNowStart()
espNowSetState(ESPNOW_PAIRED);

if (settings.debugEspNow == true)
systemPrintf("Adding %d espnow peers\r\n", settings.espnowPeerCount);
systemPrintf("Adding %d espNow peers\r\n", settings.espnowPeerCount);

// Loop through peers listed in settings
for (index = 0; index < ESPNOW_MAX_PEERS; index++)
Expand Down Expand Up @@ -481,14 +471,14 @@ bool espNowStart()
else
{
if (settings.debugEspNow == true)
systemPrintf("ERROR: Failed to add ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, status: %s\r\n",
systemPrintf("ERROR: Failed to add ESP-NOW peer %02x:%02x:%02x:%02x:%02x:%02x, status: %d, %s\r\n",
settings.espnowPeers[index][0],
settings.espnowPeers[index][1],
settings.espnowPeers[index][2],
settings.espnowPeers[index][3],
settings.espnowPeers[index][4],
settings.espnowPeers[index][5],
esp_err_to_name(status));
status, esp_err_to_name(status));
break;
}
}
Expand Down Expand Up @@ -547,7 +537,7 @@ void espNowStaticPairing()
}
}

espNowSendPairMessage(); // Send unit's MAC address over broadcast, no ack, no encryption
espNowSendPairMessage(espNowBroadcastAddr); // Send unit's MAC address over broadcast, no ack, no encryption

systemPrintln("Scanning for other radio...");
}
Expand Down Expand Up @@ -693,10 +683,8 @@ void espNowUpdate()
if (espNowState == ESPNOW_PAIRED)
esp_now_send(0, (uint8_t *)&espNowOutgoing, espNowOutgoingSpot); // Send partial packet to all peers
else // if (espNowState == ESPNOW_BROADCASTING)
{
esp_now_send(espNowBroadcastAddr, (uint8_t *)&espNowOutgoing,
espNowOutgoingSpot); // Send packet via broadcast
}

if (!inMainMenu)
{
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/GNSS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ void pushGPGGA(char *ggaData)
}
}
#endif // COMPILE_NETWORK
}
}
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/GNSS_LG290P.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class GNSS_LG290P : GNSS
// Returns true if successfully started and false upon failure
bool enableRTCMTest();

bool enterConfigMode();
bool enterConfigMode(unsigned long waitForSemaphoreTimeout_millis);

bool exitConfigMode();

Expand Down
Loading