i have connected with my board through serial interface using minicom and i am running a bash script, which should test ethernet (ping test), USB read/write, RS232 ..
I have managed to test ethernet and USB read/write.
I test ethernet with ping.
I test USB read/write, using dd and verifying the checksum with md5.
But i am stuck with testing RS232. Could you provide me ideas as to how i can do that using minicom session. I want to test that the serial interface is working properly.
Thanks,
srik
---------- Post updated at 06:31 AM ---------- Previous update was at 06:29 AM ----------
One idea i have is to send a file using sz to the host and then check for the files authenticity. but then it wasnot possible without human intervention (since i had to press ok after receving the file in minicom using xmodem protocol)
OK, this doesn't directly answer your question, but why ping test any network connection before trying to use it? That's like checking a car for a trailer hitch before taking it to pick up a gallon of milk at 7-11 - it's completely irrelevant to what you're trying to do. Sure, a positive result tells you the car is there, but it doesn't tell you the car works. And a negative result tells you only that there's no trailer hitch - the car could still be there working just fine to boot.
Networks can be and are configured to block explorations such as pings. Hosts can be and are configured to not respond to pings. Networks can also and often are configured to block SSH or FTP sessions, so even if a ping is successful that's not proof an SSH session will connect.
If you're going to use a network-based service, just use the damn thing. A successful ping prior to trying such a service doesn't mean the service works, and a failed ping doesn't mean it won't.
thanks for the reply. I hope i understood your response properly.
I am not going to use any ethernet based service and the ping test is not intended for that purpose. The idea is to put the system under some kind of stress (ping with a number of packets, sending a number of CAN frames, etc.. ) and at the same the hardware is verified.
Do you have any idea about how i can verify the RS232? i am looking at using sz non interactively, eventhough it is mentioned that it could be used non interactively it is not mentioned how to.
hi corona, sorry for asking this, but could you explain your code. my scripting skills are limited. base64 -d > /tmp/$$ <<"EOF" This seems to decode some data and add it to a file and appends and EOF at the end.
Which data does it decode and what does $$ mean? set -- $(md5sum /tmp/$$)
what does "set --" do to the checksum calculated? if ! [ "$1" = "0e..." ]
$1 is ? (first argument for?)
With my limited scripting skills it is difficult for me to understand in which step a RS232 transfer is taking place
Right. <<EOF is a 'here document', allowing you to put a document inside a shell script instead of including it as an external file.
I got the contents from base64 < filename , picking /etc/mime.types as a big harmless file. I didn't post it in its entirety to save space.
Nothing important, I just fed it part of /etc/mime.types. The content isn't important, you just wanted a lot of data, right? If you change the data, you have to change the checksum of course...
$$ is the shell's PID, so more or less a convenient "unique" number. If you used the same name all the time you might bump into a pre-existing file or some such when things went wrong.
md5sum prints "checksum filename". set -- a b sets $1 to a, $2 to b. So this sets $1 to the checksum, and $2 to the bit we don't want.
$1 is what set it to with set --
The intent was for you to feed that script into the serial port, assuming the serial port has a shell running in it.
If it doesn't, you might be able to kludge it with bash < /dev/ttyS0 or what have you.