Solved

Get data from an external device.

Posted on 2011-03-17
2
655 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
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 …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now