Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Sat Jul 06, 2019 8:03 pm

Hi everyone !
First post on this forum, thanks for all the work put up here :)
I've been trying to figure this out by myself scrolling through the forum and the web but this seems a bit above my abilities. Would someone be so kind as trying to help me out with the intelligent steps to troubleshoot this ?

I cannot get my Crosscall Spider X5 (3G bartype phone), which uses a Mediatek MT6276 chipset, to be detected as a USB modem.
lsusb returns vendor id 08ed and product id 000a
I run Lubuntu Xenial (16.04) which includes usb modeswitch 2.2.5. I have no possible internet access on Linux but I do have it on my dual booted windows 10.

There seems to be a very similar product (MT6276M) in the device_reference.txt file but still it isn't the same product id

########################################################
# MediaTek MT6276M
#
# Contributor: Meng Zhang

DefaultVendor= 0x0e8d
DefaultProduct=0x0002

TargetVendor= 0x0e8d
TargetProductList="00a1,00a2"

MessageContent="555342431234567800000000000006f0010300000000000000000000000000"
#########################################################

Many thanks in advance !

Georges

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Sun Jul 07, 2019 2:18 am

The switch message from Meng Zhang (Mediatek) was intended for modems, not for phones with display and keyboards which usually are switched by selecting a different USB mode in the phones settings menu.
USB Tether or USB Camera/Photo are examples of such modes.

I'd guess that 0e8d:000a is storage mode where you can access part of the phones file system but please run lsusb -v -d 0e8d:000a when phone is connected to your linux computer and then paste that output here for confirmation.

btw, are you sure that this simple cheap phone supports USB Tethering? What does your owners manual say about it?

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Sun Jul 07, 2019 11:07 pm

Hi there ! Thanks for your help !

Here are the results :
https://pastebin.ubuntu.com/p/qpsJ4qjQpZ/

Yes the phone does support USB tethering, I'm using it right now on my windows partition to reply this thread :) It still costs a 100€ ^^ (it's fully water proof, dust proof and shock resistant, it's made for construction/farm/outdoor workers). A screen does prompt you to select charge, storage or usb tethering when plugging the phone to the computer. All 3 options work just fine on windows, and on linux all work fine except the usb tethering option.

I'll retype lsusb right now when choosing the storage mode to see if the device is detected with a different ID.

EDIT : hmmmm interesting enough, when choosing the data storage mode from the phone, the device is detected with vendor/product id 0e8d:0002 ... exactly the same as in Meng Zhang's post !

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Mon Jul 08, 2019 2:05 am

georgieboy wrote: EDIT : hmmmm interesting enough, when choosing the data storage mode from the phone, the device is detected with vendor/product id 0e8d:0002 ... exactly the same as in Meng Zhang's post !
That is a common Mediatek id which they have used for many different kinds of products but the behavior by the firmware behind scene is different between them.
The storage mode in a phone gives you access to part of the phones file system while the storage mode in a modem gives you access to the virtual cd-rom containing Windows drivers and connection manager which gets installed the first time you connect the modem to a Win computer. Those are of no use for linux so we mode switch the device as soon as it is detected.
We don't want to mode switch a phone as soon as it is usb connected, most likely there isn't phone firmware support for it but if there is then that would prevent access to the phones storage. Instead the user has to do the mode switching via the phones setting menu as you have done.

Your lsusb paste shows a network interface (Microsoft RNDIS) which a Win computer will pick up and use without user involvement or driver loading while it in a linux computer needs the rndis_host driver which will bind to the device.
Your dmesg should show that binding, check that it does and at the same time check what kind of linux network device the driver created, it is likely to be usb0.

You'll probably have to bring up that net device manually with:

ip link set usb0 up (or maybe ifconfig usb0 up)

and pull an ip address from it with:

dhclient usb0

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Wed Jul 10, 2019 12:51 pm

Hi ! Thank you for your continued help and all these explanations :idea: Sorry I haven been able to work on this issue for a couple days.

I have a problem though :

Code: Select all

root@georges-HP-240-G6-Notebook-PC:/home/georges# ip link set usb0 up
Cannot find device "usb0"
This is the result of udevadm monitor when plugging in the phone and selecting tethering

Code: Select all

root@georges-HP-240-G6-Notebook-PC:/home/georges# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[7114.770612] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4 (usb)
KERNEL[7114.773748] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4/1-4:1.0 (usb)
KERNEL[7114.774951] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4/1-4:1.1 (usb)
UDEV  [7114.780175] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4 (usb)
UDEV  [7114.786497] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4/1-4:1.0 (usb)
UDEV  [7114.788380] add      /devices/pci0000:00/0000:00:15.0/usb1/1-4/1-4:1.1 (usb)
I thought the device should be usb1 then but that didń't work either

Code: Select all

root@georges-HP-240-G6-Notebook-PC:/home/georges# ip link set usb1 up
Cannot find device "usb1"
Any ideas ?

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Wed Jul 10, 2019 2:48 pm

georgieboy wrote:
Any ideas ?
Check your system log (dmesg) after you connect the phone, it will show the phone appearing on the usb bus and should immediately after that show the rndis_host driver attaching.
When the driver attaches then it will display the created net device like this:

[14972.710663] usb0: register 'rndis_host' at usb-0000:00:14.0-2, RNDIS device, 02:04:67:3f:31:35

or

[343.427025] eth1: register 'rndis_host' at usb-0000:00:1d.0-2, RNDIS device, 80:00:60:0f:e8:00

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Wed Jul 10, 2019 7:01 pm

Thanks ! ... but it did not work as you expected.

The reslut from dmesg had no mention of rndis_host after plugging in the phone, only a couple of lines mentioning the detected usb device with the vendor/device id, manufacturer etc.

Code: Select all

georges@georges-HP-240-G6-Notebook-PC:~$ dmesg | grep rndis
georges@georges-HP-240-G6-Notebook-PC:~$ 

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Thu Jul 11, 2019 3:12 am

georgieboy wrote:Thanks ! ... but it did not work as you expected.
Then either the rndis driver is not loaded or it is not present at all in your system.

Run the cmd:

modprobe rndis_host

followed by:

lsmod

if it doesn't show then you've not got it and have to search Lubuntu resources to find out how/where to get it.
rndis_host is dependent on usbnet and on cdc_ether so you'll need those drivers as well.

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Sun Sep 08, 2019 1:28 pm

Hi ! I know it's been a while since I last replied but I've been hella busy and just survived on windows for the summer. Sorry for not keeping in touch :) I tried what you suggested last, with no success alas.

[/quote]

Then either the rndis driver is not loaded or it is not present at all in your system.

Run the cmd:

modprobe rndis_host

followed by:

lsmod
[/quote]

I found all 3 drivers in the results, although rndis_host is shown as used by no other drivers, I don't know if that's a clue.

rndis_host 16384 0
cdc_ether 16384 1 rndis_host
usbnet 45056 2 rndis_host,cdc_ether

If you wish to see the complete list it's here :
https://pastebin.ubuntu.com/p/pYXmvCtS7z/

Thanks again for posting any further troubleshooting steps :)

EDIT : I thought it'd also be useful to post the exact results of dmesg when plugging in and selecting USB tethering from the phone. There they are
https://pastebin.ubuntu.com/p/rNTB4QJ28H/

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Sun Sep 08, 2019 3:35 pm

Your dmesg shows the problem:

[ 355.960428] usb 1-4: bad CDC descriptors


Your lsusb prog is quite old, it can't decode the CDC descriptors - later versions displays those ** UNRECOGNIZED:
as strings but I've checked the byte values which follows and I can't for my life find anything wrong with them.
I start to suspect that this is a specific kernel bug so:

What is your linux kernel version? (uname -a)
Is there any kernel version upgrade you can apply for testing?


Edit: There is a problem with the CDC descriptors, there is one whichi s not allowed in an rndis interface.
The cdc_ether driver which is the master driver for rndis_host does a check of the descriptors and if there is a certain cdc_acm descriptor present (something that does not belong in an rndis device) then the bad CDC descriptors message is printed and the driver binding is cancelled.
Linux is unnecessarily strict when it comes to checking these descriptors, Windows is not so there it works.
The primary responsibility though for this problem lies with Mediatek who has added descriptors for another type of device.

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Thu Sep 12, 2019 6:31 pm

LOM wrote:Your dmesg shows the problem:
Edit: There is a problem with the CDC descriptors, there is one whichi s not allowed in an rndis interface.
The cdc_ether driver which is the master driver for rndis_host does a check of the descriptors and if there is a certain cdc_acm descriptor present (something that does not belong in an rndis device) then the bad CDC descriptors message is printed and the driver binding is cancelled.
Linux is unnecessarily strict when it comes to checking these descriptors, Windows is not so there it works.
The primary responsibility though for this problem lies with Mediatek who has added descriptors for another type of device.
Hi, thanks for the reply and for clearing things up !
So I guess this means there is no way I am going to get that device to work as an usb modem in any Linux distro, right ?

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

Re: Mediatek MT6276 08ed:000a cannot switch

Post by LOM » Thu Sep 12, 2019 11:01 pm

georgieboy wrote:
Hi, thanks for the reply and for clearing things up !
So I guess this means there is no way I am going to get that device to work as an usb modem in any Linux distro, right ?
Bjorn Mork has been so kind to send in a patch to fix the problem so you will be able to tether your phone some time in the future. How long time that will take depends on how quick the Ubuntu/Lubuntu distro maintainers are to get the fix included after which you will have to update your linux kernel.


https://patchwork.kernel.org/patch/11142579/

georgieboy
Posts: 7
Joined: Sat Jul 06, 2019 7:51 pm

Re: Mediatek MT6276 08ed:000a cannot switch

Post by georgieboy » Sun Sep 22, 2019 1:03 pm

Great to hear that, thanks for the heads up and sorry again for the not-so-timely answers!

Post Reply