• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Java and RS232: A newbie completely lost

 
                
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 13072
281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic