Java Can't Finding RFCOMM Output Port - java

I have a HC-05 Bluetooth board. It is just a circuit board that connects to the Tx and Rx pins of a UART output of a microprocessor chip and transmits Bluetooth. On a PC I use the WinXP Bluetooth Devices program to pair the PC to the HC-05. Pairing creates two new comports, Outgoing (usually COM10) and Incoming (usually COM11) and if I use a program like Hyperterminal I can connect to the outgoing comport and receive the serial data being sent by the UART.
My problem is I can't get java to find that comport. I have tried a number of java programs that search for comports. None of them seem able to find the Outgoing port COM10. They all can find COM11 and other comports. But COM10 seems to be where the data I want is arriving.
Any ideas?

On second thought, forget it. I have been trying to solve this problem for three weeks. No one seems able to help me. Now my searches keep turning up my postings asking for help.
I will do the project in Visual Basic. It could have been completed 2.5 weeks ago.
Sorry for using the space and bandwidth.

Related

Bluetooth SPP mysterious bufferoverflow, Android / BlueGiga WT12, potential flow control issue?

The situation:
I'm developing an android app for some hardware that has a BlueGiga WT12 bluetooth modem. The hardware device sends 56 byte packets at around 240hz. I'm testing on a Samsung S5 and S8. A fully functional app has already been created for IOS and PC so we know the hardware device works.
I use a separate thread to read in the data and then dispatch it to the main thread.
Issue:
The issue I'm having is when I send the command to the device telling it to start streaming, it starts to stream but very shortly after I start receiving packets at a very slow rate 10-60hz.
After some examination I realized that the device was experiencing a bufferoverflow.
After talking to our hardware guy he said the only real thing that could cause that is something on the phone side not reading fast enough, resulting in the hardware device not wanting to send more packets because it thinks the phone can't receive anymore and then the buffer overflows on the hardware device.
The WT12 has flow control enabled so maybe this is an issue with Android not giving a clear-to-send signal to the WT12. But to my knowledge we don't have access to all of the flow control stuff.
What I've tried:
My first line of attack was to simply remove any code that I thought was slowing down the reads but that seemed to have no effect.
I also tried basically every bluetooth serial terminal app I could get my hands on, all with the same result.
So then I questioned if it was some weird problem relating to the hardware device but after using pc based (bluetooth) serial terminals I had no issues at all on the pc.
The hardware device can also operate over USB as opposed to bluetooth so I tried reading the data from it exactly the same as I had with the bluetooth connection but over USB. Using the USB serial connection I had no issues at all.
My thoughts:
So this leads me to believe the problem must be with the bluetooth modem on the phone side. I was thinking maybe it was a flow control issue as we have flow control enabled on the WT12. Maybe android isn't sending a clear to receive signal?
The problem is to my knowledge the flow control is implemented in the bluetooth stack and we as developers have no control over it if I'm not mistaken?
Other then flow control I don't really have much idea what could be causing the hardware device to not want to send me data.
I've just now been experiencing the same issues with flow control. Then I see that in case of RN4678 BT module, that it's best to disable the flow in the MCU FW and pull the cts pin low on the module. That worked for us.

How do I detect the COM port number of a usb dongle?

I have created an application which sends SMS using Java.
Whith this, I must enter the com port number of dongle manually to code segment.
I would like to do this automatically using code.
How can I do this?
You may want to have a look at jUSB, which provides an API for USB programming. Get a Host from a HostFactory, iterate over it's Buses, and walk the device tree (you can get the number of devices from each Device, #0 is usually the device itself). Then you just need to find out what kind of Configuration your device has and search by that.

Reading SMS from PC

Scenario : 1
Suppose there are two phones A and B. phone B sends a message to phone A. Phone A has that message in its inbox. Both the phones are nokia multimedia phones that can be connected with my laptop via nokia pc-suite.They can also be connected via Bluetooth with my HP laptop.
Scenario : 2
A valid sim card of my local operator is inserted into a modem and the modem is connected with my laptop. I can read messages sent in that number(sim) by using the software provided with the modem.
Question:
The received text message will be the input of my java program. How can I read that message with my java program. Solution for any of the two scenarios will solve my problem.
It would be very helpful for me if someone provide me some resources regarding this issue. I am interested to implement it by java but it would be also helpful if the resources are not in java platform but relevant to my task.
You can connect GSM modem built in Mobile Phone via bluetooth or RF232 connection, then send AT Commands. Pure java conenction functions should not be enough to make it possible. So you can use low level API coded by C programming language then connect it with Java applicatio via JNI.

Forwarding a text message via GSM modem using Java

I am using Java CommV3 drivers to interface a GSM modem (Huawei E173) with a Java Application. I am trying to forward a text message to several numbers present in a mySQL database. I always receive a PortInUseException. However, manually sending and receiving messages works perfectly fine using the same code. I have tried using a delay of upto 15 seconds between messages (in the loop) but I still face the same problem.
What am I missing here? Do we have an AT command for forwarding messages to multiple numbers? Is there a particular delay that I should be aware of?
Though this is an old question, I might be able to provide a suggestion.
If you are using a multi-threaded approach for sending and receiving, you must ensure there is exclusive access for each of these threads to the resource (in this case, your GSM Modem). So, make sure you close the connection to your serial port vice versa during RX/TX.
I can provide you more suggestions if you could post a code snippet.

Send SMS using phone from computer

I need my computer program to be able to send and receive SMS messages. The software has to run independent of the Internet so using a web based SMS gateway is not the solution.
The software should be running from a linux or a Windows machine. Windows is more important for my usecase. My program is in Java but I guess there may be solutions independent of the programming language.
I am considering one of the following options.
Kannel http://www.kannel.org/ Although supported for Linux I guess I could find a way to compile it in windows like done here: http://www.ddj.co.za/kannel-for-windows
The other one seems a more lightweight option http://smsj.sourceforge.net/
Which of these or something else that you have in mind could be a better way of sending SMS via computer without an internet connection?
I am considering using these libraries so I don't have to program all the AT Commands.
Also how do I connect my phone to the computer? For example will it be fine if I just connect my phone with a USB cable when using kannel.
Update:
I need to use simple GSM phones and not depend on IOS or Android specific features.
Perhaps not want you needed or wanted, but maybe useful for others: When I had my iPhone jailbroken there was an Cydia app I used to send SMS from my computer through my phone, BiteSMS.
You had to ssh in and then something similar to:
/Applications/biteSMS.app/biteSMS -send -carrier 077xxxxxx “The message goes here”
Obviously you replace 077xxx with the number you want to send to.
It looks like it is fairly similar process with Android, check out this question on doing this through Android. Again this requires a ssh connection to the phone. Also have a google on 'Sending sms from commandline' there are other resources available.
As for other methods, I can't see any viable options without attaching a phone to your computer and accessing the OS and ssh seems the easiest way to do this.
Try smslib.org + some GSM modem.

Categories