Saied74 / dishmaster

Program for controlling a dish antenna
0 stars 0 forks source link

Heartbeat #1

Closed Saied74 closed 9 months ago

Saied74 commented 9 months ago

According to RoboClaw documentation, if the communication with the device stops, it will assume that it has to stop. Right now, the software does not stop talking to the RoboClaw during error conditions.

The fix will involve counting the number of errors and if they exceed a certain threshold, stop talking to RoboClaw.

Saied74 commented 9 months ago

Currently, when the number of errors exceed a limit (6) or a value out of the min/max range is read from the RoboClaw, the move loop (in move.go) becomes a no op (a continuous "continue" statement. I don't know if this will stop the heartbeat or not because the fix I put for the race condition may have made things better so I don't get bogus reads (or maybe I never got bogus reads). We will have to see how I might test this.

Saied74 commented 9 months ago

RoboClaw default setting is no timeout. I added a command to the initialization function (called on startup and on recalibration) to set the timeout to 2 seconds. Tested by telling RoboClaw to make a large move and in the middle disconnected the serial link. It stopped after 2 seconds. Closed. fixed in v0.6