Go Down

Topic: Yun, 3G dongle and yun_3g library (Read 13760 times) previous topic - next topic

bartdereu

#15
Sep 07, 2014, 09:38 pm Last Edit: Sep 07, 2014, 09:40 pm by bartdereu Reason: 1
this is my logread output when plugged in, and dmesg afterwards. There don't seem to be any USB assignment.  :~
Code: [Select]

root@Arduino:~# logread -f
Sep  7 19:34:32 Arduino kern.info kernel: [  289.850000] usb 1-1.1: new high-spe                                                                               
ed USB device number 6 using ehci-platform
Sep  7 19:34:32 Arduino kern.info kernel: [  289.980000] usb 1-1.1: New USB devi                                                                                            
ce found, idVendor=12d1, idProduct=1f01
Sep  7 19:34:32 Arduino kern.info kernel: [  289.980000] usb 1-1.1: New USB devi                                                                                            
ce strings: Mfr=2, Product=1, SerialNumber=0
Sep  7 19:34:32 Arduino kern.info kernel: [  289.980000] usb 1-1.1: Product: HUA                                                                                            
WEI HiLink
Sep  7 19:34:32 Arduino kern.info kernel: [  289.980000] usb 1-1.1: Manufacturer                                                                                            
: HUAWEI
Sep  7 19:34:32 Arduino kern.info kernel: [  290.000000] scsi2 : usb-storage 1-1                                                                                            
.1:1.0
Sep  7 19:34:32 Arduino user.notice usb-modeswitch: 1-1.1:1.0: Manufacturer=HUAW                                                                                    
EI Product=HUAWEI_HiLink Serial=?
Sep  7 19:34:32 Arduino user.notice usb-modeswitch: 1-1.1:1.0: Selecting /etc/us                                                                                            
b_modeswitch.d/12d1:1f01 for mode switching
Sep  7 19:34:32 Arduino syslog.notice usb_modeswitch: switching device 12d1:1f01                                                                                      
on 001/006
Sep  7 19:34:33 Arduino kern.info kernel: [  290.380000] usb 1-1.1: USB disconne                                                                                            
ct, device number 6
Sep  7 19:34:34 Arduino kern.info kernel: [  291.900000] usb 1-1.1: new high-spe                                                                                            
ed USB device number 7 using ehci-platform
Sep  7 19:34:34 Arduino kern.info kernel: [  292.030000] usb 1-1.1: New USB devi                                                                                            
ce found, idVendor=12d1, idProduct=14db
Sep  7 19:34:34 Arduino kern.info kernel: [  292.030000] usb 1-1.1: New USB devi                                                                                            
ce strings: Mfr=2, Product=1, SerialNumber=0
Sep  7 19:34:34 Arduino kern.info kernel: [  292.030000] usb 1-1.1: Product: HUA                                                                                            
WEI HiLink
Sep  7 19:34:34 Arduino kern.info kernel: [  292.030000] usb 1-1.1: Manufacturer      

bartdereu

Code: [Select]
and dmesg :

[    2.850000] ag71xx ag71xx.0: eth1: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]

[    2.920000] hub 1-0:1.0: 1 port detected
[    2.930000] Initializing USB Mass Storage driver...
[    2.930000] usbcore: registered new interface driver usb-storage
[    2.930000] USB Mass Storage support registered.
[    2.930000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
[    2.940000] sdhci: Secure Digital Host Controller Interface driver
[    2.940000] sdhci: Copyright(c) Pierre Ossman
[    2.940000] usbcore: registered new interface driver ushc
[    2.940000] TCP cubic registered
[    2.950000] NET: Registered protocol family 17
[    2.950000] Bridge firewalling registered
[    2.950000] 8021q: 802.1Q VLAN Support v1.8
[    2.960000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    2.960000] Freeing unused kernel memory: 180k freed
[    3.250000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    3.440000] usb 1-1: New USB device found, idVendor=058f, idProduct=6254
[    3.440000] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.440000] usb 1-1: Product: USB2.0Hub
[    3.580000] hub 1-1:1.0: USB hub found
[    3.580000] hub 1-1:1.0: 4 ports detected
[    3.990000] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
[    4.220000] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=1f01
[    4.220000] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    4.230000] usb 1-1.1: Product: HUAWEI HiLink
[    4.230000] usb 1-1.1: Manufacturer: HUAWEI
[    4.250000] scsi0 : usb-storage 1-1.1:1.0
[    4.350000] usb 1-1.4: new high-speed USB device number 4 using ehci-platform
[    4.480000] usb 1-1.4: New USB device found, idVendor=058f, idProduct=6366
[    4.480000] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.480000] usb 1-1.4: Product: Mass Storage Device
[    4.490000] usb 1-1.4: Manufacturer: Generic
[    4.490000] usb 1-1.4: SerialNumber: 058F0O1111B1
[    4.540000] scsi1 : usb-storage 1-1.4:1.0
[    5.070000] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    5.250000] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    5.590000] scsi 1:0:0:0: Direct-Access     Multi    Flash Reader     1.00 PQ: 0 ANSI: 0
[    6.290000] Registered led device: ds:green:usb
[    6.290000] Registered led device: ds:green:wlan
[    8.790000] JFFS2 notice: (537) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 15 of xref (0 dead, 4 orphan) found.
[    9.960000] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   38.740000] Loading modules backported from Linux version master-2014-01-23-0-g62c147d
[   38.740000] Backport generated by backports.git backports-20140124-0-g1256d3e
[   38.840000] cfg80211: Calling CRDA to update world regulatory domain
[   38.840000] cfg80211: World regulatory domain updated:
[   38.840000] cfg80211:  DFS Master region: unset
[   38.850000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   38.850000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   38.850000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   38.860000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   38.860000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   38.860000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   38.870000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[   39.920000] ath: EEPROM regdomain: 0x0
[   39.920000] ath: EEPROM indicates default country code should be used
[   39.920000] ath: doing EEPROM country->regdmn map search
[   39.920000] ath: country maps to regdmn code: 0x3a
[   39.920000] ath: Country alpha2 being used: US
[   39.920000] ath: Regpair used: 0x3a
[   39.930000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   39.940000] Registered led device: ath9k-phy0
[   39.940000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   39.940000] cfg80211: Calling CRDA for country: US
[   39.940000] cfg80211: Regulatory domain changed to country: US
[   39.950000] cfg80211:  DFS Master region: FCC
[   39.950000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   39.950000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   39.960000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 1700 mBm)
[   39.960000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (300 mBi, 2400 mBm)
[   39.960000] cfg80211:   (5490000 KHz - 5600000 KHz @ 80000 KHz), (300 mBi, 2400 mBm)
[   39.970000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2400 mBm)
[   39.970000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 3000 mBm)
[   39.970000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[   40.610000] NTFS driver 2.1.30 [Flags: R/O MODULE].
[   40.680000] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[   40.920000] PPP generic driver version 2.4.2
[   41.010000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   41.250000] NET: Registered protocol family 24
[   41.310000] nf_conntrack version 0.5.0 (954 buckets, 3816 max)
[   41.880000] i2c /dev entries driver
[   41.930000] usbserial: Unknown parameter `maxSize'
[   41.960000] Linux video capture interface: v2.00
[   41.990000] usb_wwan: Unknown symbol usb_serial_port_softint (err 0)
[   42.020000] option: Unknown symbol usb_wwan_write (err 0)
[   42.020000] option: Unknown symbol usb_wwan_close (err 0)
[   42.020000] option: Unknown symbol usb_wwan_release (err 0)
[   42.030000] option: Unknown symbol usb_serial_disconnect (err 0)
[   42.030000] option: Unknown symbol usb_wwan_tiocmget (err 0)
[   42.030000] option: Unknown symbol usb_wwan_chars_in_buffer (err 0)
[   42.030000] option: Unknown symbol usb_wwan_write_room (err 0)
[   42.040000] option: Unknown symbol usb_wwan_disconnect (err 0)
[   42.040000] option: Unknown symbol usb_wwan_startup (err 0)
[   42.040000] option: Unknown symbol usb_wwan_set_termios (err 0)
[   42.040000] option: Unknown symbol usb_wwan_dtr_rts (err 0)
[   42.050000] option: Unknown symbol usb_wwan_open (err 0)
[   42.050000] option: Unknown symbol usb_serial_probe (err 0)
[   42.050000] option: Unknown symbol usb_serial_register (err 0)
[   42.060000] option: Unknown symbol usb_serial_deregister (err 0)
[   42.060000] option: Unknown symbol usb_wwan_ioctl (err 0)
[   42.060000] option: Unknown symbol usb_wwan_tiocmset (err 0)
[   42.160000] fuse init (API version 7.18)
[   47.950000] usb 1-1.1: USB disconnect, device number 3
[   48.190000] usb 1-1.1: new high-speed USB device number 5 using ehci-platform
[   48.320000] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=14db
[   48.320000] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[   48.320000] usb 1-1.1: Product: HUAWEI HiLink
[   48.320000] usb 1-1.1: Manufacturer: HUAWEI
[   52.480000] cfg80211: Calling CRDA to update world regulatory domain
[   55.650000] cfg80211: Calling CRDA to update world regulatory domain
[   55.650000] cfg80211: World regulatory domain updated:
[   55.650000] cfg80211:  DFS Master region: unset
[   55.650000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   55.660000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   55.660000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   55.660000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   55.670000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   55.670000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   55.670000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[   55.750000] wlan0: authenticate with c4:04:15:05:27:59
[   55.750000] wlan0: send auth to c4:04:15:05:27:59 (try 1/3)
[   55.760000] wlan0: authenticated
[   55.790000] wlan0: associate with c4:04:15:05:27:59 (try 1/3)
[   55.790000] wlan0: RX AssocResp from c4:04:15:05:27:59 (capab=0x411 status=0 aid=3)
[   55.790000] wlan0: associated
[  151.880000] usb 1-1.1: USB disconnect, device number 5
[  289.850000] usb 1-1.1: new high-speed USB device number 6 using ehci-platform
[  289.980000] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=1f01
[  289.980000] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[  289.980000] usb 1-1.1: Product: HUAWEI HiLink
[  289.980000] usb 1-1.1: Manufacturer: HUAWEI
[  290.000000] scsi2 : usb-storage 1-1.1:1.0
[  290.380000] usb 1-1.1: USB disconnect, device number 6
[  291.900000] usb 1-1.1: new high-speed USB device number 7 using ehci-platform
[  292.030000] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=14db
[  292.030000] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[  292.030000] usb 1-1.1: Product: HUAWEI HiLink
[  292.030000] usb 1-1.1: Manufacturer: HUAWEI

federicofissore

It looks like modeswitch is active
Sep  7 19:34:32 Arduino user.notice usb-modeswitch: 1-1.1:1.0: Selecting /etc/usb_modeswitch.d/12d1:1f01 for mode switching

bartdereu

#18
Sep 08, 2014, 09:16 pm Last Edit: Sep 08, 2014, 09:19 pm by bartdereu Reason: 1
Indeed, but not able to set it to the correct id for switching

The only way i got it working was to disable the cdrom mode on my windows pc following these instructions :

http://mybroadband.co.za/vb/showthread.php/507680-Huawei-HiLink-modems-(E303-E3131-etc-)?p=10250878&viewfull=1#post10250878

now the device is correctly recognized,

new problem is a faulty 3G.chat script, every AT command works fine, only the last one to connect :

OK "ATD*99***1#"
or
OK "ATD*99#"

gives me ERROR.. hmm...

connect script :
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 10
"" "AT&F"
OK "ATE1"
OK 'AT+CGDCONT=1,"IP","internet.proximus.be"'
SAY "Calling UMTS/EDGE/GPRS"
TIMEOUT 30
OK "ATD*99***1#"
CONNECT ''

logread -f :
Code: [Select]
Sep  8 19:18:32 Arduino daemon.notice netifd: wan2 (25337): Trying to set mode
Sep  8 19:18:33 Arduino daemon.notice pppd[25371]: pppd 2.4.5 started by root, uid 0
Sep  8 19:18:34 Arduino local2.info chat[25375]: abort on (BUSY)
Sep  8 19:18:34 Arduino local2.info chat[25375]: abort on (NO CARRIER)
Sep  8 19:18:34 Arduino local2.info chat[25375]: abort on (ERROR)
Sep  8 19:18:34 Arduino local2.info chat[25375]: report (CONNECT)
Sep  8 19:18:34 Arduino local2.info chat[25375]: timeout set to 10 seconds
Sep  8 19:18:34 Arduino local2.info chat[25375]: send (AT&F^M)
Sep  8 19:18:34 Arduino local2.info chat[25375]: expect (OK)
Sep  8 19:18:34 Arduino local2.info chat[25375]: AT&F^M^M
Sep  8 19:18:34 Arduino local2.info chat[25375]: OK
Sep  8 19:18:34 Arduino local2.info chat[25375]:  -- got it
Sep  8 19:18:34 Arduino local2.info chat[25375]: send (ATE1^M)
Sep  8 19:18:34 Arduino local2.info chat[25375]: expect (OK)
Sep  8 19:18:34 Arduino local2.info chat[25375]: ^M
Sep  8 19:18:34 Arduino local2.info chat[25375]: ATE1^M^M
Sep  8 19:18:34 Arduino local2.info chat[25375]: OK
Sep  8 19:18:34 Arduino local2.info chat[25375]:  -- got it
Sep  8 19:18:34 Arduino local2.info chat[25375]: send (AT+CGDCONT=1,"IP","internet.proximus.be"^M)
Sep  8 19:18:34 Arduino local2.info chat[25375]: timeout set to 30 seconds
Sep  8 19:18:34 Arduino local2.info chat[25375]: expect (OK)
Sep  8 19:18:34 Arduino local2.info chat[25375]: ^M
Sep  8 19:18:34 Arduino local2.info chat[25375]: AT+CGDCONT=1,"IP","internet.proximus.be"^M^M
Sep  8 19:18:34 Arduino local2.info chat[25375]: OK
Sep  8 19:18:34 Arduino local2.info chat[25375]:  -- got it
Sep  8 19:18:34 Arduino local2.info chat[25375]: send (ATD*99***1#^M)
Sep  8 19:18:35 Arduino local2.info chat[25375]: expect (CONNECT)
Sep  8 19:18:35 Arduino local2.info chat[25375]: ^M
Sep  8 19:18:35 Arduino local2.info chat[25375]: ATD*99***1#^M^M
Sep  8 19:18:35 Arduino local2.info chat[25375]: ERROR
Sep  8 19:18:35 Arduino local2.info chat[25375]:  -- failed
Sep  8 19:18:35 Arduino local2.info chat[25375]: Failed (ERROR)
Sep  8 19:18:35 Arduino daemon.err pppd[25371]: Connect script failed
Sep  8 19:18:36 Arduino daemon.info pppd[25371]: Exit.

bartdereu

For everyone who has, like me, been struggling for ages to get the Huawei E303 to work on a
Yun, here's how i got it working : attach the dongle to the yun,

use lsusb to see normally this :

Bus 003 Device 008: ID 12d1:1f01 Huawei Technologies Co., Ltd.

root@Arduino:~#  /usr/bin/curl -k https://raw.githubusercontent.com/pictux/Yun_3g/master/linino_set3g.sh -o /tmp/linino_set3g.sh
root@Arduino:~# /bin/chmod +x /tmp/linino_set3g.sh
root@Arduino:~# /tmp/linino_set3g.sh -p <PINCODE> -a <PAN> -d /dev/ttyUSB0

every needed file is installed this way , and the network connection is set up.

Create a file /etc/usb_modeswitch.conf and edit with :

Code: [Select]
#Huawei E303
DefaultVendor = 0x12d1
DefaultProduct = 0x1f01


Edit the file /etc/usb_modeswitch.d/12d1:1f01  :

Code: [Select]

#Huawei E303
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
RargetProduct= 0x1f01
MessageEndPoint = "0x01"
MessageContent="55534243000000000000000000000011060000000000000000000000000000"
NoDriverLoading=1


Reboot the system. Check with lusb to see this :

Bus 001 Device 009: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

Your modem should be online if everything is configured ok (APN , PIN if needed etc..)

Hope i could help someone out with this information. I had been searching the net for over a week.



sonnyyu

#20
Sep 11, 2014, 05:10 pm Last Edit: Sep 11, 2014, 05:19 pm by sonnyyu Reason: 1
at "https://raw.githubusercontent.com/pictux/Yun_3g/master/linino_set3g.sh"

Code: [Select]
/usr/bin/curl -k https://raw.githubusercontent.com/pictux/Yun_3g/master/luci-proto-3g_svn-r9931-1_ar71xx.ipk -o /tmp/luci-proto-3g_svn-r9931-1_ar71xx.ipk


openwrtyun has that package, install it from openwrtyun is prefer. ( very important if openwrtyun got upgraded)  :

Code: [Select]
opkg update
opkg  remove luci-proto-3g
wget http://downloads.arduino.cc/openwrtyun/1/packages/luci-proto-3g_0.11%2Bsvn10522-1_ar71xx.ipk
opkg install luci-proto-3g_0.11+svn10522-1_ar71xx.ipk


federicofissore

@sonnyyu FYI I see you're using the wget trick for packages with "+" in the name: it has been fixed since version 1.2

sonnyyu


@sonnyyu FYI I see you're using the wget trick for packages with "+" in the name: it has been fixed since version 1.2


I knew I am still at version 1.1 , and will update once 1.5.0 is release.
but  for my understand the "+" problem is from ISP of "arduino.cc".  They should be able to fix it.

federicofissore

Indeed it's with the hosting service. We contacted them, they said the problem is with the file cluster tool they use ("ceph", for the record) and since ceph does not support that "+" they don't support that either.
So we fixed it

bartdereu


openwrtyun has that package, install it from openwrtyun is prefer. ( very important if openwrtyun got upgraded)  :


Is this package different, then ?

sonnyyu

at "https://raw.githubusercontent.com/pictux/Yun_3g/master/linino_set3g.sh"
Code: [Select]
/bin/opkg install unzip kmod-usb2 kmod-usb-core kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch usb-modeswitch-data libusb-1.0 comgt chat
wait


If you run it at Yun, then package  is from "http://downloads.arduino.cc/openwrtyun/",  the reason that script use https://raw.githubusercontent.com/ to install package luci-proto-3g is script wrote for  linino which does not have luci-proto-3g.
It will work when kernel version match but break once  not.

bartdereu

Ok thanx for this information. Very helpfull

bartdereu

Hi All,

i bought a dozen of the E303 Huawei dongles which i managed to get online in my
testversion. Now i see that the product ID is different then the dongle i had to test with

The first one had 12d1:1f01 , but the ones i have now use 12d1:1442 .

I tried to add that to the usb_modeswitch.d to switch it:

Code: [Select]
#Huawei E303
DefaultVendor= 0x12d1
DefaultProduct= 0x1442
TargetVendor= 0x12d1
RargetProduct= 0x1442
MessageEndPoint = "0x01"
MessageContent="55534243000000000000000000000011060000000000000000000000000000"
NoDriverLoading=1


also tried the defaultproduct and/or targetproduct to 1f01 , as it worked with the first dongle,
no luck; I keep gettings switching errors and when i do lsusb it shows the normal huawei device
and not the modem. grrrrr

is there ANY way to determine the correct settings for a good switch ? Information is very
poort about it.

thanx in advance !

Angelo9999

Did you try to run usb_modeswitch from the terminal with the correct parameters? http://linux.die.net/man/1/usb_modeswitch

bartdereu

Yes i did, apperently it's the messagecontent that needs to match the TargetVendor ID;

There's so little information about that to be found on the net.

Go Up