Activation Codes and Methods, Hardware Details, Sniffing
wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Mon May 20, 2019 12:18 am

LOM wrote:[It is ok but better if you move the modprobing so it comes before the echo, you can not use the new_id function or
the bind/unbind functions if the drivers are not loaded into memory.
Yeah I figured that out finally. when seeing in realtime how the system was reacting, that part of it "clicked"
LOM wrote:Well, we don't know for sure that the net interface should be driven by qmi_wwan, it was my guess based on
the interface types of the device.
I'm not tied to using it as an ethernet device. this was just more info. so long as I can use if for 4g data, I'm happy
LOM wrote:That means that the interface using the option driver does listen to AT cmds.
Wicked!
LOM wrote:This device has a wifi acess point, have you tried to connect to it wireless?
There is a built-in dhcp-server that will give you an ip address and a gateway address and there is probably a built in http server at the same address as the gateway.
If you open a browser to that address you will probably have a gui for configuration of the device. Is there any setting for enabling USB tethering?
yes, that part works well. Wi-fi isn;t a problem at all. tethering is automatic within windows, AFTER executing Switch.exe, which comes with the driver package and bloatware (which I didn;t install, I just manually pointed "device manager" at the driver files. device presents itself as a network adaptor with a small access-point o/s running on it.
I'm hoping to use the dongle in my future Van-Puter. I have found a beautiful usb soundcard in a charity shop for £10. I can use wifi but it isn;t elegant

LOM wrote:If we don't do any progress then you may have to install wireshark & co on your Windows computer and sniff the
USB communication when Windows switches the device and initializes it.
There could be other interface compositions in the devices firmware, activated by a different other switch message than what we have used.
sweet! I have just installed the subsystem for linux a few days ago
as it happens, I'd already starting trying hydra against the ssh password. I gave up immediate when I saw how long that would take :) I'll have a leaning curve to climb to do this wireshark route but it isn;t beyond me to learn (i've a;lready downloaded a couple of tools and am going to reboot into windows now.

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Mon May 20, 2019 9:00 am

wodgey wrote:
LOM wrote:Well, we don't know for sure that the net interface should be driven by qmi_wwan, it was my guess based on the interface types of the device.
I'm not tied to using it as an ethernet device. this was just more info. so long as I can use if for 4g data, I'm happy
You could try to see if it works as a ppp dial-up device, modeswitch the device and load the option driver via the new_id function. Skip the whole qmi driver binding/unbinding, let ModemManager probe the 2 serial devices and then go to NetworkManager and setup a ppp connection.
A dial-up ppp connection has a transfer limit of around 30Mbps on a modern computer.
wodgey wrote: yes, that part works well. Wi-fi isn;t a problem at all. tethering is automatic within windows, AFTER executing Switch.exe, which comes with the driver package and bloatware (which I didn;t install, I just manually pointed "device manager" at the driver files. device presents itself as a network adaptor with a small access-point o/s running on it.
I'm hoping to use the dongle in my future Van-Puter. I have found a beautiful usb soundcard in a charity shop for £10. I can use wifi but it isn;t elegant
Please attach the driver files here, only those with the .INF extension.

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Mon May 20, 2019 12:34 pm

LOM wrote:You could try to see if it works as a ppp dial-up device, modeswitch the device and load the option driver via the new_id function. Skip the whole qmi driver binding/unbinding, let ModemManager probe the 2 serial devices and then go to NetworkManager and setup a ppp connection.
A dial-up ppp connection has a transfer limit of around 30Mbps on a modern computer.
This didn;t see anything. I tried modprobing option too but modem manager didn't see anything :(
LOM wrote:Please attach the driver files here, only those with the .INF extension.
I also have a pcap file that I have sniffed from inside windows. Unsure how to decypher the at commands from this file though

I can only attch 3 at a time so I will post the 4th as code


Edit by LOM : I have removed the inline code and added as 4th attachment.
Attachments
mfwinusb.inf
(2.75 KiB) Downloaded 16 times
mfusbnet.inf
(4.55 KiB) Downloaded 25 times
mfserwv.inf
(7.34 KiB) Downloaded 21 times
mfmdmwv.inf
(46.28 KiB) Downloaded 26 times

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Mon May 20, 2019 1:55 pm

Well you don't need to test for a ppp dialup modem, there is none in the device.

The .inf file shows that interface #0 is a serial interface (%QcomDeviceAT%) and that
interface #1 is a qmi network interface (%qcwwan.DeviceDesc%) so the way you assigned drivers
is correct.

Please do the whole procedure one more time and confirm with the usb-devices command that you
have option as driver for interface #0 and qmi_wwan as driver for interface #1 and that your qmi character device
cdc_wdm0 is present.

Do not run ModemManager yet, just use qmicli :

sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v

I don't understand why that command didn't work for you before... :?

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Mon May 20, 2019 8:04 pm

LOM wrote:Well you don't need to test for a ppp dialup modem, there is none in the device.

The .inf file shows that interface #0 is a serial interface (%QcomDeviceAT%) and that
interface #1 is a qmi network interface (%qcwwan.DeviceDesc%) so the way you assigned drivers
is correct.

Please do the whole procedure one more time and confirm with the usb-devices command that you
have option as driver for interface #0 and qmi_wwan as driver for interface #1 and that your qmi character device
cdc_wdm0 is present.

Do not run ModemManager yet, just use qmicli :
LOM wrote:sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v
this command doesn;t work.

Code: Select all

roger@novo:~$ sudo qmicli --get-service-version-info -d /dev/qmi-wwan -p - v
error: couldn't create QmiDevice: Couldn't query file info: Error when getting information for file “/dev/qmi-wwan”: No such file or directory
roger@novo:~$ 
LOM wrote:I don't understand why that command didn't work for you before... :?
[/quote]
nor me. I've performed a "apt update && apt upgrade -y" and modem-manager-gui now forcibly closes a few seconds after openign. HOWEVER, I can see from the network icon in the system tray that I have an active connection to EE network (although ifconfig doesn;t show the interface and I am unable to ping the 192.168.x.y IP address that the wedmin gui resides upon under windows
I did notice when poking the strings into new_id and unbind, that the spawned processes that thrash my cpu core, didn;t actually spawn
usb-devices

Code: Select all

T:  Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=161c ProdID=f101 Rev=02.32
S:  Manufacturer=manufacturer
S:  Product=LTE MIFI
S:  SerialNumber=0123456789
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option



wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Mon May 20, 2019 8:14 pm

LOM wrote:Please do the whole procedure one more time
Here's my history for the order of commands entered






1733 sudo usb_modeswitch -v 161c -p f010 -W -M 5534243123456780000000000000606f50402527000000000000000000000
1734 sudo modprobe option
1735 sudo modprobe qmi_wwan
1736 sudo modprobe cdc_wdm
1737 echo "161c f101" | sudo tee -a /sys/bus/usb-serial/drivers/option1/new_id
1738 echo "161c f101" | sudo tee -a /sys/bus/usb/drivers/qmi_wwan/new_id
1739 echo "3-1:1.1" | sudo tee -a /sys/bus/usb/drivers/option/unbind
1740 echo "3-1:1.0" | sudo tee -a /sys/bus/usb/drivers/qmi_wwan/unbind
1741 usb-devices
1742 sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Tue May 21, 2019 1:47 am

wodgey wrote:
LOM wrote:sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v
this command doesn;t work.

Code: Select all

roger@novo:~$ sudo qmicli --get-service-version-info -d /dev/qmi-wwan -p - v
error: couldn't create QmiDevice: Couldn't query file info: Error when getting information for file “/dev/qmi-wwan”: No such file or directory
roger@novo:~$ 
Doesn't work because /dev/qmi-wwan is not a linux kernel device, wwan0 is the qmi ethernet data device but you must use the qmi command device, ie /dev/cdc-wdm0 as I showed you.

wodgey wrote: T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 5 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=161c ProdID=f101 Rev=02.32
S: Manufacturer=manufacturer
S: Product=LTE MIFI
S: SerialNumber=0123456789
C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
No, this is wrong. Interface #1 should show qmi_wwan as driver, not option.
(I've edited your post to remove the output of usb-devices for all devices except this one)


wodgey wrote:
LOM wrote:Please do the whole procedure one more time
Here's my history for the order of commands entered


1733 sudo usb_modeswitch -v 161c -p f010 -W -M 5534243123456780000000000000606f50402527000000000000000000000
1734 sudo modprobe option
1735 sudo modprobe qmi_wwan
1736 sudo modprobe cdc_wdm
1737 echo "161c f101" | sudo tee -a /sys/bus/usb-serial/drivers/option1/new_id
1738 echo "161c f101" | sudo tee -a /sys/bus/usb/drivers/qmi_wwan/new_id
1739 echo "3-1:1.1" | sudo tee -a /sys/bus/usb/drivers/option/unbind
1740 echo "3-1:1.0" | sudo tee -a /sys/bus/usb/drivers/qmi_wwan/unbind
1741 usb-devices
1742 sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v

In 1737 option driver will grab both interfaces so 1738 will not work, no free interface for qmi_wwan to bind to.
You must do the 1739 unbind before doing 1738.
1740 is not needed, 3-1:1.0 (interface #0) is taken by option so qmi_wwan could not have grabbed it.
Therefore no need to try to unbind qmi_wwan from it.

Furthermore and most important, usb-devices shows the MIFI dongle on usb bus 2, you have moved it to another usb connector!!
"3-1:1.0" is a fixed usb path/position so either move the device back to where it was connected in the first place or check your dmesg after doing 1737, it will show the current path to the dongle, then adjust the cmd in 1739.

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Tue May 21, 2019 9:12 am

LOM wrote: Doesn't work because /dev/qmi-wwan is not a linux kernel device, wwan0 is the qmi ethernet data device but you must use the qmi command device, ie /dev/cdc-wdm0 as I showed you.
Oh, I am not sure how that happened. I must have cut/paste from the wrong place. I'll reboot and try again. with the unbinds before the binding

LOM wrote:No, this is wrong. Interface #1 should show qmi_wwan as driver, not option.

In 1737 option driver will grab both interfaces so 1738 will not work, no free interface for qmi_wwan to bind to.
You must do the 1739 unbind before doing 1738.
1740 is not needed, 3-1:1.0 (interface #0) is taken by option so qmi_wwan could not have grabbed it.
Therefore no need to try to unbind qmi_wwan from it.

Furthermore and most important, usb-devices shows the MIFI dongle on usb bus 2, you have moved it to another usb connector!!
"3-1:1.0" is a fixed usb path/position so either move the device back to where it was connected in the first place or check your dmesg after doing 1737, it will show the current path to the dongle, then adjust the cmd in 1739.
I've been careful to connect to the same slot because I noticed that the 3-1.1:0 changed depending on which socket I was connecting to. I unplugged before going to bed though but it is possible I made a mistake and plugged into different socket. it is interesting that I made progress with usb bus 2



EDIT2ADD

After running usb-devices again I noticed the driver section that you indicated was showing "optioon" for both interfaces. After re-echo-ing the unbind/bind commands it changed to 0:option and 1:qmi_wwan.

When entering the correct qmicli command, it once again causes the process qmi-proxy to spawn and thrash cpu at 100%

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Tue May 21, 2019 10:24 am

wodgey wrote: I've been careful to connect to the same slot because I noticed that the 3-1.1:0 changed depending on which socket I was connecting to. I unplugged before going to bed though but it is possible I made a mistake and plugged into different socket. it is interesting that I made progress with usb bus 2
One of the most common programmer errors is the off-by-one error, could be that the usb buses (which in Linux kernel starts at 1) starts at 0 in the usb-devices cmd. 8)
wodgey wrote: EDIT2ADD

After running usb-devices again I noticed the driver section that you indicated was showing "optioon" for both interfaces. After re-echo-ing the unbind/bind commands it changed to 0:option and 1:qmi_wwan.

When entering the correct qmicli command, it once again causes the process qmi-proxy to spawn and thrash cpu at 100%
Well everything seems correct now but it doesn't work..
What kind of IP address do you get when you are USB tethering the MIFI in Windows, a public IP or a private?
Does the wifi work when you USB tether to Windows?
Are wifi connected computers and USB tethered Windows in the same subnet, ie are they both behind NAT?

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Tue May 21, 2019 10:50 am

LOM wrote: Well everything seems correct now but it doesn't work..
What kind of IP address do you get when you are USB tethering the MIFI in Windows, a public IP or a private?
Does the wifi work when you USB tether to Windows?
Are wifi connected computers and USB tethered Windows in the same subnet, ie are they both behind NAT?
it's private, when connecting to the WiFi access point AND via the ethernet driver in windows. I've used it via wifi for linux and via direct connection via windows. It shipped with 192.168.0.1 (or maybe 192.168.1.1, I can;t remember) IP address which I immediately changed to 192.168.20.1 so as not to conflict with other subnets I use.

edit2add
yes, it comes with a router o/s onboard, with NAT/port-forwarding features as well as LAN IP filtering. I couldn;t see any kind of MAC white/blacklisting for the wifi access point though but only looked quickly.

I'll hunt out a USB drive and flash a live-distro onto it and test again with this laptop and also my desktop

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Tue May 21, 2019 11:37 am

I've asked a specialist to join the thread, he may have some idea of why qmiproxy eat cpu cycles. Hold the line!

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Tue May 21, 2019 12:07 pm

LOM wrote:sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v

Code: Select all

roger@novo:~$ sudo qmicli --get-service-version-info -d /dev/cdc-wdm0 -p - v
error: couldn't get service version info: Transaction timed out
roger@novo:~$ top
:(

I'll keep my fingers crossed for your specialist. Thanks for getting me this far. I;ve learned a lot from you already

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Tue May 21, 2019 2:18 pm

Expert is busy but he gave me some hints for test.

Does the qmicli cmd still stall if you remove the -p (proxy) switch?

If ModemManager is running then it might have invoked qmiproxy, make sure that MM is not running.
You can probably see if qmiproxy is running by checking with the ps cmd.

wodgey
Posts: 26
Joined: Thu May 16, 2019 8:14 am

Re: "LTE MIFI" won't switch modes

Post by wodgey » Tue May 21, 2019 3:04 pm

LOM wrote:Expert is busy but he gave me some hints for test.

Does the qmicli cmd still stall if you remove the -p (proxy) switch?

If ModemManager is running then it might have invoked qmiproxy, make sure that MM is not running.
You can probably see if qmiproxy is running by checking with the ps cmd.
without the -p it doesn;t timeout. It just hangs until I kill the process.

Should there be a space between the "- v" at the end?

edit2add
I've just removed the eroneous space and now I get this

(I noticed that there was no cdc-wdm0 but there was a cdc-wdm1)

Code: Select all

roger@novo:/dev$ sudo qmicli --get-service-version-info -d /dev/cdc-wdm1 -v
[21 May 2019, 14:03:48] [Debug] [/dev/cdc-wdm1] Opening device with flags 'auto'...
[21 May 2019, 14:03:48] [Debug] [/dev/cdc-wdm1] loaded driver of cdc-wdm port: qmi_wwan
[21 May 2019, 14:03:48] [Debug] [/dev/cdc-wdm1] automatically selecting QMI mode
[21 May 2019, 14:03:48] [Debug] QMI Device at '/dev/cdc-wdm1' ready
[21 May 2019, 14:03:48] [Debug] Getting service version info...
[21 May 2019, 14:03:48] [Debug] [/dev/cdc-wdm1] sent message...
<<<<<< RAW:
<<<<<<   length = 12
<<<<<<   data   = 01:0B:00:00:00:00:00:01:21:00:00:00

[21 May 2019, 14:03:48] [Debug] [/dev/cdc-wdm1] sent generic request (translated)...
<<<<<< QMUX:
<<<<<<   length  = 11
<<<<<<   flags   = 0x00
<<<<<<   service = "ctl"
<<<<<<   client  = 0
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 0
<<<<<<   message     = "Get Version Info" (0x0021)



LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: "LTE MIFI" won't switch modes

Post by LOM » Tue May 21, 2019 3:57 pm

That seems to work but the reply seems to be missing..

Some more cmds to test and a guide for setting up a connection manually:

https://techship.com/faq/how-to-set-up- ... -in-linux/

Post Reply