Skip to content

Commit

Permalink
fix wifi fallover
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Feb 11, 2024
1 parent 067b2d0 commit 638cbbd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
46 changes: 26 additions & 20 deletions Modules/Teensy Rate/RCteensy/Send.ino
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,23 @@ void SendData()
UDPcomm.write(Data, 13);
UDPcomm.endPacket();
}
else if (millis() - ESPtime > 4000)
else
{
// send serial, ESP not connected
Serial.print(Data[0]);
for (int i = 1; i < 13; i++)
// send wifi
SerialESP->write(Data, 13);

if (millis() - ESPtime > 4000)
{
Serial.print(",");
Serial.print(Data[i]);
// send serial, wifi not connected
Serial.print(Data[0]);
for (int i = 1; i < 13; i++)
{
Serial.print(",");
Serial.print(Data[i]);
}
Serial.println("");
}
Serial.println("");
}

// to wifi
SerialESP->write(Data, 13);
}

//PGN32401, module, analog info from module to RC
Expand Down Expand Up @@ -147,20 +150,23 @@ void SendData()
UDPcomm.write(Data, 15);
UDPcomm.endPacket();
}
else if (millis() - ESPtime > 4000)
else
{
// send serial, ESP not connected
Serial.print(Data[0]);
for (int i = 1; i < 15; i++)
// send wifi
SerialESP->write(Data, 15);

if (millis() - ESPtime > 4000)
{
Serial.print(",");
Serial.print(Data[i]);
// send serial, wifi not connected
Serial.print(Data[0]);
for (int i = 1; i < 15; i++)
{
Serial.print(",");
Serial.print(Data[i]);
}
Serial.println("");
}
Serial.println("");
}

// to wifi
SerialESP->write(Data, 15);
}


Expand Down
7 changes: 2 additions & 5 deletions Modules/Wifi/WifiRC/WifiRC.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <EEPROM.h>

// Wemos D1 mini Pro, ESP 12F board: LOLIN(Wemos) D1 R2 & mini or NodeMCU 1.0 (ESP-12E Module)
# define InoDescription "WifiRC 09-Feb-2024"
# define InoID 9024 // change to load default values
# define InoDescription "WifiRC 10-Feb-2024"
# define InoID 10024 // change to load default values

struct WifiConnection
{
Expand Down Expand Up @@ -37,9 +37,6 @@ char WifiBuffer[512];
void setup()
{
DoSetup();
//Serial.begin(38400);
//pinMode(LED_BUILTIN, OUTPUT);
//Serial.println("Done setup");
}

void loop()
Expand Down
2 changes: 1 addition & 1 deletion Modules/Wifi/WifiRC/WifiRC.vcxproj

Large diffs are not rendered by default.

0 comments on commit 638cbbd

Please sign in to comment.