Skip to content
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

Added script to wirelessly transfer compiled firmware script #294

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions scripts/canflash/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# CAN Flash

# How to run the cantransfer.sh script
BlakeFreer marked this conversation as resolved.
Show resolved Hide resolved

## Check if there is a connection with the pi

type "ping [ip address]" in git bash
BlakeFreer marked this conversation as resolved.
Show resolved Hide resolved
BlakeFreer marked this conversation as resolved.
Show resolved Hide resolved
where ip address is the ip address of the pi

## Running the script

run the script by using the command "sh cantransfer.sh 'bin_files' 'pi_username' 'host' 'destination_path'"

where the inputs are 'bin_files' 'pi_username' 'host' 'destination_path'

- bin files is the path to where the compiled firmware .bin files are located
- pi_username is the username of the raspberry pi
- host is the ip address of the pi
- destination path is the folder in the pi where the bin files will be transferred to

if there is no specific path to sent the file to the directory /home/pi_username/ will work
20 changes: 20 additions & 0 deletions scripts/canflash/cantransfer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#Check if all arguements have been passed
if [ "$#" -lt 4 ]; then
echo "ERROR enter all arguements: sh cantransfer.sh 'bin_files' 'pi_username' 'host' 'destination_path'"
BlakeFreer marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi

BIN_FILES=$1
PI_USERNAME=$2
HOST=$3
DESTINATION_PATH=$4

# Check if the bin folder exists
if [ ! -d "$BIN_FILES" ]; then
echo "ERROR: Folder $BIN_FILES not found"
exit 1
fi

# Perform file transfer
echo "Transferring $BIN_FILES files to $PI_USERNAME@$HOST:$DESTINATION_PATH.."
scp -r "$BIN_FILES/*" "$PI_USERNAME@$HOST:$DESTINATION_PATH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only want to transfer a single binary file, not the whole folder

Loading