LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums HCL Reviews Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2010, 09:16 PM   #1
b0ot
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 0
Unhappy Create Socat Connection -> Parse -> Output


I'm trying to create something that will periodically send messages to a serial device using socat, take the response from the device and format it, then take the formated data and send it out UDP to a specific IP/Port.

I tried to do something along the lines of
socat <readline> <serial device> | parse script/program | socat -u <readline> <UDP:IP:Port> but didn't have any success.

socat READLINE,history=$HOME/.cmd_history /dev/ttyS1,raw,echo=0,crnl | format.sh | socat -u READLINE,history=$HOME/.cmd_history UDP:IP:Port

Last edited by b0ot; 11-02-2010 at 09:20 PM.
 
Old 11-03-2010, 04:00 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,833
Blog Entries: 21

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by b0ot View Post
I'm trying to create something that will periodically send messages to a serial device using socat, take the response from the device and format it, then take the formated data and send it out UDP to a specific IP/Port.

I tried to do something along the lines of
socat <readline> <serial device> | parse script/program | socat -u <readline> <UDP:IP:Port> but didn't have any success.

socat READLINE,history=$HOME/.cmd_history /dev/ttyS1,raw,echo=0,crnl | format.sh | socat -u READLINE,history=$HOME/.cmd_history UDP:IP:Port
What address type are you using for the serial port, 2nd argument of first command?

What messages/effects are you experiencing that make you say it does not work? Are you expect the first socat instance to read from the terminal and write to the serial port? Where do you expect the format.sh script to be reading its data from?
 
Old 11-04-2010, 08:45 AM   #3
b0ot
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Skaperen View Post
What address type are you using for the serial port, 2nd argument of first command?

What messages/effects are you experiencing that make you say it does not work? Are you expect the first socat instance to read from the terminal and write to the serial port? Where do you expect the format.sh script to be reading its data from?
What I would like to happen is for there to be a connection between the terminal and my serial device so that I could send it commands. Let's say "list gps" returned to me the coordinates of my device.

I would like to repeatedly send the command "list gps" to my serial device, have the response message go as input to my format.sh script/program then have the output of that program be sent out UDP to a specific port/ip. The communication between the output of my formating script and the UDP IPort is only 1 way, which was why I included the -u
 
  


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
how can I format/parse the output of time? luusac Linux - Newbie 4 04-09-2009 06:18 AM
How do I parse the output of a command that output to standard out? gauol Programming 9 01-17-2008 02:54 PM
using sed to parse dir output kcorkran Linux - Newbie 12 01-10-2008 02:17 PM
how to pipe and parse output of a command learnfast Linux - Newbie 2 06-15-2005 05:55 AM
parse output ky-lab_rat Linux - Newbie 7 01-23-2004 02:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:53 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration