http://www.perlmonks.org?node_id=997796


in reply to Sniffing a telnet session into a file ...

It also dawned on me last night that you don't need telnet to do this. In that train of thought, see Tk Realtime data aquisition

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Sniffing a telnet session into a file ...

Replies are listed 'Best First'.
Re^2: Sniffing a telnet session into a file ...
by RedTussock (Acolyte) on Oct 11, 2012 at 05:40 UTC
    Yep that is all fine and dandy ... but what I have coming in of the 1 wire network is multiple 1 wire devices with uynique ID's ... what is coming out the tcp port on 8891 from oww looks like
    Smitty@smittytech:~> telnet localhost 8891 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 11/10/12 , 18:36:27 , ,�C , 6.87, KPH, South ,180.0 + , 8 , 0.00, mm 11/10/12 , 18:36:27 , ,�C , 6.00, KPH, SE ,135.0 + , 6 , 0.00, mm 11/10/12 , 18:36:30 , ,�C , 5.91, KPH, SSE ,157.5 + , 7 , 0.00, mm 11/10/12 , 18:36:32 , ,�C , 4.31, KPH, South ,180.0 + , 8 , 0.00, mm 11/10/12 , 18:36:34 , ,�C , 4.26, KPH, South ,180.0 + , 8 , 0.00, mm 11/10/12 , 18:36:37 , ,�C , 4.25, KPH, South ,180.0 + , 8 , 0.00, mm 11/10/12 , 18:36:39 , ,�C , 5.09, KPH, SW ,225.0 + , 10 , 0.00, mm 11/10/12 , 18:36:41 , ,�C , 4.16, KPH, SE ,135.0 + , 6 , 0.00, mm 11/10/12 , 18:36:44 , ,�C , 3.35, KPH, SW ,225.0 + , 10 , 0.00, mm 11/10/12 , 18:36:46 , ,�C , 4.21, KPH, SW ,225.0 + , 10 , 0.00, mm 11/10/12 , 18:36:48 , ,�C , 4.28, KPH, SSW ,202.5 + , 9 , 0.00, mm ^C^C
    So I either need to kill oww and read the device of the net and do all the 1W net comms using a perl script and hand the result into your suggested send script. Clever idea ... but I need to go deeper into the network comms, which means reinventing a wheel.
      I don't know what oww is exactly, a c program? If my assumption is correct, oww reads the 1w net and reports it out on port 8891. Maybe you should see if oww has options to just print out to STDOUT instead of port 8891, if so you could run it with some Perl IPC, like a piped open or Open3, then let Perl send it out on a regular socket connection.

      It may also be a McGiver hack, but you could have another Perl script on the oww machine to read port 8891, and relay it out a normal socket.

      Can you get the source code to oww? You could hack it to wtite to STDOUT.


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh