File transfer via COM port (RS232)

dupin34380 Posted messages 1 Registration date   Status Membre Last intervention   -  
brupala Posted messages 111943 Registration date   Status Membre Last intervention   -
I would like to send a file (type .txt or .CSV) via the RS232 COM port from one PC to another PC (both PCs running Windows 10).
Let me explain:
My first PC is in a "sealed" IP network (without internet) for IT security reasons.
It is connected to devices that fill an Excel file in real-time.
I then want this file to be sent to a second PC (via a manual action) that has an internet connection to send this file by email, for example.
Is there a small software capable of doing this or a MS-DOS command?

I would even like to disconnect the RX line of the RS232 on the PC 1 side to be truly sealed, even on the COM port side.

Thank you for your responses.

3 réponses

brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098
 
Hello, in principle, using PuTTY or HyperTerminal, download either side.

It's horribly slow due to the low transfer rate, so if the files are large... and it requires a bit of effort because the communication must be exactly the same on both sides (parity, baud rates...).

I don't remember the exact syntax, I've slept since then: you should look in the help related to these products (be careful, they can handle other protocols, only the transmission through the COM port interests us) or you can wait for someone less forgetful than me to read you.
0
Pierrecastor Posted messages 10830 Registration date   Status Modérateur Last intervention   4 215
 
Hi,

Given the reliability issues that can arise from data transfer via RS232, it might be worth considering a control technique. For instance, passing the MD5 of the file at the end of the transfer and comparing it on the receiving computer.

As for the transfer itself, I found these few leads: https://stackoverflow.com/questions/62509183/file-access-between-mcu-and-pc-through-rs232-communication
--
Light a fire for someone, and they will be warm for the rest of the day. Set a man on fire, and he will be warm for the rest of his life. -Terry Pratchett-
0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098
 
Memory serves, it's more fashionable to do the job via PuTTY and SCP than via HyperTerminal and XMODEM or whatever, but to each their own as long as it works.

Not so trivial, the installation also needs to happen on the destination machine which has no Internet access, meaning one must have an input port (USB port, CD drive...).

Under these circumstances, and if the two machines are in the same room, we might be overthinking it for nothing instead of just copying those famous .txt and .csv files from one machine to the other using one of those media.
0
brupala Posted messages 111943 Registration date   Status Membre Last intervention   14 421
 
Hi,
if I understand correctly,
both PCs have an Ethernet card and one is on an isolated network, but the second can connect to that network with a manual IP configuration?
However, I wouldn't have thought there are still PCs with serial ports....
Otherwise, PuTTY can do this kind of thing and HyperTerminal has not existed for a long time.
In the past,
we had more sophisticated software, like Procomm, but they probably no longer exist.
Also,
it seems to me that you can run a Copy command to a COM or LPT port,
you probably need to start a copy from COM to file on the receiving PC and do a little ctrl+c when it's done.
You can substitute a device name for one or more occurrences of source or destination.

If destination is a device (for example, COM1 or LPT1), the /b option copies data to the device in binary mode. In binary mode, Copy/b copies all characters (including special characters like CTRL + C, CTRL + S, Ctrl + Z, and ENTER) to the device, as data. However, if you omit /b, the data is copied to the device in ASCII mode. In ASCII mode, special characters can cause file combinations during the copy process.


on this page

0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098
 
Good evening,

Yes, indeed, HyperTerminal, which is a relic, can still be downloaded and used on Windows 10, but it doesn’t contribute anything to the discussion compared to PuTTY (perhaps except for simplicity).

I'm not sure if the COPY trick allows for copying to a COM port anything other than simple ASCII or binary strings (put another way, nothing is certain for special characters that might appear in a txt or csv file, including delimiters in the latter case).

And then the snake will probably bite its own tail, back to square one, if "intelligible communication" isn't initiated between the two machines (baud rate, parity, etc.) by a prior command like MODE COM(N):

https://stackoverflow.com/questions/36443169/how-to-send-file-over-serial-port-in-windows-command-prompt
0
brupala Posted messages 111943 Registration date   Status Membre Last intervention   14 421 > brucine Posted messages 24390 Registration date   Status Membre Last intervention  
 
Yes, for sure,
you also need to configure the COM port using the mode command or something else, it's a prerequisite for communication.
I remember that back in the day, 30 years ago, I used to do it in assembly, fiddling with the bits of the communication controller directly.
That's far away and I wouldn't want to give a lecture on that, especially since I have no desire to go back to the Stone Age.
0