Project

General

Profile

Can I detect when a SIM or a serial port is not ready after connect successfully

Added by gonzalo2047 over 4 years ago

I have a 8 ports modem pool with 32 SIM (4 SIM per gsm port).
The SIM cards can rotate automatically by sent messages or by time.
For example, I can change the SIM every 10 sent sms or every 10 minutes.
This is a feature of the modem pool, and I can´t manage it when de modem is working.
When the cards are rotating, the serial port still conected, but SIM is unusable for some seconds.
Can I detect when sim (or serial port) is not ready?. Because if I try to send a sms in that moment, the library throw a "sms feacture not support" exception and then I can´t continue sending messages.
I test it using your "demo - core app"
Using a port monitor, I can see a "normal power down" over serial port and then initialize again.
Thanks.


Replies (3)

RE: Can I detect when a SIM or a serial port is not ready after connect successfully - Added by admin over 4 years ago

Hi,

This is my suggestion.

There is an option to send the SMS to a queue (meaning the SMS will be sent asynchronously). In this case you can use the event MessageSendingFailed to detect if there is any sending failure and the type of exception raised. You can then try to resend the message.

The serialport object is also exposed as part of the gateway. You can try to check the state of the serial port to see if it tells you the status of the serial port.

Thanks
Regards
admin

RE: Can I detect when a SIM or a serial port is not ready after connect successfully - Added by gonzalo2047 over 4 years ago

I tried using the "MessageSendingFailed" event, but after a failure, or exception raised, the modem couldn't send a sms again.
Work fine for me disconnect and connect again the port, but I wasted a lot of time doing that every SIM change.

Thanks.
Regards.

RE: Can I detect when a SIM or a serial port is not ready after connect successfully - Added by admin over 4 years ago

Hi,

I don't quite get what you meant. If there is an error in the port, then it is normal to disconnect and connect again. Alternatively you can try do disconnect only upon exception, and the library can auto reconnect if it detects that the connection is not established yet.

Thanks
Regards
admin

    (1-3/3)