-
Notifications
You must be signed in to change notification settings - Fork 0
Ground station relay #39
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ca3e652
init relay
masek014 83116fd
Restructured for modularity
masek014 17f822b
Installation; similar structure to impisc
masek014 9d1092b
Update ground station functionality
masek014 e3dbe94
Delete sender/receiver; not needed
masek014 dfe621a
Renamed service; tweaked parameters
masek014 c53ed58
Add readme
masek014 b62e3db
ruff
masek014 b8a77dc
add ruff
masek014 8785454
update environment variables and file placement
settwi d17f80b
Fixed bug with missing bits
masek014 7b59167
Add archive dir
masek014 58ddf5c
Use ENDPOINT_PORT for the relay
masek014 797c60c
More deployment scripts
masek014 ab9d4ef
Merge pull request #46 from umn-impish/main
settwi e8d8319
relay = udpcapture
masek014 f73e841
dont need custom py code any more
masek014 a7845af
add byte count logging
masek014 d468ab9
Deleted script since it used the now removed Python code
masek014 f4ddf03
remove scripts install from oneshot (relay)
settwi 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
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,22 @@ | ||
| #!/bin/bash | ||
| # Install systemd services and associated process programs | ||
|
|
||
| # Install all processes | ||
| processes=$(ls ../processes) | ||
| for s in $processes; do | ||
| sudo cp "../processes/$s" "/usr/local/bin" | ||
| done | ||
|
|
||
| # Install all .service files and enable them | ||
| services=$(ls ../services/*.service) | ||
| for s in $services; do | ||
| echo $s | ||
| sudo cp "../services/$s" "/etc/systemd/system" | ||
| done | ||
| sudo cp "../services/relay-variables.env" "/usr/local/bin" | ||
| sudo cp "../../services/variables.env" "/usr/local/bin" | ||
|
|
||
| sudo systemctl daemon-reload | ||
| for s in $services; do | ||
| sudo systemctl restart "$(basename $s)" | ||
| done |
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,8 @@ | ||
| #!/bin/bash | ||
|
|
||
| scripts="wifi-through-ethernet install_services" | ||
| for s in $scripts; do | ||
| echo "executing $s" | ||
| ./"$s" | ||
| echo "done $s" | ||
| done |
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,4 @@ | ||
| #!/bin/bash | ||
| # For a fresh install, Wired connection 1 is going to be what we want to share... | ||
|
|
||
| sudo nmcli con modify "Wired connection 1" ipv4.method shared |
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,12 @@ | ||
| #!/usr/bin/python3 | ||
|
|
||
| import os | ||
| import socket | ||
| import sys | ||
|
|
||
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
| s.bind(("", int(os.getenv("LOGGER_PORT")))) | ||
|
|
||
| while True: | ||
| data = s.recv(8192) | ||
| print(f"Forwarded {len(data)}B to ground station", file=sys.stderr) |
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 @@ | ||
| # relay | ||
|
|
||
| NOTE: this is **not** to be installed on the IMPISH flight computer. | ||
|
|
||
| This defines some code that simply acts to forward packets from IMPISH to some destination (e.g. the ground station). | ||
| Currently, this is installed onto a Raspberry Pi 3 and has a direct ethernet connection to IMPISH. | ||
| The intent is to loosely mimic the gondola. | ||
| This code will definitely evolve as we receive more details about how the gondola will handle packets. | ||
|
|
||
| This will be particularly useful during vacuum testing, as we will be able to place the relay in the chamber with IMPISH and wirelessly forward packets out of the chamber. |
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,20 @@ | ||
| [Unit] | ||
| Description=Log the number of bytes per forwarded packet | ||
| After=network.target | ||
| StartLimitIntervalSec=0 | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| WorkingDirectory=/usr/local/bin | ||
| EnvironmentFile=/home/relay/gs-ip.env | ||
| EnvironmentFile=/usr/local/bin/relay-variables.env | ||
| EnvironmentFile=/usr/local/bin/variables.env | ||
| ExecStart=relay_logger | ||
| StandardOutput=journal | ||
| StandardError=journal | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
| User=relay | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
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,2 @@ | ||
| GROUNDSTATION_PORT=12100 | ||
| LOGGER_PORT=12345 |
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,20 @@ | ||
| [Unit] | ||
| Description=Relay all packets from IMPISH to the ground station. | ||
| After=network.target | ||
| StartLimitIntervalSec=0 | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| WorkingDirectory=/usr/local/bin | ||
| EnvironmentFile=/home/relay/gs-ip.env | ||
| EnvironmentFile=/usr/local/bin/relay-variables.env | ||
| EnvironmentFile=/usr/local/bin/variables.env | ||
| ExecStart=udpcapture --port ${ENDPOINT_PORT} -f "${GROUNDSTATION_IP}:${GROUNDSTATION_PORT}" -f "127.0.0.1:${LOGGER_PORT}" | ||
| StandardOutput=journal | ||
| StandardError=journal | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
| User=relay | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
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.
Uh oh!
There was an error while loading. Please reload this page.