wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
298 stars 104 forks source link

Couldn't communicate to E160G modem #110

Closed sergei-mironov closed 3 years ago

sergei-mironov commented 4 years ago

Hi. I have E160G modem which seems to work correctly with minicom (sudo minicom -D /dev/ttyUSB0) and reference C program. Namely, I could easily send AT commands like 'AT' or 'ATI'.

Unfortunately, asterisk-chan-dongle reports errors like this:

*CLI> dongle cmd dongle0 ATI
[dongle0] 'ATI' Device disconnected
*CLI>     -- [dongle0] Trying to connect on /dev/ttyUSB0...
[Aug  2 11:56:47] WARNING[29293]: chan_dongle.c:284 opentty: Open /dev/ttyUSB0 successfully
      dongle cmd dongle0 ATI
[Aug  2 11:56:53] WARNING[29293]: chan_dongle.c:284 opentty: Open /dev/ttyUSB1 successfully
    -- [dongle0] Dongle has connected, initializing...
[Aug  2 11:56:53] ERROR[29215]: at_queue.c:251 at_queue_run: [dongle0] Error write command 'USER'S' expected response 'OK' length 4, cancel
[dongle0] 'ATI' Queue error
*CLI> [Aug  2 11:56:53] ERROR[29503]: at_queue.c:251 at_queue_run: [dongle0] Error write command 'AT' expected response 'OK' length 3, cancel
[Aug  2 11:56:53] ERROR[29503]: chan_dongle.c:454 do_monitor_phone: [dongle0] Error adding initialization commands to queue
    -- [dongle0] Error initializing Dongle
    -- [dongle0] Dongle has disconnected
    -- [dongle0] Trying to connect on /dev/ttyUSB0...

Could you please suggest what could be wrong?

Note, that printf("Open XXXX successfully\n") message was added by me, it is the only change in sources. I'm using latest asterisk-chan-dongle (git hash 328b2b7) and asterisk 15.

Configs are here. Please ignore unusual format, in the end it encodes regular text files.

sergei-mironov commented 3 years ago

Got some new info for this case:

I disabled opening audio_fd in chan_dongle.c:715 (wrote -1 to it and commented out sanity checks). After that device has passed AT-checks and could receive some SMS (I got messages like [dongle0] Got full SMS from Beeline@ ....). What could it mean? Could an attempt to open audio port hang the modem entirely?

sergei-mironov commented 3 years ago

I just got another modem which seems to work better. For now I believe that the problem was in my particular hardware.

wdoekes commented 3 years ago

Thanks for the feedback / self-close :)