I am using Java with RXTX library and I have a problem. I want to read data from a Serial Port that is the bluetooth. If I use a normal COM port (usb arduino for example)and JAVA with RXTX, it works. If I use PUTTY, i can read the data from the bluetooth port.
If I use Java + RXTX and the bluetooth port, it doesn't work. If I use putty, and after that I want to display all ports, it works but only for one time, after that I cannot find the port anymore, like it break it. (not even in putty it doesn't work).
If I do not start PUTTY beforehand, It cannot even see the port. After the port is "broken" I have to turn off/on multiple times my bluetooth device. What seem to be the problem?
I did try the things listed here and it did not work : \
http://neophob.com/2011/05/serial-library-rxtx-v2-2pre5/
https://github.com/processing/processing/issues/1374.html
Any other thoughts?
Something is strange. Do you know what do I need to do so that the right rxtxSerial.dll is used? I have deleted every instance of rxtxSerial.dll from my PC and it still works???
Related
I am trying to send a file from Android emulator on Windows to ubuntu.
https://www.rgagnon.com/javadetails/java-0542.html
https://www.youtube.com/watch?v=7QNJvxXCYOY
How do I use the Simple HTTP client in Android?
These all helped me learn how to send a file through socket, but I am not sure which IP address to use. I set up ServerSocket and Socket, but the code won't proceed at socket = ServerSocket.accept()
I wonder if this is because I am not using the correct IP address. I appreciate any help. Thanks in advance.
I am trying to send a file from Android emulator on Windows to ubuntu.
So you're running an emulator on Windows and want to send a file from the emulator to another machine running Ubuntu? Then there is no way for us to answer this question exactly, as IP addresses depend on your personal network setup. I would suggest first moving the file form emulator -> Windows, then you can send it like any other file between your machines (you can use scp from Ubuntu, or a service like DropBox, etc.)
You can also probably run ifconfig on your Ubuntu side to obtain your destination IP.
Heyy guys. I'm writing a chat application in java, works pretty well. But can i somehow host my Server file or the Serversocket on the web? I want to make it so my friends from other pcs can use the client and connect to the server file which is hosted on the web. Is that possible? Can i host the File/socket online?
When you run a java application that opens a ServerSocket, it opens a port on your local machine and starts listening for incoming connections. What you do with those connections is up to the implementation of the java code that you write.
The "web" is much less foreign than you are making it out to be. Your own computer can be on the web that you're talking about and people can connect to your chat service. Or you can choose to host it on something like an AWS server.
The following approach is assuming you are behind a pretty standard NAT config.
Once you run your java application, you need to make sure other computers can see you, either inside your LAN or outside on the internet. You want to start testing from as close to your computer as possible, then start expanding outward.
First you need to make sure that your computer's firewall is actually allowing connections on the port that your java application is listening on.
Opening ports in the Windows Firewall
Setting up and opening ports in Linux
Now computers on your LAN will be able to connect to your java program. Now you need to go one layer out, and port forward your router. This is much less standard so I can't help you too much, but Google can.
At this point, anyone on this internet, knowing your external ip and what port your java application is listening, can connect to your service.
If you chose to host this on an third party hosting service, you'll need to go through similar steps, but there may be slight differences that you can either ask about, or again Google is a great resource.
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.
I have an application made of a device I made to connect through USB emulating a Serial port. Now, I need to connect the same device via bluetooth so I'm using a RN-42 (Bluetooth to serial port) in my device to send the data over RF.
Then I pair my device in Windows with the laptop's internal BT module which creates to COM ports a Outgoing and a Incoming one. Then if I connect using Br#ay's terminal I receive the expected data when I connect to the Outgoing COM port.
The problem is that when I use my Java app where I am using the last RXTX libraries, I can discover the COM port (which is the problem that everyone has, at least thats all what i found in forums) and it seems to connect but then I don't receive no data. Using the same exact program but connecting using a cable it works just fine as the terminal does.
I also tried to use the BlueCove libraries, I can find the bluetooth devices but I don't really know how to discover it services and then connect to it using RFComm. I can't find a complete example of how to do that.
Any help will be appreciated!
I'm getting similar problem with default Windows Bluetooth stack.
With Toshiba stack communication is ok.
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