Send file by xmodem or kermit protocol with GNU screen

Clash Royale CLAN TAG#URR8PPP
up vote
18
down vote
favorite
I work with an RS-232 device via GNU screen.
$ screen /dev/ttyUSB0 115200
At some point I need to send a local file to the device using either the xmodem or kermit protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
gnu-screen serial-port kermit
add a comment |Â
up vote
18
down vote
favorite
I work with an RS-232 device via GNU screen.
$ screen /dev/ttyUSB0 115200
At some point I need to send a local file to the device using either the xmodem or kermit protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
gnu-screen serial-port kermit
add a comment |Â
up vote
18
down vote
favorite
up vote
18
down vote
favorite
I work with an RS-232 device via GNU screen.
$ screen /dev/ttyUSB0 115200
At some point I need to send a local file to the device using either the xmodem or kermit protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
gnu-screen serial-port kermit
I work with an RS-232 device via GNU screen.
$ screen /dev/ttyUSB0 115200
At some point I need to send a local file to the device using either the xmodem or kermit protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
gnu-screen serial-port kermit
gnu-screen serial-port kermit
edited Feb 19 '13 at 18:26
George M
8,79623247
8,79623247
asked Nov 25 '12 at 9:45
user14284
add a comment |Â
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
19
down vote
the best way to pass a file through xmodem is to use sx. In debian this application is part of 'lrzsz' package.
In debian:
apt-get install screen lrzsz
screen /dev/ttyUSB0 115200
Then press Ctrl-A followed by : and type:
exec !! sx yourbinary.bin
This will send the file to ttyUSB0 over xmodem protocol
Can this operation be executed non-interactively, either withscreencuor any other package?
â Vorac
Oct 29 '15 at 8:06
1
@Vorac you can always dosx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -
â GnP
Mar 24 '16 at 19:59
2
How to give receive commandGive your local XMODEM receive command now
â AQU
Jul 31 '17 at 10:10
add a comment |Â
up vote
4
down vote
If you want to use zmodem you have to set the zmodem option to pass, if your screen session is already running, press CTRL+A : and just enter zmodem pass . To send the data just use the sz command from the lrzsz package.
If you want to receive data via screen you have to set the value to catch.
zmodem catchis an option I've been search for for ages! Good riddance, minicom.
â ijustlovemath
Apr 11 '17 at 2:48
add a comment |Â
up vote
2
down vote
I was in need to automate the serial transfer of a .bin file to an xbee with xmodem so I used this sloppy bash code:
echo "Starting connection..."
screen -d -m -S uart_con /dev/ttyO1 115200
sleep 1
screen -S uart_con -X stuff 'F'$(echo -ne '15')
sleep 1
screen -S uart_con -X exec !! sz -X /home/file_directory/example.abs.bin
echo "now transfering... "
sleep 20
pkill screen
The third line sends a command to the other side(xbee) to start listening for a file transfer. So you are probably good with just:
screen -d -m -S uart_con /dev/ttyUSB0 115200
screen -S uart_con -X exec !! sz -X /path_to_file/example.file
add a comment |Â
up vote
1
down vote
If you are trying to do this through screen on OSX, you can follow the procedure laid out by user32704 with some small modifications. You will need to first build lrzsz from source, which can be found here:
https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
Then, instead of exec !! sx yourbinary.bin you should use:
exec !! lsz -X yourbinary.bin
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzsz
â miken32
Sep 20 '16 at 17:36
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
19
down vote
the best way to pass a file through xmodem is to use sx. In debian this application is part of 'lrzsz' package.
In debian:
apt-get install screen lrzsz
screen /dev/ttyUSB0 115200
Then press Ctrl-A followed by : and type:
exec !! sx yourbinary.bin
This will send the file to ttyUSB0 over xmodem protocol
Can this operation be executed non-interactively, either withscreencuor any other package?
â Vorac
Oct 29 '15 at 8:06
1
@Vorac you can always dosx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -
â GnP
Mar 24 '16 at 19:59
2
How to give receive commandGive your local XMODEM receive command now
â AQU
Jul 31 '17 at 10:10
add a comment |Â
up vote
19
down vote
the best way to pass a file through xmodem is to use sx. In debian this application is part of 'lrzsz' package.
In debian:
apt-get install screen lrzsz
screen /dev/ttyUSB0 115200
Then press Ctrl-A followed by : and type:
exec !! sx yourbinary.bin
This will send the file to ttyUSB0 over xmodem protocol
Can this operation be executed non-interactively, either withscreencuor any other package?
â Vorac
Oct 29 '15 at 8:06
1
@Vorac you can always dosx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -
â GnP
Mar 24 '16 at 19:59
2
How to give receive commandGive your local XMODEM receive command now
â AQU
Jul 31 '17 at 10:10
add a comment |Â
up vote
19
down vote
up vote
19
down vote
the best way to pass a file through xmodem is to use sx. In debian this application is part of 'lrzsz' package.
In debian:
apt-get install screen lrzsz
screen /dev/ttyUSB0 115200
Then press Ctrl-A followed by : and type:
exec !! sx yourbinary.bin
This will send the file to ttyUSB0 over xmodem protocol
the best way to pass a file through xmodem is to use sx. In debian this application is part of 'lrzsz' package.
In debian:
apt-get install screen lrzsz
screen /dev/ttyUSB0 115200
Then press Ctrl-A followed by : and type:
exec !! sx yourbinary.bin
This will send the file to ttyUSB0 over xmodem protocol
edited Jun 26 '15 at 15:42
grawity
1,6071119
1,6071119
answered Feb 19 '13 at 17:59
user32704
19112
19112
Can this operation be executed non-interactively, either withscreencuor any other package?
â Vorac
Oct 29 '15 at 8:06
1
@Vorac you can always dosx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -
â GnP
Mar 24 '16 at 19:59
2
How to give receive commandGive your local XMODEM receive command now
â AQU
Jul 31 '17 at 10:10
add a comment |Â
Can this operation be executed non-interactively, either withscreencuor any other package?
â Vorac
Oct 29 '15 at 8:06
1
@Vorac you can always dosx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -
â GnP
Mar 24 '16 at 19:59
2
How to give receive commandGive your local XMODEM receive command now
â AQU
Jul 31 '17 at 10:10
Can this operation be executed non-interactively, either with
screen cu or any other package?â Vorac
Oct 29 '15 at 8:06
Can this operation be executed non-interactively, either with
screen cu or any other package?â Vorac
Oct 29 '15 at 8:06
1
1
@Vorac you can always do
sx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -â GnP
Mar 24 '16 at 19:59
@Vorac you can always do
sx binary.bin | socat FILE:/dev/ttyUSB0,b115200,raw -â GnP
Mar 24 '16 at 19:59
2
2
How to give receive command
Give your local XMODEM receive command nowâ AQU
Jul 31 '17 at 10:10
How to give receive command
Give your local XMODEM receive command nowâ AQU
Jul 31 '17 at 10:10
add a comment |Â
up vote
4
down vote
If you want to use zmodem you have to set the zmodem option to pass, if your screen session is already running, press CTRL+A : and just enter zmodem pass . To send the data just use the sz command from the lrzsz package.
If you want to receive data via screen you have to set the value to catch.
zmodem catchis an option I've been search for for ages! Good riddance, minicom.
â ijustlovemath
Apr 11 '17 at 2:48
add a comment |Â
up vote
4
down vote
If you want to use zmodem you have to set the zmodem option to pass, if your screen session is already running, press CTRL+A : and just enter zmodem pass . To send the data just use the sz command from the lrzsz package.
If you want to receive data via screen you have to set the value to catch.
zmodem catchis an option I've been search for for ages! Good riddance, minicom.
â ijustlovemath
Apr 11 '17 at 2:48
add a comment |Â
up vote
4
down vote
up vote
4
down vote
If you want to use zmodem you have to set the zmodem option to pass, if your screen session is already running, press CTRL+A : and just enter zmodem pass . To send the data just use the sz command from the lrzsz package.
If you want to receive data via screen you have to set the value to catch.
If you want to use zmodem you have to set the zmodem option to pass, if your screen session is already running, press CTRL+A : and just enter zmodem pass . To send the data just use the sz command from the lrzsz package.
If you want to receive data via screen you have to set the value to catch.
answered Nov 25 '12 at 10:52
Ulrich Dangel
20k25671
20k25671
zmodem catchis an option I've been search for for ages! Good riddance, minicom.
â ijustlovemath
Apr 11 '17 at 2:48
add a comment |Â
zmodem catchis an option I've been search for for ages! Good riddance, minicom.
â ijustlovemath
Apr 11 '17 at 2:48
zmodem catch is an option I've been search for for ages! Good riddance, minicom.â ijustlovemath
Apr 11 '17 at 2:48
zmodem catch is an option I've been search for for ages! Good riddance, minicom.â ijustlovemath
Apr 11 '17 at 2:48
add a comment |Â
up vote
2
down vote
I was in need to automate the serial transfer of a .bin file to an xbee with xmodem so I used this sloppy bash code:
echo "Starting connection..."
screen -d -m -S uart_con /dev/ttyO1 115200
sleep 1
screen -S uart_con -X stuff 'F'$(echo -ne '15')
sleep 1
screen -S uart_con -X exec !! sz -X /home/file_directory/example.abs.bin
echo "now transfering... "
sleep 20
pkill screen
The third line sends a command to the other side(xbee) to start listening for a file transfer. So you are probably good with just:
screen -d -m -S uart_con /dev/ttyUSB0 115200
screen -S uart_con -X exec !! sz -X /path_to_file/example.file
add a comment |Â
up vote
2
down vote
I was in need to automate the serial transfer of a .bin file to an xbee with xmodem so I used this sloppy bash code:
echo "Starting connection..."
screen -d -m -S uart_con /dev/ttyO1 115200
sleep 1
screen -S uart_con -X stuff 'F'$(echo -ne '15')
sleep 1
screen -S uart_con -X exec !! sz -X /home/file_directory/example.abs.bin
echo "now transfering... "
sleep 20
pkill screen
The third line sends a command to the other side(xbee) to start listening for a file transfer. So you are probably good with just:
screen -d -m -S uart_con /dev/ttyUSB0 115200
screen -S uart_con -X exec !! sz -X /path_to_file/example.file
add a comment |Â
up vote
2
down vote
up vote
2
down vote
I was in need to automate the serial transfer of a .bin file to an xbee with xmodem so I used this sloppy bash code:
echo "Starting connection..."
screen -d -m -S uart_con /dev/ttyO1 115200
sleep 1
screen -S uart_con -X stuff 'F'$(echo -ne '15')
sleep 1
screen -S uart_con -X exec !! sz -X /home/file_directory/example.abs.bin
echo "now transfering... "
sleep 20
pkill screen
The third line sends a command to the other side(xbee) to start listening for a file transfer. So you are probably good with just:
screen -d -m -S uart_con /dev/ttyUSB0 115200
screen -S uart_con -X exec !! sz -X /path_to_file/example.file
I was in need to automate the serial transfer of a .bin file to an xbee with xmodem so I used this sloppy bash code:
echo "Starting connection..."
screen -d -m -S uart_con /dev/ttyO1 115200
sleep 1
screen -S uart_con -X stuff 'F'$(echo -ne '15')
sleep 1
screen -S uart_con -X exec !! sz -X /home/file_directory/example.abs.bin
echo "now transfering... "
sleep 20
pkill screen
The third line sends a command to the other side(xbee) to start listening for a file transfer. So you are probably good with just:
screen -d -m -S uart_con /dev/ttyUSB0 115200
screen -S uart_con -X exec !! sz -X /path_to_file/example.file
answered Jun 21 at 15:39
Nikos Sakellariou
211
211
add a comment |Â
add a comment |Â
up vote
1
down vote
If you are trying to do this through screen on OSX, you can follow the procedure laid out by user32704 with some small modifications. You will need to first build lrzsz from source, which can be found here:
https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
Then, instead of exec !! sx yourbinary.bin you should use:
exec !! lsz -X yourbinary.bin
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzsz
â miken32
Sep 20 '16 at 17:36
add a comment |Â
up vote
1
down vote
If you are trying to do this through screen on OSX, you can follow the procedure laid out by user32704 with some small modifications. You will need to first build lrzsz from source, which can be found here:
https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
Then, instead of exec !! sx yourbinary.bin you should use:
exec !! lsz -X yourbinary.bin
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzsz
â miken32
Sep 20 '16 at 17:36
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If you are trying to do this through screen on OSX, you can follow the procedure laid out by user32704 with some small modifications. You will need to first build lrzsz from source, which can be found here:
https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
Then, instead of exec !! sx yourbinary.bin you should use:
exec !! lsz -X yourbinary.bin
If you are trying to do this through screen on OSX, you can follow the procedure laid out by user32704 with some small modifications. You will need to first build lrzsz from source, which can be found here:
https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
Then, instead of exec !! sx yourbinary.bin you should use:
exec !! lsz -X yourbinary.bin
answered Jun 1 '16 at 13:18
minn3h
111
111
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzsz
â miken32
Sep 20 '16 at 17:36
add a comment |Â
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzsz
â miken32
Sep 20 '16 at 17:36
3
3
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
brew install lrzsz
â Daniele Brugnara
Sep 2 '16 at 10:34
sudo port install lrzszâ miken32
Sep 20 '16 at 17:36
sudo port install lrzszâ miken32
Sep 20 '16 at 17:36
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f56614%2fsend-file-by-xmodem-or-kermit-protocol-with-gnu-screen%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password