LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2007, 01:35 AM   #1
Tanc
Member
 
Registered: Sep 2003
Location: France
Distribution: Debian etch
Posts: 99

Rep: Reputation: 15
How to read data coming from serial connected procurve 2524 with python


Hi LQ

Best wishes for everybody

I'm currently trying to contact a HP Procurve 2524 with Python using serial module.
Everything is fine, except i do have the following thing.

E[?25h[?25hHP2524TEST# [?25h

a print "buf =%r" % self.buf can format to give the following

'\x1b[24;0H\x1bE\x1b[24;1H\x1b[24;13H\x1b[24;1H\x1b[2K\x1b[24;1H\x1b[?25h\x1b[24;1H\x1b[1;24r\x1b[24;1H\x1b[1;24r\x1b[24;1H\x1b[24;1H\x1b[2K\x1b[24;1H\x1b[?25h\x1b[24;1H\x1b[24;1HHP2524TEST# \x1b[24;1H\x1b[24;13H\x1b[24;1H\x1b[?25h\x1b[24;13H'

We can clearly see the switch temporary name ( HP2524TEST ) but i don't know how to interpret the rest. ( \x1b seems to delimit a packet ).

I've tried to navigate unsuccesfully into HP internet site, any idea ?

Regards,

Pierre
 
Old 01-02-2007, 08:13 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
What you are seeing is VT100 ESC sequences. These sequences are/were used to position text on a computer
terminal. VT100 is/was a computer terminal built by DEC. A terminal is basically a monitor, keyboard that
connects to a server using RS-232 (serial port). The Console or termial window is a terminal emulator
(xterm etc) and the name is a carry over from these devices. VT100 is typically the default setting for
terminal emulators.

0x1B is the hex code for Esc, Esc[24;0H means move the cursor to row 24, column 0.
http://www.comptechdoc.org/os/linux/...x_hlvt100.html

Last edited by michaelk; 01-02-2007 at 08:17 AM.
 
Old 01-03-2007, 02:27 AM   #3
Tanc
Member
 
Registered: Sep 2003
Location: France
Distribution: Debian etch
Posts: 99

Original Poster
Rep: Reputation: 15
You are a star ! Will then create a class to convert it ... Tks a bunch
 
Old 11-07-2012, 06:44 AM   #4
sanchopanca
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
>with Python using serial module.
What library did you use to connect with switch?
I have same problem when I use paramiko.
Maybe you connect to switch different way. How did you connect?

Last edited by sanchopanca; 11-07-2012 at 06:47 AM.
 
  


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
is there any shell command to read and write data from parallel and serial port? baosheng Linux - Hardware 2 01-13-2007 08:35 PM
RH doesn't detect my Serial modem connected to a PCI Serial card ricky_ds Linux - Hardware 1 08-17-2006 02:37 PM
Python coming from Java/C++: Classes from 1000 feet, help johnMG Programming 5 08-10-2004 08:40 PM
Why can't I read in data from the serial port using a bash script? tjt Linux - Newbie 1 06-17-2004 12:21 AM
Python 2.3 installed but still coming up 2.2.2 why? ifurita Linux - Software 1 10-10-2003 10:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05: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
Open Source Consulting | Domain Registration