Java Interface with serial port - java

I am looking for a library interface to allow me to check what has been posted to a serial port.
To be more precise, I am using a teensy 2.0 to interface with a button. I want to run code within the program without simulating a key press, and thought that printing something to serial would be a easy way to connect to the Java program.

I've once used RxTx library to establish a communication channel between PC and an external MCU via USB port. Worked fine : )

For my self I'm using the jssc library to communicate with the serial port and it's working fine and I here it'll stay that way here's the link : http://code.google.com/p/java-simple-serial-connector/downloads/list

Related

How to read a usb serial port in JAVA?

I add some detail to my question.
I receive on my Xbee device a flow of GPS coordinates but I'm unable to read and stock these data on a buffer.
My Xbee device is connected to my laptop on a usb serial port, that's why I want to create a program java to read and use my data flow sending by the serial port.
I'm searching on internet some code example or tutorials , without enought advices for my understanding, or I just find some dead projects.
I found that it's possible to use jssc library or javax.comm (but I can't download the javax.zip on sun). Do you know an other better USB API ? Could you help me to understand how I can manage to read and stock my Flow of GPS cordinate ?
Forget abut USB, it acts as transparent bridge. What you need is a way to read from the serial port. javax.comm is not (officially) available any more. I have been successfull dealing with the arduino serial port with the RXTX library.
First make sure you see the serial port on your dev machine. This might require to install a driver. Then use a terminal program to connect to the serial port.
Once this is working go on and get RXTX working.
Just in case: You can have only one connection at a time. Make sure that only one of IDE, terminal programm and RXTX is connecting to the serial port at the same time.

UDP packet capturing on a servlet application running at GAE

I have a code running in router that sends UDP packets(using Sendto() function and a string of data) to a particular server whose IP address and port number I will mention in my code.
I want to deploy a server application that could receive a UDP packet and store its information on server or somewhere else not sure right now.
I have decided to use Google app Engine for hosting my server side code which most probably will be having something like recvfrom() function to receive string.
So how and by using what API's can I start developing my server side code.
Google App Engine has a Preview release of a Socket API, but it does not let you create listening sockets. See Limitations and restrictions section at https://developers.google.com/appengine/docs/python/sockets/
You cannot create a listen socket; you can only create outbound sockets.
You can use Google Compute Engine to run any reasonable software on Google's cloud platform, including programs that receive UDP datagrams. You must always pay for Compute Engine instances.
According to the newest edition of App Engine Socket docs for Java, if you're using java 8 runtime you should be able to use java sockets without limitations:
Applications in the Java 8 runtime default to using native Java
sockets with no restrictions: Google recommends that you keep this
default.
That means that it should be possible to use java.net.DatagramSocket or java.nio.channels.DatagramChannel freely to work with UDP.

How can i host java udp program for my android application?

i am developing an android application in which the server side execution is done using a simple java udp program.i want to know how i can host this application because i need a static ip server to run the java program.can i run my java program in a server.is it possible if yes how?
You'll have to write a listener in some language (PHP, Java, Etc.). As for a static ip address, you can also look at a dynamic ip redirection service like no-ip;
http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html
You can use a personal machine thats always online, or you can try to use a shared hosting plan that allows you to have a listening port open. A web service will likely be easier to work with than having some custom UDP/TCP connection.

Serial Communication support for windows in java

I need a package for communicating with a electronic console via usb-2-rs232 cable. I got a package called RXTX, but i am not still satisfied with this package. Is there any other alternative for serial communication under windows??
For Serial Communication we can alos use the Labview software,in his builtin example there is serial communication module.
You can also does serial communication by using hyperterminal.set the default parameters for serial commuinication.
RXTX is also an open source
I would like to recommend you Java Serial Port from serialio.com In java there is java serial API
which you can use

Java and USB-to-COM

I want to develop a Java application to communicate with the device based on Xilinx Spartan 3E Starter Kit.
The board is connected to my PC with USB-to-COM cable (COM is on the board).
What I need is to send some sequences of bytes to the device and than receive the response from it. It is the same way the serial terminals (hyperterminal, minicom, etc) do.
I'm kinda new to Java, so what classes do i need to implement this?
I'm not exactly sure what you mean by "USB-to-COM". Do you mean that the USB connection is accessible as an RS232 serial port on the PC (aka COM port on windows) ?
If so, you should look at the RXTX library here: http://rxtx.qbang.org . It provides support for Java serial port communications on a number of platforms. If you are new to Java, you might not find serial port programming the easiest way to learn Java, but the examples included with RXTX should be clear otherwise.

Categories

Resources