-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Add support for Rockblock 9704 satellite modem #31296
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
Open
stephendade
wants to merge
3
commits into
ArduPilot:master
Choose a base branch
from
stephendade:feat-7904
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# RockBlock 9704 Lua Script | ||
|
||
A Lua script for ArduPilot that enables satellite communication | ||
using the RockBlock 9704 SBD modem to send and receive basic MAVLink telemetry. | ||
|
||
Requires https://github.com/stephendade/rockblock2mav (MQTT client) at the GCS end | ||
|
||
Messages will be send or received if High Latency Mode is enabled, or as configured | ||
by ``RK9_FORCEHL``. | ||
|
||
Setup: | ||
This script requires: | ||
- A SERIALn port, set to Scripting. Connect to the RXD/TXD lines of the Rockblock's header | ||
- A SCR_SDEVn (virtual) port, set to MAVLink High Latency. Requires SCR_SDEV_EN=1 | ||
- A relay output connected to the I_EN pin of the Rockblock's header | ||
- A GPIO input connected to the I_BTD pin of the Rockblock's header | ||
|
||
The Rockblock's V_IN- and V_IN+ header pins can be connected to the flight controller's GND and +5V pins respectively. | ||
|
||
Caveats: | ||
- This will *only* send HIGH_LATENCY2 packets via the SBD modem. No heartbeats, no command acknowledgements, no statustexts, no parameters, etc | ||
- A single HIGH_LATENCY2 packet will be sent every RK9_PERIOD sec | ||
|
||
# Parameters | ||
|
||
The script has the following parameters: | ||
|
||
## RK9_FORCEHL | ||
|
||
Mode of operation: | ||
- 0 = start disabled, can be enabled via MAV_CMD_CONTROL_HIGH_LATENCY (default) | ||
- 1 = start enabled, can be disabled via MAV_CMD_CONTROL_HIGH_LATENCY | ||
- 2 = enabled on loss of telemetry (GCS) link for RK9_TIMEOUT seconds | ||
|
||
## RK9_PERIOD | ||
|
||
When in High Latency mode, send Rockblock updates every RK9_PERIOD seconds. Defaults to 30 seconds. | ||
|
||
## RK9_DEBUG | ||
|
||
Sends Rockblock debug text to GCS via statustexts. Defaults to 0 (disabled). | ||
|
||
## RK9_ENABLE | ||
|
||
Enables the modem transmission. Defaults to 1 (enabled). | ||
|
||
## RK9_TIMEOUT | ||
|
||
If RK9_FORCEHL=2, this is the number of seconds of no-messages from the GCS until High Latency mode is auto-enabled. | ||
Defaults to 5 seconds. | ||
|
||
## RK9_SERPORT | ||
|
||
Serial port number to which the Rockblock is connected. | ||
This is the index of the SERIALn_ ports that are set to 28 for "scripting". Defaults to 0. | ||
|
||
## RK9_SCRPORT | ||
|
||
Scripting Serial port number to which the Rockblock is connected for HL2 messages. | ||
This is the index of the SCR_SDEV ports that are set to 2 for "MavlinkHL". Defaults to 0. | ||
|
||
## RK9_RELAY | ||
|
||
RELAYn output to control Rockblock power. This connects to I_EN on the Rockblock header. Defaults to RELAY1. | ||
|
||
## RK9_BOOTED | ||
|
||
SERVOn GPIO pin number (usually 50 or greater) that reads the Rockblock booted state. | ||
This connects to I_BTD on the Rockblock header. Requires SERVOn_FUNCTION=-1. Defaults to 52 (SERVO3). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Show various CRC calculations | ||
|
||
--CRC16 Xmodem | ||
local inString = "Hello, world!" | ||
crc = crc_xmodem(inString) | ||
gcs:send_text(0, "CRC16 Xmodem of '" .. inString .. "' is: " .. string.format("0x%04X", crc)) | ||
|
||
--CRC16 Modbus | ||
crc = crc_modbus(inString) | ||
gcs:send_text(0, "CRC16 Modbus of '" .. inString .. "' is: " .. string.format("0x%04X", crc)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting to do some bench-marking vs a native lua implementation. I'm a little reluctant to start a president crc bindings just because there are so many people may want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A crc implementation in lua for example:
ardupilot/libraries/AP_Scripting/examples/TraxxasVelineon.lua
Lines 15 to 40 in da01dac