Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:47 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : two bash scripts

Author Message
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 600
Posted: 04:06pm 17 Apr 2018
Copy link to clipboard 
Print this post


I have been using Geany to edit my code and started thinking of
how to make use of the extra tool slots. Still reading up on that
but did get around to making these two scripts work.

xsend.sh will stop the MicroMite then send the "xmodem r"
and the using sx will send the file to the MicroMite
then send "run" and newline

xrecv.sh will stop the MicroMite then send the "xmodem s"
and the using rx will get the file from the MicroMite
then send "run" and newline. It strips any nulls at the
end of the file.

xsend.sh

#!/bin/bash
# while in file manager (nemo) I open a term
# and type in the following
# xsend.sh file2send port (ttyACMx ttyUSBx)
# this is raw and experimental

DEV=/dev/$2
echo $'\cc' "xmodem r" > $DEV
sleep 2
sx $1 > $DEV < $DEV
sleep 2
echo "run" $'\n' > $DEV


xrecv.sh

#!/bin/bash
# while in file manager (nemo) I open a term
# and type in the following
# xrecv.sh file2get port (ttyACMx ttyUSBx)
# this is raw and experimental

DEV=/dev/$2

echo $'\cc' "xmodem s" > $DEV
sleep 2
rx $1 > $DEV < $DEV
sleep 2
echo "run" $'\n' > $DEV
sleep 2
tr < $1 -d '\000' > "tmp"
mv tmp $1


I have more I am trying to get working and will post as I get them
to "KISS" mode. There are a few python scripts "Find_ports.py -l"
and miniterm.py it defaults to 9600 a ^T b 38400. Playing with it to
learn python. A quick way to do some input after xsend is to use
screen /dev/ttyACM0 38400 it also useful to edit.

Hope some can make use of these.

Quazee



 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025