Solved

Get data from an external device.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

912 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

21 Experts available now in Live!

Get 1:1 Help Now