Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top