Skip to content

Commit

Permalink
Update ZgatewaySERIAL.ino Fix tx issues
Browse files Browse the repository at this point in the history
The serial gateway can only receive serial data and publish via mqtt, but can not convert mqtt into serial data. It is because the receiverReady is not handled correctly for the tx part. A quick work around is to set receiverReady to true. (it seems not used)
  • Loading branch information
mycprotein committed Jan 7, 2025
1 parent 4d6e7f4 commit 1618ded
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main/ZgatewaySERIAL.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ const TickType_t semaphoreTimeout = pdMS_TO_TICKS(1000); // 1 second timeout
# define SEMAPHORE_SERIAL_GIVE
# endif

# ifdef SENDER_SERIAL_HEARTBEAT
bool receiverReady = false;
# else
bool receiverReady = true;
# endif

// use pointer to stream class for serial communication to make code
// compatible with both softwareSerial as hardwareSerial.
Stream* SERIALStream = NULL;
//unsigned long msgCount = 0;

bool receiverReady = false;
unsigned long lastHeartbeatReceived = 0;
unsigned long lastHeartbeatAckReceived = 0;
unsigned long lastHeartbeatSent = 0;
Expand Down Expand Up @@ -372,4 +377,4 @@ void handleHeartbeat() {
sendHeartbeatAck();
}
}
#endif
#endif

0 comments on commit 1618ded

Please sign in to comment.