[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Get data from an external device.

Posted on 2011-03-17
2
Medium Priority
?
686 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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month19 days, 6 hours left to enroll

834 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