tesla-android / issue-tracker

Place for reporting issues and discussion with the community
18 stars 1 forks source link

2022.44.2 doesn’t recognize Alcatel IK41UC lte modem #114

Closed electricAntEater32 closed 1 year ago

electricAntEater32 commented 2 years ago

2022.44.2 doesn’t recognize Alcatel IK41UC lte modem. Car is in California, USA. Lte modem works fine on my windows machine. If this is hard to debug due to hardware being restricted to North America, I’m happy to help debug. Might need a few pointers / tips as my past was with Linux Os and this is my first Android OS experience.

MCFFHAB commented 1 year ago

@mikegapinski - thank you. My wild guess is that the newer version modem that I got has a newer firmware that has different defaults values that is creating the problem. Maybe the mbim patch you have could solve the problem since it will open another path to the modem. Until we can see and access this modem through the OS we wont be able to resolve it. If you could send me a version with the mbim patch I will be glad to test it to see if it works. Thank you again.

electricAntEater32 commented 1 year ago

@MCFFHAB Yes T-Mobile SIM in the Alcatel USB Modem plugged in to the Tesla Android Pi just shows the blinking blue light. Here is output of commands when t-mobile usa sim is in Alcatel IK41UC. dmesg: https://pastebin.com/x2Fbe83K logcat: https://pastebin.com/KJmvSM8b

rpi4:/ $ lsusb Bus 003 Device 001: ID 1d6b:0002 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 003: ID 1bbb:00b6 Bus 001 Device 002: ID 2109:3431 Bus 002 Device 001: ID 1d6b:0003

=================================

1|rpi4:/ # ifconfig -a lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr be:88:5a:2a:73:2b inet6 addr: fe80::bc88:5aff:fe2a:732b/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:630

eth0 Link encap:Ethernet HWaddr e4:5f:01:ad:b6:1f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip_vti0 Link encap:UNSPEC NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6_vti0 Link encap:UNSPEC NOARP MTU:1332 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6tnl0 Link encap:UNSPEC NOARP MTU:1452 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

wlan0 Link encap:Ethernet HWaddr e4:5f:01:ad:b6:20 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fead:b620/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1048

===================================

electricAntEater32 commented 1 year ago

Also found out that there are two version of the IK41UC - "1S41003" and "CF17300". Unfortunately my modem does not says what version it is on any of its labels. It seems that the difference is firmware. So I think we are getting closer to solving this mystery.

I opened up my modem and it says this inside, not sure if any of the info indicates a version number. Model IK41UC IK41UC-2AALNL1 02 043 2GF

On back of the pop off plastic lid it says: Model: IK41UC M2M

MCFFHAB commented 1 year ago

Your logs results are the same as mine. Pointing to the two versions of the same hardware. It seems that we were the unlucky ones to get the version that is different and not working (although there were other in the different forums that were also unlucky). If we get the mbim patch that could potentially open a path to access this version of the modem.

MCFFHAB commented 1 year ago

Also found out that there are two version of the IK41UC - "1S41003" and "CF17300". Unfortunately my modem does not says what version it is on any of its labels. It seems that the difference is firmware. So I think we are getting closer to solving this mystery.

I opened up my modem and it says this inside, not sure if any of the info indicates a version number. Model IK41UC IK41UC-2AALNL1 02 043 2GF

On back of the pop off plastic lid it says: Model: IK41UC M2M

Mine says the same thing but there is no mention to the version numbers I mentioned.

below is the link to the site that has the most information on this modem that I could find on the internet - it mention the two different versions and the use of the mbim to access this modem. It also has a number of other detail tech info.

https://techship.com/products/alcatel-ik41uc-lte-usb-dongle-na/

Here is the specific mbim reference:

https://techship.com/faq/integrating-the-alcatel-ik41-series-m2m-lte-cat4-usb-sticks-in-linux-using-mbim-usb-mode/

MCFFHAB commented 1 year ago

@mikegapinski if you can't put the cdc-mbim patch on the next release could you try to put the "Link Key Manager" app on the image? That could be another way to access the modem. Thank you.

electricAntEater32 commented 1 year ago

Here is a link which sold someone a North American Alcatel which has no issues. The description looks similar to what I saw when buying. However this one has one difference in description it says it can work internationally mine just said it was unlocked.. https://www.ebay.com/itm/274927072257?mkevt=1&mkcid=1&mkrid=711-53200-19255-0&campid=5338790295&toolid=10001&customid=

electricAntEater32 commented 1 year ago

I setup CentOs 7.2 using VirtualBox on my Mac. The Linux VM was aware of the usb device. VirtualBox listed Alcatel Mobilebroadband [1000] in the available USB devices. Vendor ID 1BBB , Product ID: 00B6 , Revision: 1000 . I'll try to use the modem when I return from picking up eldest child.

MCFFHAB commented 1 year ago

I setup CentOs 7.2 using VirtualBox on my Mac. The Linux VM was aware of the usb device. VirtualBox listed Alcatel Mobilebroadband [1000] in the available USB devices. Vendor ID 1BBB , Product ID: 00B6 , Revision: 1000 . I'll try to use the modem when I return from picking up eldest child.

Great test. So in both Linux CentOS and Ubuntu (which I tested) it works. In Ubuntu I had to set the APN. Did you had to set the APN on CentOS?

electricAntEater32 commented 1 year ago

I setup CentOs 7.2 using VirtualBox on my Mac. The Linux VM was aware of the usb device. VirtualBox listed Alcatel Mobilebroadband [1000] in the available USB devices. Vendor ID 1BBB , Product ID: 00B6 , Revision: 1000 . I'll try to use the modem when I return from picking up eldest child.

Great test. So in both Linux CentOS and Ubuntu (which I tested) it works. In Ubuntu I had to set the APN. Did you had to set the APN on CentOS?

@MCFFHAB , I could not get CentOs 7.2 to recognize the Alcatel. The various cli tools never listed the modem device. Virtual box listed the device and I clicked on it in the hopes CentOs would see it. I'm probably doing something incorrectly. I was following guides on tech ship about mbim and ModemManager.

Now I'm trying Ubuntu just for fun. I know you already had success with that OS.

MCFFHAB commented 1 year ago

Ok, I had somewhat of a progress. I was finally able to get to the modem "cdc_mbim" interface and changed it to the other support interface that is "rndis_host". The success part - the modem now will connect and stay with the blue light lit (no blinking) when using Tesla Android. The current problem - there is no internet connection.

@mikegapinski, how do I set Android to use the "rndis_host" interface "usb0" to get automatically an ip address and be able to be used by the Android Tesla. The instructions I had used linux commands "dhclient" to set the usb0 interface to have an internet address and access including other network commands that are not recognized by Android.

Thank you.

mikegapinski commented 1 year ago

How did you switch the interface type in to get rndis? usbmodeswitch? If it's shown as usb0 now the only thing I need to do is to change the kernel driver to show it as an ethX interface, this type is picked up by android by default. That is what I had to do in order to get other modems, and usb tethering to work.

Let me know how you switched the mode, I might have an idea already. After that I'll need output from lsusb and ifconfig from Android.

MCFFHAB commented 1 year ago

@mikegapinski I used Ubuntu and installed "minicom" to access the modem AT command interface then I used command "AT+USBMODE=1"

Here are the instructions I used: https://techship.com/faq/how-to-automated-always-on-connection-establishment-with-alcatel-ik41-series-lte-data-sticks-using-rndis-usb-mode/

Here is lsusb output: rpi4:/ # lsusb Bus 003 Device 001: ID 1d6b:0002 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 004: ID 1bbb:01aa Bus 001 Device 002: ID 2109:3431 Bus 002 Device 001: ID 1d6b:0003 Bus 001 Device 009: ID 1314:1521

Here is ifconfig -a output: rpi4:/ # ifconfig -a lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 7e:41:60:fc:68:22 inet6 addr: fe80::7c41:60ff:fefc:6822/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:560

eth0 Link encap:Ethernet HWaddr e4:5f:01:db:17:4f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip_vti0 Link encap:UNSPEC NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6_vti0 Link encap:UNSPEC NOARP MTU:1332 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6tnl0 Link encap:UNSPEC NOARP MTU:1452 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

usb0 Link encap:Ethernet HWaddr 7e:c8:d0:2b:e0:93 Driver rndis_host BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

wlan0 Link encap:Ethernet HWaddr e4:5f:01:db:17:50 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fedb:1750/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1048

mikegapinski commented 1 year ago

One suggestion: try switching the USB mode with usb-modeswitch, by doing this you should be able to get the modem to be detected by cdc_ether, rndis_host is a mess to work with.

The other modem I support in Tesla Android made by Huawei boots in rndis by default, but I switch it to other mode on system bootup.

Here you can find 2 sample configs for Alcatel modems: https://github.com/digidietze/usb-modeswitch-data/blob/master/usb_modeswitch.d/1bbb:f000 https://github.com/digidietze/usb-modeswitch-data/blob/master/usb_modeswitch.d/1bbb:f052

fire it up like this: usb_modeswitch -c /your/path/to/usb_modeswitch.conf

Config I use in Tesla Android: https://github.com/tesla-android/android-device-glodroid/blob/main/common/usb_modeswitch.conf

Replace everything after line 39 with the Alcatel specific ID's, if none of the two configs we can try setting it to the same device ID as my European modem.

BTW: Good job, I thing we are getting somewhere now

MCFFHAB commented 1 year ago

@mikegapinski , OK, will do. Where is "/your/path/to/" usb_modeswitch.conf on the Tesla Android - in other words what is the directory path for modeswitch.conf? Thank you.

mikegapinski commented 1 year ago

Just create the config file anywhere on the filesystem, the path is a parameter of the command.

In Tesla Android the config for Huawei is in /vendor/etc/usb_modeswitch.conf

You can also test your own .conf file directly in Tesla Android, not on ubuntu.

  1. Create the config file somewhere on your PC.
  2. adb push modeswitch.conf /sdcard
  3. adb root
  4. adb shell
  5. /vendor/bin/usb_modeswitch -c /sdcard/modeswitch.conf
  6. ifconfig
  7. logcat | grep modeswitch
MCFFHAB commented 1 year ago

Here what I got after the commands (usb0 is gone but no new eth with address):

rpi4:/sdcard # /vendor/bin/usb_modeswitch -c /sdcard/usb_modeswitch.conf Error: can't use storage command in MessageContent with interface 0; interface class is 224, expected 8. Abort 127|rpi4:/sdcard # ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 7e:41:60:fc:68:22 inet6 addr: fe80::7c41:60ff:fefc:6822/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:840

eth0 Link encap:Ethernet HWaddr e4:5f:01:db:17:4f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

wlan0 Link encap:Ethernet HWaddr e4:5f:01:db:17:50 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fedb:1750/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1048

rpi4:/sdcard # logcat | grep usb_modeswitch 01-01 00:00:05.323 0 0 I init : Parsing file /vendor/etc/init/usb_modeswitch.rc... 01-01 00:00:51.123 0 0 I init : processing action (sys.usb_modem_trigger=true) from (/vendor/etc/init/usb_modeswitch.rc:9) 01-01 00:00:51.123 0 0 I init : starting service 'usb_modeswitch'... 11-01 06:56:15.647 1199 1199 I usb_modeswitch: Look for target devices ... 11-01 06:56:15.648 1199 1199 I usb_modeswitch: No devices in target mode or class found 11-01 06:56:15.648 1199 1199 I usb_modeswitch: Look for default devices ... 11-01 06:56:15.648 1199 1199 I usb_modeswitch: No devices in default mode found. Nothing to do. Bye! 11-01 06:56:15.648 1199 1199 I usb_modeswitch: 01-01 00:00:51.200 0 0 I init : Service 'usb_modeswitch' (pid 1199) exited with status 0 oneshot service took 0.074000 seconds in background 01-01 00:00:51.200 0 0 I init : Sending signal 9 to service 'usb_modeswitch' (pid 1199) process group... 11-01 08:52:35.846 2034 2034 I usb_modeswitch: Look for target devices ... 11-01 08:52:35.847 2034 2034 I usb_modeswitch: No devices in target mode or class found 11-01 08:52:35.847 2034 2034 I usb_modeswitch: Look for default devices ... 11-01 08:52:35.848 2034 2034 I usb_modeswitch: Found devices in default mode (1) 11-01 08:52:35.848 2034 2034 I usb_modeswitch: Access device 004 on bus 001 11-01 08:52:35.848 2034 2034 I usb_modeswitch: Get the current device configuration ... 11-01 08:52:35.848 2034 2034 I usb_modeswitch: Current configuration number is 1 11-01 08:52:35.848 2034 2034 I usb_modeswitch: Use interface number 0 11-01 08:52:35.848 2034 2034 I usb_modeswitch: with class 224 11-01 08:53:26.801 2037 2037 I usb_modeswitch: Look for target devices ... 11-01 08:53:26.801 2037 2037 I usb_modeswitch: No devices in target mode or class found 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Look for default devices ... 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Found devices in default mode (1) 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Access device 004 on bus 001 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Get the current device configuration ... 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Current configuration number is 1 11-01 08:53:26.802 2037 2037 I usb_modeswitch: Use interface number 0 11-01 08:53:26.802 2037 2037 I usb_modeswitch: with class 224

mikegapinski commented 1 year ago

Hmm, this doesn't tell me much :/ Just to confirm, I got a little bit lost, you've seen the USB0 show up only in ubuntu, not in Tesla Android, right?

MCFFHAB commented 1 year ago

No, after I switch the modem from mbim to rndis in Ubumtu and I move the modem to Tesla Android it showed as rndis mode and showing usb0 - see my previous posts. You asked me to switch it in Tesla Android to usb_modeswitch which I did and reported on my last post. Once I created the usb_modeswitch config file and applied it in Tesla Android it returned the error above and it also removed usb0 from the ifconfig list.

mikegapinski commented 1 year ago

OK, thanks for the clarification.

I don't have any clues for now, there are 3 patches that I can include in the next versions that might move things forward:

  1. https://android-review.googlesource.com/c/device/linaro/hikey/+/479418
  2. Kernel driver change for mbim devices to show up as eth1 in Android
  3. Kernel driver change for rndis devices to show up as eth1 in Android

We'll get back to the issue when this gets released.

MCFFHAB commented 1 year ago

OK, I believe that if you include those it could resolved the problem. As a footnote, from the serial numbers and the firmware number of my modem I believe that my modem is newer (not older) than the ones that are currently working. So this problem with only become bigger as the old inventory is sold. I also believe I know why Alcatel changed the firmware and the way this modem works - I have been testing the speed of this modem in Ubuntu and Windows as we changed from mbim to rndis to usb_modeswitch and the download speed has been reduced every step. On its original state the modem had a 10 Mbps speed were I am located (I am not in a good spot for T-Mobile coverage) , it now dropped at the same location to 6 Mbps with the new modes - a 40% drop is significant. So I think Alcatel changed the mode to improve the speed. I read in some forums that there is speed impact depending in what mode you use this modem.

mikegapinski commented 1 year ago

Hmm,

Maybe we could reach out to Alcatel and ask them about this? Maybe they'll just give us an answer and we could either switch the modems into the mode that works or roll back the firmware to a working version? Could you drop them an email?

MCFFHAB commented 1 year ago

Will do

MCFFHAB commented 1 year ago

Sent the message to Alcatel.

By the way found this additional Alcatel technical document about the IK41:

key_41_software_integration_guide_v1.5.pdf

Given this Alcatel document which states that the modem comes default to "mbim" (all versions) - and - that there is only two operating modes "mbim" or "rndis". I am not even sure how this modem works in the Tesla Android out of the box? By all technical documentation this modem should not work out the box by default since you have not coded mbim nor even rndis in Tesla Android. Unless all other IK41s were previously set with usb_modeswitch before being used with the Tesla Android which does not sound logical?

mikegapinski commented 1 year ago

They worked out of the box with a standard Ethernet driver 😅 My European one does, has a management web panel etc. It was exactly the same for people in the US.

We will get it working, I am confident, it's just hard for me to move forward in a reasonable pace without having the hardware in hand.

Let's wait and see what the kernel patches change

mikegapinski commented 1 year ago

image

This looks interesting

MCFFHAB commented 1 year ago

They worked out of the box with a standard Ethernet driver 😅 My European one does, has a management web panel etc. It was exactly the same for people in the US.

We will get it working, I am confident, it's just hard for me to move forward in a reasonable pace without having the hardware in hand.

Let's wait and see what the kernel patches change

I know it works! 😅 There are many people out there that has it working including you. I am just baffled by the fact that per technical documentation it should not. This is like the aerodynamic theories that proved certain bugs could not fly but they do fly and fly well.

MCFFHAB commented 1 year ago

One suggestion: try switching the USB mode with usb-modeswitch, by doing this you should be able to get the modem to be detected by cdc_ether, rndis_host is a mess to work with.

The other modem I support in Tesla Android made by Huawei boots in rndis by default, but I switch it to other mode on system bootup.

Here you can find 2 sample configs for Alcatel modems: https://github.com/digidietze/usb-modeswitch-data/blob/master/usb_modeswitch.d/1bbb:f000 https://github.com/digidietze/usb-modeswitch-data/blob/master/usb_modeswitch.d/1bbb:f052

fire it up like this: usb_modeswitch -c /your/path/to/usb_modeswitch.conf

Config I use in Tesla Android: https://github.com/tesla-android/android-device-glodroid/blob/main/common/usb_modeswitch.conf

Replace everything after line 39 with the Alcatel specific ID's, if none of the two configs we can try setting it to the same device ID as my European modem.

BTW: Good job, I thing we are getting somewhere now

OK, was able to solve the problem with usb_modeswitch error. It has to be done during boot. I just replaced your usb_modeswitch.conf at /vendor/etc/ with my modified one and now there is no error message since your is done during boot.

The two config files you sent did not work. As you mentioned above can you send me your device ID and other settings for your European modem so I can put on the usb_modeswitch file to see if it works. Thank you.

mikegapinski commented 1 year ago

Three experimental patches are included in 2022.45.1(it'll be out this week): https://github.com/tesla-android/android-kernel-broadcom/commit/91af76e54b0f33faa95e66b3a527cfbfbbc3ea3a https://github.com/tesla-android/android-kernel-broadcom/commit/feec792cce47ddcefbdb8eef5f923db9fdb61bdf https://github.com/tesla-android/android-device-glodroid/commit/a5ef314c2ced401afef4e662450fd91ed5c31bc8

First two patches should convert mbim and rndis interfaces from usb0 to eth1 if they get detected. This should allow DHCP to kick in and get at least some movement in "ifconfig -a" command.

Do not pług in the modem before turning on the pi, do it just before grabbing logcat & dmesg output. Use pastebin.com to share the logs, pasting them here makes it hard for me to read. I will get back to you with European device IDs for mode switch right after I push 45.1, I am daily driving the Huawei modem in my case to test if it works without issues on 44.2.

MCFFHAB commented 1 year ago

Three experimental patches are included in 2022.45.1(it'll be out this week): tesla-android/android-kernel-broadcom@91af76e tesla-android/android-kernel-broadcom@feec792 tesla-android/android-device-glodroid@a5ef314

First two patches should convert mbim and rndis interfaces from usb0 to eth1 if they get detected. This should allow DHCP to kick in and get at least some movement in "ifconfig -a" command.

Do not pług in the modem before turning on the pi, do it just before grabbing logcat & dmesg output. Use pastebin.com to share the logs, pasting them here makes it hard for me to read. I will get back to you with European device IDs for mode switch right after I push 45.1, I am daily driving the Huawei modem in my case to test if it works without issues on 44.2.

OK, thank you

MCFFHAB commented 1 year ago

@mikegapinski So I have good news (not completely but to a large extent).

I friend of mine is also using Tesla Android and he bought a IK41UC that is working so I was able to compare both of them. First good news - we are not going crazy - although the product id is still IK41UC there are different sub models. As I mentioned before one of the tech sites pointed to the existence of two sub models. His IK41UC came from the vendor configured to work out of the box as rndis which is not manufacturer default. Mine came from the vendor configured out of the box to run mbim which is the the manufacturer default. Mine is recognized by Tesla Android OS when in rndis mode as product id 0x01aa (manufacturer default) his has a product id 0x0908 (which is not manufacturer default for this device). Last but not least, his firmware is newer than mine.

Also, my discussion with Alcatel is going nowhere fast. The first level support could not answer any questions. The second level support said that since the original model of the IK41 (IK41VE) was for the European market they adapted two models for the North America but they have issues. I am escalating to see if I can get specific questions answered. I am trying at least to get the latest firmware to see if this will solve the problem.

From all of this I believe that they put out a model in North America that was not working well with full auto configuration and then changed the configuration post technical documentation to work better.

In any case, with your additional patches for mbim and rndis, I believe will figure out has this different version works and be able to get it going with Tesla Android also.

mikegapinski commented 1 year ago

Can you try to use usb mode switch to switch it to 0908? It should work, theoretically speaking.

Keep me in the loop in terms of communication with Alcatel, I have my popcorn ready :)

MCFFHAB commented 1 year ago

Can you try to use usb mode switch to switch it to 0908? It should work, theoretically speaking.

Keep me in the loop in terms of communication with Alcatel, I have my popcorn ready :)

Sorry, forgot to mentioned yesterday - that is the first thing I tried after finding out the differences - I tried using 0x0908 as TargetProduct in both modes rndis and mbim. Unfortunately, it did not work.

I have not had this much fun trying to fix something since I last programmed assembly language. It sounds right since I am using AT commands to communicate with this modem which I last used around the same time. For those who watch it reminds me of the Godfather movie line - "Just when I thought I was out, they pull me back in!".

electricAntEater32 commented 1 year ago

It sounds right since I am using AT commands to communicate with this modem which I last used around the same time. For those who watch it reminds me of the Godfather movie line - "Just when I thought I was out, they pull me back in!".

I think I last used AT commands in the late 1980’s.💾 pfft. No 5” floppy disk & tape cassette emoji? 🤣

MCFFHAB commented 1 year ago

It sounds right since I am using AT commands to communicate with this modem which I last used around the same time. For those who watch it reminds me of the Godfather movie line - "Just when I thought I was out, they pull me back in!".

I think I last used AT commands in the late 1980’s.💾 pfft. No 5” floppy disk & tape cassette emoji? 🤣

Yes, for me was late 70s early 80s. Yes, I still kept some 5"'s for history sake but no tapes since they were just too bulky.

MCFFHAB commented 1 year ago

@mikegapinski - Update on Alcatel support.

They basically gave up. There is no deep knowledge on their support about this device. They did not even understood what mbim and rndis modes were. They kept saying the device is all automatic and it gets the best option to work. After escalating to all levels of the support center offered, I would have to go to the engineering team which they said they could not do. In reality this is not uncommon nowadays. The support centers only get scripts to answer questions and have very little technical knowledge about the devices which is understandable since there are so many devices they offer.

Bottom line - we are waiting for your next version of Tesla Android with the mbim and rndis patches to be out so we can test the new patches and move forward from there. Thank you.

MCFFHAB commented 1 year ago

@mikegapinski - no rush but just wondering when the next version is coming out. Thank you again for this great project.

mikegapinski commented 1 year ago

Got a little busy with work. All of the sources for the next release were up for some time already, just need to build and release.

BTW: there is something new in glodroid that might be useful for us(Modem Manager), I'll integrate this if my kernel patches wouldn't do anything

mikegapinski commented 1 year ago

@MCFFHAB pushed 45.1 today, let me know if anything changed in dmesg/logcat/ifconfig, someone mentioned on Twitter that it doesn't work out of the box :/

rrlevy commented 1 year ago

I just got the IK41UC recently to replace the E3372 that doesn’t work with LTE here in Brazil

It seems that it connects to the Internet and I can navigate on the browser on the Android system.

However, the problem I’m having is that the CAR doesn’t have any internet even though the Android system has it… weird…

Is that the known bug mentioned here or something else?

mikegapinski commented 1 year ago

did it work like this for you also on 2022.44.2? The issue we have here is that a certain revision of IK41UC is not detected at all

MCFFHAB commented 1 year ago

I have tested and it did not work on mbim mode but it does work on rndis mode. Great job on getting this working! This usb modem version comes out of the box in mbim mode, so unless you changed it to rndis it will not work. Changing to rndis mode is not ease and if you do not have the correct drivers it cannot be changed back to mbim mode and you are stuck on rndis mode. I found some drivers sometime ago that works with this modem and that is why I can connect to it after changing to rndis mode and revert it back to mbim mode.

In the meantime after investigating a number of sites and looking at the hardware/firmware interface of this modem I finally figured out why the differences:

The version that I and other bought that is not working out of the box is the "M2M" version - IoT version - this version has a different firmware that is target for the IoT market. We could not find the usb modem web page interface because it does not have one. The only way to configure this version is through AT commands as I was doing before. Interesting that all technical documentation that I found and shared on this modem was for this M2M version and there is no documentation on the normal commercial version. That is what through me off on the wrong path since I thought I was getting the documentation for the normal commercial version. I assume they do not publish documentation on the normal commercial version because it is for non-technical folks and there is no reason to publish technical documents on it. Also, Alcatel does a terrible job on this device marketing since they did not inform about the different versions - even on the web page of this device it says it also operates in M2M but it does not say it is a different version from the normal commercial version.

The folks selling this version on ebay/other stores either do not know what they are selling or know and are not telling people that this will only work if you know how to configure it and have software like you are doing that will capture the mode it operates on.

Question - do you want to try to get this version working out of the box on mbim mode or just inform the community about this issue and let it be? I am not sure if too many people will be able to change this version to rndis mode which means they will have to buy the correct version modem (if the seller is knowledgeable or honest or if the buyer is lucky to buy the correct version).

MCFFHAB commented 1 year ago

forgot to @mikegapinski for the post above.

mikegapinski commented 1 year ago

@MCFFHAB We'll get it to work in all 3 modes. We are almost there, rndis and cdc_ether work, not giving up now!

A few questions:

  1. Does the modem show up as eth1 in rndis?
  2. How can someone switch from mbim to rndis? The fact that you can't easily revert this change doesn't scare me, rndis is superior and works on macOS without issues. We might potentially publish a guide on how to change this mode or even automate it with an init script.
  3. Regarding mbim... Does it show up at all in ifconfig? Are there any traces of driver initialisation in the kernel logs when you plug in the device. It might be recognised but not initialised properly by the system. If that's the case there is something we could do about that :)
mikegapinski commented 1 year ago

If the interface is detected but not active it should show up in with ifconfig -a

MCFFHAB commented 1 year ago

@mikegapinski

  1. I am not home now. I did not checked all the of details as much as tried out with mbim and rndis modes to see if it worked out of the box in either case. Will check the details later today

  2. The only way to switch this usb modem is to connect a terminal software to its tty interface and get to the AT command interface. After that you submit the AT command to switch to rndis. It would probably be better to create a script to be executed since for someone to do it they would need some basic knowledge of AT commands.

  3. It showed before this latest version in mbim mode as wwan0 and the interface was down without ip address. I brough the interface up but still no ip address and it did not work, I dialed the modem manually to see if it got an ip address and no ip address it still did not work, and I used all of the several usb_modeswitch settings to no avail.

When I am back home I will see how the modem comes up in mbim mode with ipconfig -a and the other logs on this latest version.

MCFFHAB commented 1 year ago

Just as a reference here is the normal commercial version of the IK41UC "ifconfig -a" the modem is seen as cdc_ether in eth1 which works well:

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 3e:65:cf:61:fa:4b inet6 addr: fe80::3c65:cfff:fe61:fa4b/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:420

eth0 Link encap:Ethernet HWaddr e4:5f:01:db:17:4f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip_vti0 Link encap:UNSPEC NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6_vti0 Link encap:UNSPEC NOARP MTU:1332 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6tnl0 Link encap:UNSPEC NOARP MTU:1452 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

eth1 Link encap:Ethernet HWaddr ae:69:63:bc:9d:95 Driver cdc_ether inet addr:192.168.1.123 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: 2607:fb90:17d6:82c6:5d80:760a:2708:27df/64 Scope: Global inet6 addr: fe80::30e6:f122:de57:b778/64 Scope: Link inet6 addr: 2607:fb90:17d6:82c6:70b1:5b26:99b4:1f09/64 Scope: Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:659 errors:0 dropped:0 overruns:0 frame:0 TX packets:653 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:499250 TX bytes:204448

wlan0 Link encap:Ethernet HWaddr e4:5f:01:db:17:50 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fedb:1750/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1102

Here is the M2M (IoT) version the IK41UC "ifconfig -a" in rndis mode with the latest version of Tesla Android. In the previous Tesla Android version the modem was seen as rndis_host as usb0 which I believe your new patch caught it and reconfigured to rndis_host as eth1 - This is working now:

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 3e:65:cf:61:fa:4b inet6 addr: fe80::3c65:cfff:fe61:fa4b/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:560

eth0 Link encap:Ethernet HWaddr e4:5f:01:db:17:4f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip_vti0 Link encap:UNSPEC NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6_vti0 Link encap:UNSPEC NOARP MTU:1332 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6tnl0 Link encap:UNSPEC NOARP MTU:1452 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

wlan0 Link encap:Ethernet HWaddr e4:5f:01:db:17:50 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fedb:1750/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1102

eth1 Link encap:Ethernet HWaddr 4a:c5:4d:53:aa:8d Driver rndis_host inet addr:192.168.1.126 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::ac14:c74c:6acf:a5f6/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:87 errors:0 dropped:0 overruns:0 frame:0 TX packets:90 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11978 TX bytes:14406

Here is the M2M (IoT) version of the IK41UC "ifconfig -a" in mbim mode with the latest version of Tesla Android. In the previous Tesla Android version the modem was seen as cdc_mbim as wwan0 and it is still sees the IK41UC the same way on this latest version of Tesla Android. This is not working. Not sure if your mbim patch was looking for usb0 or wwan0?

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 3e:65:cf:61:fa:4b inet6 addr: fe80::3c65:cfff:fe61:fa4b/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:630

eth0 Link encap:Ethernet HWaddr e4:5f:01:db:17:4f Driver bcmgenet UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip_vti0 Link encap:UNSPEC NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6_vti0 Link encap:UNSPEC NOARP MTU:1332 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

ip6tnl0 Link encap:UNSPEC NOARP MTU:1452 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

wlan0 Link encap:Ethernet HWaddr e4:5f:01:db:17:50 Driver brcmfmac inet addr:9.9.0.1 Bcast:9.9.0.255 Mask:255.255.255.0 inet6 addr: fe80::e65f:1ff:fedb:1750/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:1102

wwan0 Link encap:Ethernet HWaddr 5e:eb:24:fe:5c:2a Driver cdc_mbim BROADCAST NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0

MCFFHAB commented 1 year ago

@mikegapinski posted the results of ifconfig -a of rndis and mbim modes on my previous post.

mikegapinski commented 1 year ago

Thanks for the logs, there might be some additional things for me to change in the kernel. I will keep you posted! I would rather try to make the modem show up as eth1, this way it will be initialised by android without any scripts to run by the user

mikegapinski commented 1 year ago

@MCFFHAB this should do the job: https://github.com/tesla-android/android-kernel-broadcom/commit/9f97d46505cf78103b371a50e9824318011a3b7a

rebuilding this as version 2022.45.2, I'll do a wider release if it will work for you