Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

usb communicatioons

Posted on 2012-03-17
8
Medium Priority
?
294 Views
Last Modified: 2012-03-17
I would like to write a java routine to send and receive from a usb port.  I have been looking at several sites and it appears to more than a trivial task.  I did run into this response to the question on a site and am curious about the statement concerning mounting it and writing to it like a drive.  Anyone have any insite on this approach and maybe a little explanation as to how to do it?

The following is the posting from the other site:

if you are looking to directly build something in low level you can see http://www.beyondlogic.org/ for information about specs...

If you want some examples of code you can look at http://www.libusb.org/wiki/libusb-1.0 ... It's in C though.

If you just want to communicate with the USB in linux, you can just have linux mount it and write to it as a regular drive without having to deal with all the other stuff...
0
Comment
Question by:sargent240
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 37733777
USB is a network interface, not just a port.  Most devices require low level drivers.  Generally speaking, I don't believe java is suited to that.  So for most devices, you need to talk to the driver and not the USB 'port'.  If it 'looks' like a disk drive to Linux, you can address it that way.
0
 

Author Comment

by:sargent240
ID: 37733782
Your saying it does not look like a disk drive, right?
0
 

Author Comment

by:sargent240
ID: 37733785
I'm trying to control a music keyboard with a computer and can do it with the rs232 port.  When I plug in the usb to midi cable "midi1" appears in the dev directory.
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:sargent240
ID: 37733802
Can you tell me what value there is in the "midi1" entry in the /dev directory when I plug in the usb to midi cable if any?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 37733816
I suggest you try to send your data to the 'midi1' device like you would a file.  That would be standard practice in Linux.  Open, read, write.  You should get the same responses as from your RS-232 version I would think.  Just a different interface.
0
 

Author Closing Comment

by:sargent240
ID: 37733864
Again Thanks.
0
 

Author Comment

by:sargent240
ID: 37733875
I have one other question and I will open a new question if you like, but how is the baud rate controlled if it is handled like a file?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 37733976
Midi only operates at 31.5 kBaud as far as I know.  You don't have to set it for a USB MIDI interface.  This http://www.faqs.org/docs/Linux-HOWTO/MIDI-HOWTO.html seems to be the best Linux MIDI resource I can find at the moment.  Many older links for this subject are dead.
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Make the most of your online learning experience.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 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