I have a microcontroller setup as a web server to which my linux PC reacts strangely to.
Since the micro is AT89S52, I hook my board up to my PC's real serial port (not the USB to serial converter). Linux recognizes this port as /dev/ttyS0 I have the option of running the board at 9.6kbps and 57.6kbps so I try both speeds in all scenarios which I now describe.
The scenario that ALWAYS seems to work in both speed modes is this:
I open one terminal window and execute: cat /dev/ttyS0
I open the second window and execute: echo -en "GET / HTTP/1.1\x0D\x0A"
Then the first terminal responds with 100% correct data.
But when I use socat or netcat (nc) I often get corrupt data somewhere in the results. Usually at the beginning (see where the red arrows point in the attachment). I made sure to set the correct speed and to use raw mode with no echo before running each test. Sometimes at the 9.6K speed, I get a broken pipe error during data transmission.
Are socat and netcat bad utilities for the job? or are there system settings I need to change?
I just want to turn my microcontroller into a web server that can process web pages I built-into the microcontroller, not a bunch of garbage.
I also want to port this setup to a microsoft windows environment incase I need to quickly change my computer setup later. This is why I was interested in socat: because apparently parts of it work for windows.
Anyway, here's the results of my tests. The expected result is the first grey text above the yellow bar.

Since the micro is AT89S52, I hook my board up to my PC's real serial port (not the USB to serial converter). Linux recognizes this port as /dev/ttyS0 I have the option of running the board at 9.6kbps and 57.6kbps so I try both speeds in all scenarios which I now describe.
The scenario that ALWAYS seems to work in both speed modes is this:
I open one terminal window and execute: cat /dev/ttyS0
I open the second window and execute: echo -en "GET / HTTP/1.1\x0D\x0A"
Then the first terminal responds with 100% correct data.
But when I use socat or netcat (nc) I often get corrupt data somewhere in the results. Usually at the beginning (see where the red arrows point in the attachment). I made sure to set the correct speed and to use raw mode with no echo before running each test. Sometimes at the 9.6K speed, I get a broken pipe error during data transmission.
Are socat and netcat bad utilities for the job? or are there system settings I need to change?
I just want to turn my microcontroller into a web server that can process web pages I built-into the microcontroller, not a bunch of garbage.
I also want to port this setup to a microsoft windows environment incase I need to quickly change my computer setup later. This is why I was interested in socat: because apparently parts of it work for windows.
Anyway, here's the results of my tests. The expected result is the first grey text above the yellow bar.
