[SOLVED]How do I get a USB modem to connect on startup?

Booting, installing, newbie
Message
Author
User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#21 Post by nic007 »

Maybe I don't quite understand your problem. I'm just curious why you opt for a different setup technique when pupdial is the one to use for 3g dongle setup by almost all users. I don't see any advantage using your option compared to the very simple dialup procedure BTW - Once setup with pupdial it doesn't matter when you plugin the modem unless you want to connect automatically at startup in which case it's obvious that you need to plugin the dongle first before boot.

april

#22 Post by april »

Oh OK I'll check that out . I thought I was doing it the correct way for that device.Thanks

I think they are the same . Just approached a different way . However doing it your way for my device does not configure it properly. It comes with a message of success I have seen many times before ,after taking a long dhcp negotiation time . When you look it has no DNS server IP's -they are zero and it will not connect

april

#23 Post by april »

nic007 wrote: BTW - Once setup with pupdial it doesn't matter when you plugin the modem unless you want to connect automatically at startup in which case it's obvious that you need to plugin the dongle first before boot.
But must you hit the connect icon after you plug it in or is this automatic on plugin.?

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#24 Post by nic007 »

april wrote:Oh OK I'll check that out . I thought I was doing it the correct way for that device.Thanks

I think they are the same . Just approached a different way . However doing it your way for my device does not configure it properly. It comes with a message of success I have seen many times before ,after taking a long dhcp negotiation time . When you look it has no DNS server IP's -they are zero and it will not connect
Are you saying you can't get it connected? Does pupdial detect your modem? If not you must click probe. Select simple mode in pupdial for immediate connection.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#25 Post by nic007 »

april wrote:
nic007 wrote: BTW - Once setup with pupdial it doesn't matter when you plugin the modem unless you want to connect automatically at startup in which case it's obvious that you need to plugin the dongle first before boot.
But must you hit the connect icon after you plug it in or is this automatic on plugin.?
. If you want to connect automatically when you boot up you need to place a script in your startup folder. If your script stipulates pupdial as executable, the pupdial connect box will open automatically and you will need to click connect. If you make wvdialshell the script to run as explained in my HOWTO, you don't need to do anything, you will connect immediately at bootup.

april

#26 Post by april »

nic007 wrote:
april wrote:Oh OK I'll check that out . I thought I was doing it the correct way for that device.Thanks

I think they are the same . Just approached a different way . However doing it your way for my device does not configure it properly. It comes with a message of success I have seen many times before ,after taking a long dhcp negotiation time . When you look it has no DNS server IP's -they are zero and it will not connect
Are you saying you can't get it connected? Does pupdial detect your modem? If not you must click probe. Select simple mode in pupdial for immediate connection.
No It connects fine read slower

april

#27 Post by april »

nic007 wrote:
april wrote:
nic007 wrote: BTW - Once setup with pupdial it doesn't matter when you plugin the modem unless you want to connect automatically at startup in which case it's obvious that you need to plugin the dongle first before boot.
But must you hit the connect icon after you plug it in or is this automatic on plugin.?
. If you want to connect automatically when you boot up you need to place a script in your startup folder. If your script stipulates pupdial as executable, the pupdial connect box will open automatically and you will need to click connect. If you make wvdialshell the script to run as explained in my HOWTO, you don't need to do anything, you will connect immediately at bootup.
Mate ! Understand I am doing almost the exact same thing with my connect script which executes "sleep 05","pgprs-connect" after I have initially set up the modem as explained

Please stop pushing your wvdialshell at me which is a laborious heavy way to do it .

You are not experimenting with the way I have shown you and you are not trying to understand it rather you seem to get off on pushing what you have done previously
Stop now please don't post any more I am happy with the connect part and am trying something different.

You have commandeered this whole page just to push the same idea you pushed on the first page . Bloody ridiculous
Last edited by april on Fri 22 Apr 2016, 10:10, edited 2 times in total.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#28 Post by nic007 »

april wrote:
nic007 wrote:
april wrote: But must you hit the connect icon after you plug it in or is this automatic on plugin.?
. If you want to connect automatically when you boot up you need to place a script in your startup folder. If your script stipulates pupdial as executable, the pupdial connect box will open automatically and you will need to click connect. If you make wvdialshell the script to run as explained in my HOWTO, you don't need to do anything, you will connect immediately at bootup.
Mate ! Understand I am doing the exact same thing with my connect script which executes "sleep 05","pgprs-connect"
Mate, you clearly don't need my help. Go along your merry way and do what you think works best. As a long time user of 3G dongles with Puppy I thought my contribution may help you along. Clearly not. I'm wasting my time with you. Cheers

april

#29 Post by april »

Yes you are -Goodbye

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#30 Post by nic007 »

april wrote:Yes you are -Goodbye
You seem to have a very crappy attitude (i've read some other posts of you to). This is not really how we conduct business on this forum which is here to help each other in a friendly manner. You can accept the help or don't but don't be rude. Now, I'm really done with you. Good luck with your stinking attitude.

april

#31 Post by april »

You see I see you for what you are .

You wish only to push your own ideas. Not to listen to or help others no matter what you say . The entire page above shows that. You insinuated yourself back into the thread after being told to go away politely because I did not want to go down your path.

Now you want to make it my fault . It don't work like that Mate !
The thread is finished anyway as far as connect is concerned. I am just experimenting with the commands available in the udev rules now so hopefully you won't have a barrow to push on that subject.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#32 Post by jafadmin »

April, are you performing a usb_modeswitch in the script? These dongles usually present as a storage device first so they can make their software available. So it takes two udev rules. The first one activates when the dongle is first inserted as a storage device, and performs a usb_modeswitch which changes the dongle's mode to a serial (modem) device. At that point the script on the second rule should execute and set up your connection.

Go back and re-read that link I posted. It shows two rules near the bottom. Of course, you'll need to adapt them to your device. One line to modeswitch and one to connect.

You can use udevadm to get the udev info on the device. (change /dev/sdb to match your device.)

Code: Select all

udevadm info -a -p  $(udevadm info -q path -n /dev/sdb)> udevadm.out
should do it. It will create the file udevadm.out which will contain tons of info, but it has the info you need to create your rule.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#33 Post by jafadmin »

I wish I had one of those WLAN dongles so I could experiment with it. I just can't justify getting one just for testing, though.

This is going to require some R&D to get this up and going. I sent you a PM. Maybe we can work out the details that way and share the results once we're done?

april

#34 Post by april »

For the vodaphone try I put in

Code: Select all

# Vodafone / Huawei Kxxxx
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1f1c", RUN+="usb_modeswitch '%b/%k'"
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1f1c", RUN+="/mnt/home/TempSave/Scripts/ruletester.sh"
For the Huawei E160E I put

Code: Select all

# Huawei E160E Mine

ATTR{idVendor}=="12d1", ATTR{idProduct}=="140c", RUN+="usb_modeswitch '%b/%k'"
ATTR{idVendor}=="12d1", ATTR{idProduct}=="140c", RUN+="/mnt/home/TempSave/Scripts/ruletester.sh"
Neither one has an output from ruletester.sh
Realtek is a wifi adapter not being used atm
E160E is in use and connected to internet with sr1 icon available
K4203 is plugged but not in use and puts out the yellow configuring message but not the green ,ready to use message that the E160E does


Just putting it here makes me think maybe each device has switched before the ruletester.sh operates so it has a different ID at that time but After "lsusb" gives

Code: Select all

# lsusb
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN
Bus 001 Device 005: ID 12d1:140c Huawei Technologies Co., Ltd. 
Bus 001 Device 006: ID 12d1:1f1c Huawei Technologies Co., Ltd. 
Bus 002 Device 002: ID 0461:4d22 Primax Electronics, Ltd 
Bus 002 Device 003: ID 413c:1003 Dell Computer Corp. Keyboard Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 413c:2010 Dell Computer Corp. Keyboard
# 
Strange

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#35 Post by jafadmin »

Give this a read and see if it helps?

http://www.draisberghof.de/usb_modeswit ... f=3&t=1970

They're dealing with the right dongle.. :wink:

april

#36 Post by april »

jafadmin wrote:Give this a read and see if it helps?

http://www.draisberghof.de/usb_modeswit ... f=3&t=1970

They're dealing with the right dongle.. :wink:
Oh OK that changes it all doesn't it . Bloody Windows fiddling to stop Linux again it looks like . I'll give it a run and see.

Code: Select all

# usb_modeswitch -v 12d1 -p 1f1c -W -I -M 55534243123456780000000000000011062000000101000100000000000000
Taking all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.4 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1f1c
TargetVendor=   not set
TargetProduct=  not set
TargetClass=    not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check disabled
System integration mode disabled


usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 001
usb_os_find_busses: Found 002
usb_os_find_devices: Found 001 on 001
usb_os_find_devices: Found 005 on 001
usb_os_find_devices: Couldn't open /dev/bus/usb/001/011
usb_os_find_devices: Found 006 on 001
skipping descriptor 0xB
skipped 1 class/vendor specific endpoint descriptors
skipped 4 class/vendor specific interface descriptors
usb_os_find_devices: Couldn't open /dev/bus/usb/001/008
usb_os_find_devices: Couldn't open /dev/bus/usb/001/015
usb_os_find_devices: Found 004 on 001
usb_os_find_devices: Couldn't open /dev/bus/usb/001/029
usb_os_find_devices: Couldn't open /dev/bus/usb/001/053
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 002 on 002
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Couldn't open /dev/bus/usb/002/016
usb_os_find_devices: Found 003 on 002
usb_os_find_devices: Found 004 on 002
skipped 1 class/vendor specific interface descriptors
skipped 1 class/vendor specific interface descriptors
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
Looking for default devices ...
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 12d1:140c
   found matching vendor ID
  searching devices, found USB ID 12d1:1f1c
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 0bda:8176
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 0461:4d22
  searching devices, found USB ID 413c:1003
  searching devices, found USB ID 413c:2010
 Found device in default mode, class or configuration (1)
Accessing device 006 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Vodafone(Huawei)
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
USB error: could not release intf 0: No such device
 Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

# lsusb
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN
Bus 001 Device 005: ID 12d1:140c Huawei Technologies Co., Ltd. 
Bus 001 Device 007: ID 12d1:1590 Huawei Technologies Co., Ltd. [color=darkred] *******[/color]
Bus 002 Device 002: ID 0461:4d22 Primax Electronics, Ltd 
Bus 002 Device 003: ID 413c:1003 Dell Computer Corp. Keyboard Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 413c:2010 Dell Computer Corp. Keyboard
# 
It'l take me a bit of time to analyse that and see what we have got.
sr2 is gone so thats a good sign I think.When I unplug and replug it is now bringing the sr2 up for about 10 seconds and then it disappears
assume it behaves like other Huawei cdc_mbim/cdc_ether dongles, you have to pull a dhcp address from the device.
192.168.1.100 seems to be the usual one and the dongles is 192.168.1.1 where there also is a web server.

see other forum threads:

viewtopic.php?f=3&t=1716

viewtopic.php?f=2&t=1592

april

#37 Post by april »

Got this worked out I think
See this thread
http://murga-linux.com/puppy/viewtopic. ... 806#900806
for a vodaphone plugin .

Huawei have included Linux software for installing the device on the device .
When first plugged in it shows an optical storage device sr1 for example . On thet device is an install script to run and it is recognised as a USB phone modem thereafeter whenever plugged .

No modeswitching is needed nowadays for the newer models so I suggest you check each one for a Linux install script..

Thanks to jafadmin for the leads.

Here is a bit of the chinese readme on the device
--How to Install----------------------

1. keep your right is "root"
2. Run "./install" in TERMINAL to install
3. if you have installed before , intend to the istalling information

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#38 Post by jafadmin »

I'm impressed. Very well done. Now all you need is a Deerstalker & Calabash ;)

Post Reply