FORMATTED MESSAGE:
Robot Boat messaging protocol
HOW TO:
FULL MOTOR RESET:
In case of motor not working, calibration may have gotten out of sync.set flag to MOTOR OFF, and RESTART ARDUINO.
Relay will disable power to esc and then the arduino will reboot resetting the signal to the ESC. This will resume normal motor operation.
IF PIXHAWK IS REBOOTED: Navigation will reset to the first waypoint/command. You must create a new waypoint so as not to backtrack to the first waypoint if the boat has passed the first waypoint/command. There is no way around this. Additional waypoints will need to be uploaded for course corrections.
ARDUINO MESSAGE PROTOCOL:
//////////SENDING//////////
COMMANDS:
1. MOTOR OFF/ON (Motor On power cycles ESC for 15s | Motor Power Off uses relay to turn off power to ESC and motor) (0 - DO NOTHING, 1 ON, 2+ OFF)
2. RESTART PIXHAWK VIA MAVLINK after 15 seconds (0 NO, 1+ YES)
3. POWER CYCLE PX4 & SERVO (0 - NO, 1 - YES, 2 - DISABLE PIXHAWK HB WATCHDOG, 3 - ENABLE PIXHAWK HB WATCHDOG)
4. RESTART ARDUINO (0 - NO, 1 - YES, 2 - DISABLE ARDUINO WATCHDOG, 3 - ENABLE ARDUINO WATCHDOG)
5. CHANGE SEND/RECEIVE INTERVAL (0 NO, 1-6 set freq)
6. NEW WAYPOINT 0 = NO, 1+ = YES and ENTER IN 7 (LAT) and 8 (LONG)
7. LAT
8. LONG
FORMAT:
Need to specify 0 as placeholders if changing any one variable.
Multiple variables can be changed at the same time, but placeholder 0's must be used.
1 2 3 4 5 6 7 8
0|0|0|0|0|0|,LAT|,:LONG|
If NEW WAYPOINT FLAG = 0 then it is OK to just send commands only
0|0|0|0|6|0|
EXAMPLE SEND:
Commands only:
210020 - Motor monitor off, restart pixhawk via mavlink, dont restart px4/servo, dont restart arduino, interval to 1 hour, no new GPS coords
000040 - Motor monitor do nothing, dont restart pixhawk via mavlink, dont restart px4/servo, dont restart arduino, interval to 4 hours, no new gps coords
Commands WITH new GPS Coords (latitude followed immediately by longitude)
*THERE SHOULD BE NO SPACES IN THE MESSAGE LINE (separated for ease of reading):
000001,31.0529340,:-132.070312 (latitude is not negative)
000001,-31.0529340,:132.070312 (longitude is not negative)
000001,-31.0529340,:-132.070312 (both are negative)
000001,31.0529340,:132.070312 (both are positive)
000201,22.0529340,:-121.070312
Variables for SEND/RECEIVE INTERVAL:
0 = Do nothing
1 = Set datcol_Interval to 30 minutes
2 = Set datcol_Interval to 1 hour
3 = Set datcol_Interval to 2 hours
4 = Set datcol_Interval to 4 hours
5 = Set datcol_Interval to 6 hours
6 = Set datcol_Interval to 8 hours
//////// RECEIVE /////////
SERIAL OUTPUT OF SBD TEXT MESSAGE
Formatted Test message:
3,00,142,0011,1,99,1,00,00,00, 49, 69, 60, 67, 67, 67, 0, 33.6297570,-112.4588
RECEIVE FORMAT:
1. gps_Fix,
2. gps_Vel, //decoupling_count, for second launch
3. gps_Head,
4. sys_Bat,
5. sys_Bcur,
6. sys_Brem, //motor_speed_selection, for second launch
7. leaksensor_Value,
8. capsized_Times,
9. px4_Resetcounter,
10. motor_Counter,
11. dht1_hum,
12. dht1_temp,
13. dht2_hum,
14. dht2_temp,
15. motor_Temperature,
16. rudder_Temperature,
17. rpm,
18. buff_Lat,
19. buff_Long,
//////// MISCELLANEOUS /////////
ARDUINO WATCHDOG:
Arduino watchdog resets for the first time after ~6:20, and then ~3:20 consecutively.
IRIDIUM STATUS CODE ERRORS
ISBD_SUCCESS 0
ISBD_ALREADY_AWAKE 1
ISBD_SERIAL_FAILURE 2
ISBD_PROTOCOL_ERROR 3
ISBD_CANCELLED 4
ISBD_NO_MODEM_DETECTED 5
ISBD_SBDIX_FATAL_ERROR 6
ISBD_SENDRECEIVE_TIMEOUT 7
ISBD_RX_OVERFLOW 8
ISBD_REENTRANT 9
ISBD_IS_ASLEEP 10 (if modem is not detected this will show when S&R)
ISBD_NO_SLEEP_PIN 11
Iridium library will take 4 minutes to timeout initial send and receive
MYSQL Columns
1. gps_fix,
2. gps_vel,
3. gps_head,
4. sys_bat,
5. sys_bcur,
6. sys_brem,
7. leak_value,
8. capsized_times,
9. px4_resetcounter,
10. motor_counter,
11. dht1_hum,
12. dht1_temp,
13. dht2_hum,
14. dht2_temp,
15. motor_temperature,
16. rudder_temperature,
17. rpm,
18. buff_Lat,
19. buff_Long,