Author Message

<  Setup Discussion  ~  Modem ready?

PostPosted: Sun Jun 18, 2017 9:12 pm Reply with quote
Posts: 3 Joined: Sun Apr 02, 2017 3:34 pm
Hello,

I'm searching for a way to check the state of my surfstick.

On an Raspberry Pi (Raspbian Jessie/USB_modeswitch 2.5) I use different USB-Sticks. It is possible, that some of them are switched by kernel like described in http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=4&t=2669 and then there is not alway a link /dev/gsmmodem after switching.

On boot /etc/rc.local starts a script, that finally calls pon.wvdial. To be sure the modem is available, I test this by calling wvdialconf until the return-value is 0 (return-value=0 means success=modem found).

Unfortunately, pon.wvdial usually is not successful on the first try (timeout 20 seconds). Then the script fires poff.wvdial and a second pon.wvdial and this connects in most cases. BUT: When I start pon.wvdial from a ssh-session, it is successful in nearly every case (<10 seconds).

Is there a problem about pon.wvdial from rc.local (too early?) Is there a better way to check the state of the modem?

Thank you,
Stefan


Offline
PostPosted: Mon Jun 19, 2017 1:22 pm Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
To me, this seems to be a complicated way of checking for a specific modem ...

I would just check the output of
Code:
lsusb | grep <vendor ID>:<product ID>

where the values are those of the modem mode of the respective modem.

If the result is empty, the modem is not available yet.

If you are doing some more things after the mode switch, you could allow for an extra second before starting the connection. Or you add the additional steps to this script.


Offline
PostPosted: Mon Jun 19, 2017 3:04 pm Reply with quote
Posts: 3 Joined: Sun Apr 02, 2017 3:34 pm
Hi,

of course, but I need much more flexibility about the USB-modems. If I have to define the IDs before in my script, I can use only one single type of modem, with another type I alway will have to do a little coding...

Stefan


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
3 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum