ATLib icon indicating copy to clipboard operation
ATLib copied to clipboard

I'm gettign Timout expcetion often, should I close modem and serial for each command or keep it open ? my app sould be run 24h/24 7d/7

Open abdoutech93 opened this issue 11 months ago • 3 comments

my app sould be run 24h/24 7d/7 I'm gettign Timout expcetion often, should I close modem and serial for each command or keep it open ?

abdoutech93 avatar Dec 22 '24 00:12 abdoutech93

I think in order to receive SMS messages, the serial port must be open. It would be nice if the application had a service to periodically check the availability of the serial port.

I got the same error several times, but I can't pinpoint the specific timeout issue. I tried sending AT commands using SerialPort.Write() (without ATLib) and it works fine.

falestra avatar Dec 23 '24 12:12 falestra

You should not need to close the modem connection between commands. What modem do you use? Does it happen after a certain command?

hbjorgo avatar Dec 23 '24 15:12 hbjorgo

Modem : Fona USB : Huawei e303

abdoutech93 avatar Dec 25 '24 13:12 abdoutech93

Hello, I was also getting a lot of Timeout exceptions because i was sending too much commands to the channel. Then i have tried to use semaphores to get exclusive access between sending each commands and everything seems to work. However I am not sure if this is right solution (or solution at all).

I was looking to source code specifically AtChannel.cs

there is a waitingForCommandResponse semaphore to check for timeout but it is after sending the command itself. As I understood many calls of this method can be done and many commands can be then sent simultaneously. Can this cause the issue? I am not expert on serial communication so can't tell if this could be a problem or not.

davidlegs avatar Jun 25 '25 20:06 davidlegs