LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-21-2022, 02:15 AM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
Best way to transmit a file over one-way serial line?


Hi.

Suppose you have two embedded linux devices that are connected with a one-way serial line i.e. a USB-to-UART device like /dev/ttyUSB0 on each end with only one wire (besides the GND wire) going from a TX pin on device 1 to a RX pin on device 2. This means the traffic can travel only one way (this is often called a data diode).

What is the best way to transmit a file over this line? Preferably with some error checking to see whether the contents on the receiving end are intact.

Thanks in advance.
 
Old 02-21-2022, 03:00 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
1-wire.

Error checking is up to you.
 
Old 02-21-2022, 06:49 AM   #3
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
No, I was wondering, if there are any existing linux tools available for this task (i.e. transmit a data size, hash and payload) or do I have to write my own python script?
Just asking because I was about to start writing the program, and I don't want to finish the program only to discover an existing tool for the job.

Regards!
 
Old 02-21-2022, 07:17 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
I don't know of anything existing but would probably use xmodem or ymodem as an example without the handshaking.
 
Old 02-21-2022, 07:20 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
you can use whatever you want but if there is no way to report back what is the goal?
You can transfer file[s], checksums ...., you can run some tools to validate, but what would be the result?
 
Old 02-21-2022, 08:18 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by displace View Post
No, I was wondering, if there are any existing linux tools available for this task (i.e. transmit a data size, hash and payload) or do I have to write my own python script?
Just asking because I was about to start writing the program, and I don't want to finish the program only to discover an existing tool for the job.

Regards!
Yes, there is something existing:https://www.kernel.org/doc/html/late...1-generic.html
 
Old 02-21-2022, 08:33 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
That looks like the Dallas semiconductor 1 wire bus which uses different hardware and is actually bidirectional. I don't think you can do the same thing over a serial port.
 
Old 02-21-2022, 10:08 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by michaelk View Post
That looks like the Dallas semiconductor 1 wire bus which uses different hardware and is actually bidirectional. I don't think you can do the same thing over a serial port.
Dallas 1-wire is precisely what the OP described. This seems to be custom hardware nonetheless.

Not saying it is any more palatable option than just writing their own driver, but I feel that nothing exactly matching exists and they'd be best to use existing references to attain their goal.
 
  


Reply

Tags
data diode, one-way, serial



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
transmit video over wireless network milina Linux - Newbie 1 04-18-2016 10:12 AM
How to copy one line from one file to another file on line number.. gajananh999 Linux - Newbie 1 08-13-2012 05:27 AM
How to increase the serial transmit buffer size in the Kernel. pwlodarczyk Programming 13 01-21-2009 04:39 PM
Using USB<->Serial and serial gender changer to transmit data between computers JoeyAdams Linux - Hardware 4 04-17-2008 05:15 AM
No of bytes in the serial drivers transmit buffer igjesdal Programming 0 10-13-2004 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration