Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java and RS232: A newbie completely lost  RSS feed

 
                
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm in serious need of help. I've been banging my head against a wall for a month now trying to write Java code to interface with a device over RS232. I've tried the javax library and gotten nowhere.

I have a device that plugs into USB. This device communicates with serial comms and RS232 to another device inside of it, a badge. I can talk to the badge over hyperterminal, but I can't find a way to talk to the device inside of a Java program.

Is the javax library the right way to go? Should I switch to python?

Thanks for reading, I'm completely lost.

- alana
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what hyperterminal is, but if the device connects via USB, then using USB to connect to it (instead of RS-232) seems a good idea (the JavaIoFaq lists a few options for that). How you might go about using that to talk over the RS-232 to the internal device would depend on the implementation of the device; doesn't it come with documentation?
 
                
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Not sure what hyperterminal is, but if the device connects via USB, then using USB to connect to it (instead of RS-232) seems a good idea (the JavaIoFaq lists a few options for that). How you might go about using that to talk over the RS-232 to the internal device would depend on the implementation of the device; doesn't it come with documentation?


The only instructions it came with was to use hyperterminal to communicate with it. Hyperterminal is an old (think 95) terminal communications interface for windows.

I don't know much about RS232 or serial ports, and I've only learned Java within the last four months. Although the 'cradle' device plugs into USB, it uses RS232 to communicate with the 'badge' device.

Computer -- USB --> Cradle device -- RS232 --> Badge device

Do people still use the javax api? Is there any website or textbook that goes into detail about serial interfaces with Java? The alternate is going to python and using the pyserial library, but I'm struggling to find a python IDE as well.

Thanks again

- alana
 
Stephan van Hulst
Saloon Keeper
Posts: 6980
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is possible in Java, the code is often just a little bit unwieldy. You have to make sure you set up the UART correctly.

Show us some code, and tell us what's happening. We may have some tips.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!