Abdulrehmangriffith
Posts: 5
Joined: Mon Apr 09, 2018 8:33 am

UART

Mon Apr 09, 2018 8:50 am

I’m using Rpi 2. How to read txt file from PC using UART?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: UART

Mon Apr 09, 2018 9:02 am

Could you describe more? I mean, do you connected to Pi with UART, and want to read a text file on Pi? Or you connect to Pi with something else, and want to read text from Pi's UART?

Abdulrehmangriffith
Posts: 5
Joined: Mon Apr 09, 2018 8:33 am

Re: UART

Mon Apr 09, 2018 9:18 am

I have couple of text files in PC. I can send and receive data from RPi to PC using uart. Firstly, I started with single character and then string of data. Now I want to read the whole file from the PC Using uart.

Abdulrehmangriffith
Posts: 5
Joined: Mon Apr 09, 2018 8:33 am

Re: UART

Mon Apr 09, 2018 9:19 am

Yes want to read the file by the RPi but file storted in PC

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: UART

Mon Apr 09, 2018 11:28 am

If it's about copy file from PC, the Ethernet would be easier and faster than UART.

I'm not very familar with UART, but I remember if you want send binary data via UART, you would need a special protocol, as binary data need to be escaped. The name of the protocol is Zmodem. It's slow after all.

I know you want to deal with text. But Unicode encoded text is binary data. Only ASCII encoded file is a "text file". Dealing them as binary is more straight, I think.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: UART

Mon Apr 09, 2018 11:43 am

Adding to what @allfox said:

Once upon a time Ethernet did not exist. Remote access via serial connections was the norm.

Suites of file transfer utilities grew up to deal with the problem you have. The Zmodem suite was one; Kermit was another.

http://www.columbia.edu/kermit/kermit.html


Of course, as a learning exercise it would be instructive to re-implement the basic core of these utilities by writing your own 'client' and 'server' code in a language of your choice.

smartifahrer
Posts: 1038
Joined: Sat Feb 13, 2016 8:10 am

Re: UART

Mon Apr 09, 2018 11:49 am

"Connect the Raspberry Pi to Network Using UART"
http://www.instructables.com/id/Connect ... sing-UART/

Paul Hutch
Posts: 547
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: UART

Mon Apr 09, 2018 2:35 pm

If you use a good old fashioned serial (modem) terminal programs on each side you can use their built-in file transfer capabilities. I've most often done this with Minicom on *nix and Tera Term on Windows. You start the file reception function on one side and then start the file send function on the other, both programs offer a good selection of file transfer protocols.

Return to “General discussion”