LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-06-2010, 10:04 AM   #1
LSigales
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
Reset RS232 Buffer on Device


Hi. Thanks to the really good post on this forum I was able to write a script on Linux Shell for send and read data to a serial port.

But I’m facing a problem now. And I hope some one can give me a hand on this.

If by any mean I send to de device anything else than the predefined strings, stated by the manufacturer, the device ceases to respond. The only way I found its to turn off and then turn on the thing again. Which its very impractical.

Its there any way to "reset de UART chip on the device" or send some string based on the RS232 standard that clean the device buffer?
 
Old 08-06-2010, 02:05 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Not really but it depends on how the device operates on bad commands. Need more information on this device like make/model and its predefined strings.

It might be that all you need to do is send a carriage return character. Does your device use ASCII or binary commands? If your device uses ASCII commands you can try experimenting using minicom and see what happens.
 
Old 08-09-2010, 12:03 PM   #3
LSigales
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
No more Info available

Hi michaelk.
Finally a could resolve the problem. I read somewhere that sending a zero string cleans the buffer on the UART chip. According to the web site this its a standard of the RS232 protocol.

After several tries I discover that sending a string whit zero, in hexadecimal format, twice deletes the buffer and allow me to send more commands.

echo -e -n "\x00" > /dev/ttyS0
echo -e -n "\x00" > /dev/ttyS0

What i never understand its why do I need to send Two strings. But it works, so I'm not going to question it(too much jeje).

Last edited by LSigales; 08-10-2010 at 12:51 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Buffer I/O error on device greensuman Linux - Server 1 03-15-2010 05:26 PM
how toconfigure rs232 - moxa device driver using minicom rci Linux - Networking 4 07-27-2009 06:17 AM
Control of device names of USB to RS232 serial adapters hakelm Linux - Hardware 1 02-11-2008 07:49 PM
What is the difference between the free buffer and buffer in the buffer hash queue? Swagata Linux - Enterprise 0 05-25-2006 11:57 PM
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:22 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