Solved

Get data from an external device.

Posted on 2011-03-17
2
662 Views
Last Modified: 2012-05-11
I'm asking this question as a beginner tackling a hard external device problem.  So any general advice or lessons are greatly appreciated.

I am trying to connect and capture data from an external device connected to my PC.  This device is connected via a db9 serial cable to a usb converter, then into my usb port.  The data represents a 3-digit number on a simple hand-held display.  
I am running ubuntu 10.10 running on vmware.  I am running this on a windows 7 machine, but I want to keep it all within vmware linux if at all possible.  
I can see the data on the hand-held display and I'm connected via my data port, but I have no idea how to capture this data on my PC.

1. The first thing I want to do is verify that I can connect through a normal linux command prompt program just to verify that I can read the data.  
How do I accomplish this?  

2. The second thing I want to do is to capture the data into a python program.  This seems like mission impossible, given I'm still trying to figure out step 1.  But I want to attempt anyway.   ideally I want to do the following:

    prompt> python mycode.py
        - connect to device
        - read data
        - print value from device

What libraries, procedures, and steps do I need in order to capture this data from a python code?  

--------------begin device specs---------------
Serial data format:
1200 Baud, 8 bits, No Parity, One stop bit

Pinout descriptions for the device:
Pin 1, NC
Pin 2, power in or out, diode protected, Vout = Vbatteries or Vdcpower, Vin =
12VDC max
Pin 3, power in or out, same as pin 2
Pin 4, NC
Pin 5, data out, serial data, 1200 baud, N-8-1
Pin 6, Common
Pin 7, Common
Pin 8, NC

Data format:
x Device use only, Hex value
0x7E ASCII Tilda
0x20 ASCII Space
H Hundreds digit in ASCII (0x30 to 0x32)
T Tens digit in ASCII (0x30 to 0x39)
O Ones digit in ASCII (0x30 to 0x39)
0x2E ASCII Period
0x20 ASCII Space
0x4D or 0x4B ASCII M or K depending on display units selected
0x50 ASCII P
0x48 ASCII H
x Device use only, Hex value
0x0A ASCII Line feed
0x0D ASCII Carriage return
--------------end device specs---------------
0
Comment
Question by:tmonteit
2 Comments
 
LVL 3

Accepted Solution

by:
Alberto Cortes earned 500 total points
ID: 35162389
Read next cookbook for USB devices in vmware workstation:
http://www.vmware.com/support/ws45/doc/devices_usb_ws.html#1020963
0
 

Author Comment

by:tmonteit
ID: 35162401
More info....I found the device using lsusb -v.  
Now trying to figure out how to connect to it via some type of tty terminal program.  Hopefully the cookbook has some info.

Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question