Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 08 Dec 2025, 23:23

Hi guys,

I’m new to this forum and read de main doc page and tried things out, mentioned there, except for all the kernel-related issues, that's to much abracadabra to me.

I can’t get a TZE MF79N USB dongle to work with a RPI Zero V1.3 with Bookworm installed (same issue on a RPI5 with Trixie installed). But it works on a RPI Zero 2 W, how come? See also my post on https://forums.raspberrypi.com/viewtopi ... 7#p2352157
I want to have the dongle switched so I can access the SD-card and the eth-connection is present and use a RPI Zero V1.3 for its low power consumption in my setup.

So I hope someone has a solution to my problem.

Basically the dongle works on RPI Zero 2W with Bookworm and usb_modeswitch version 2.6.1-3+b1. Even warm reboot or cold restart keeps the modem switching.
When I move the same SD-card with Bookworm installed to a Raspberry Zero V1.3, it won’t switch.
Then plugging the dongle in a RPI5 with a fresh Trixie installed and usb_switchmode v 2.6.1-4+b1, I get it to work once when I changed usb_modeswitch.conf with the parameters from ZTE MF190 (targetProduct 1405 instead of 0082) from the device_reference.txt, but after reboot, hot or cold, no switching. On another RPI5 also with fresh Trixie totally no switching happened, not even after changing the usb_modeswitch.conf or adding 41-modeswitch.rules to the appropriate directories.

I have put output of many commands in code-fields, so it won't make the post to long

dsmeg-output when not switching:

Code: Select all

[ 1406.810987] usb 1-2: new high-speed USB device number 5 using xhci-hcd
[ 1406.950497] usb 1-2: New USB device found, idVendor=19d2, idProduct=1225, bcdDevice=ff.ff
[ 1406.950505] usb 1-2: New USB device strings: Mfr=2, Product=4, SerialNumber=5
[ 1406.950509] usb 1-2: Product: ZTE Mobile Broadband
[ 1406.950512] usb 1-2: Manufacturer: ZTE,Incorporated
[ 1406.950514] usb 1-2: SerialNumber: 123456789ABCDEF
[ 1411.158502] usb 1-2: can't set config #1, error -71
[ 1411.161722] usb 1-2: USB disconnect, device number 5
[ 1411.715091] usb 1-2: new high-speed USB device number 6 using xhci-hcd
[ 1411.854511] usb 1-2: New USB device found, idVendor=19d2, idProduct=1225, bcdDevice=ff.ff
[ 1411.854520] usb 1-2: New USB device strings: Mfr=2, Product=4, SerialNumber=5
[ 1411.854524] usb 1-2: Product: ZTE Mobile Broadband
[ 1411.854527] usb 1-2: Manufacturer: ZTE,Incorporated
[ 1411.854530] usb 1-2: SerialNumber: 123456789ABCDEF
[ 1417.043389] usb 1-2: can't set config #1, error -110
usb_modeswitch.conf

Code: Select all

# Configuration for the usb_modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
#
# Evaluated by the wrapper script /usr/sbin/usb_modeswitch_dispatcher
#
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"


# Disable automatic mode switching globally (e.g. to access the original
# install storage)

DisableSwitching=1

# Disable check for MBIM module presence and configuration globally (to aid
# special embedded environments). Available as per-device parameter
# 'NoMBIMCheck'

DisableMBIMGlobal=0

# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_<interface-name>" and probably others

EnableLogging=1

# Optional increase of "delay_use" for the usb-storage driver; there are hints
# that a recent kernel default change to 1 sec. may lead to problems, particu-
# larly with USB 3.0 ports. Set this to at least 3 (seconds) in that case.
# Does nothing if the current system value is same or higher

#SetStorageDelay=4

# If the configuration for your Huawei modem uses the standard switching method,
# you can globally set an alternative method here which provides a different mode:
# either plain serial PPP (for older modems) or NCM which integrates nicely
# with recent Linux distributions, possibly avoiding configuration through a
# modem built-in web page. All other modems are not affected.
# Available as per-device parameter 'AltHuaweiMode'

#HuaweiAltModeGlobal=0

DefaultVendor=0x19d2
DefaultProduct=0x1225

TargetVendor=0x19d2
TargetProduct=0x1405

MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"

NeedResponse=1

usb_modeswitch.log:

Code: Select all

USB_ModeSwitch log from Mon Dec 01 21:53:09 CET 2025
Raw parameters: {--switch-mode} {1-2} 
Use global config file: /etc/usb_modeswitch.conf

Use global config file: /etc/usb_modeswitch.conf
Use top device dir /sys/bus/usb/devices/1-2
Check class of first interface ...
 No access to first interface. Exit
when starting usb_modeswitch manually:
sudo usb_modeswitch -v 0x19d2 -p 0x1225 -W

Code: Select all

Take all parameters from the command line

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x19d2
DefaultProduct= 0x1225

Look for default devices ...
  found USB ID 1d6b:0003
  found USB ID 0b95:6801
  found USB ID 0b95:6804
  found USB ID 046d:c52b
  found USB ID 2109:2817
  found USB ID 2109:2817
  found USB ID 1d6b:0002
  found USB ID 1d6b:0003
  found USB ID 19d2:1225
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
 Found devices in default mode (1)
Access device 008 on bus 001
Get the current device configuration ...
libusb: error [op_get_active_config_descriptor] device unconfigured
 Determining the active configuration failed (error -5). Abort

lsusb -v output before switching (on RPI Zero 2W with working switching):
sudo lsusb -v -d 19d2:1225

Code: Select all

Bus 001 Device 004: ID 19d2:1225 ZTE WCDMA Technologies MSM ZTE Mobile Broadband
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x19d2 ZTE WCDMA Technologies MSM
  idProduct          0x1225 
  bcdDevice           ff.ff
  iManufacturer           2 ZTE,Incorporated
  iProduct                4 ZTE Mobile Broadband
  iSerial                 5 123456789ABCDEF
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 ZTE Configuration
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              1 Mass Storage
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

lsusb output after switching (on RPI Zero 2W with working switching):
sudo lsusb -v -d 19d2:1405

Code: Select all

Bus 001 Device 020: ID 19d2:1405 ZTE WCDMA Technologies MSM ZTE Mobile Broadband
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x19d2 ZTE WCDMA Technologies MSM
  idProduct          0x1405 
  bcdDevice           ff.ff
  iManufacturer           2 ZTE,Incorporated
  iProduct                4 ZTE Mobile Broadband
  iSerial                 5 123456789ABCDEF
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x006f
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          3 ZTE Configuration
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       6 Ethernet Networking
      bFunctionProtocol       0 
      iFunction               8 CDC ECM
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0 
      iInterface              6 CDC Ethernet Control Model (ECM)
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      9 344B50000000
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               9
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              7 CDC Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              1 Mass Storage
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered
I hope there is a clue to solve this problem of not switching (I have a Windows or Mac PC within reach, if needed).

Greets,
Bart.

Josh
Site Admin
Posts: 6592
Joined: 03 Nov 2007, 00:30

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Josh » 09 Dec 2025, 14:48

Some of your descriptions point to a hardware-related problem. I suspect it might be power-related.

Did you ever try with a powered USB hub between the Raspi and the dongle? This would show if a stable power source could make the problem go away.
USB dongles are allowed to draw 500 mA, some wireless modems I own are using that in full or are even going slightly over that limit.

Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 09 Dec 2025, 15:05

Hi Josh,

Thanks for your quick answer. I thought also of a power problem in the first place, as you could read in the RPI-forum post, so I already tried a powered hub, with no success…. I forgot to mention that.

I can access the dongle through its web-interface when connected to a Zero 1.3 or W 1.1. But still, might be. Powerconsumption of dongle is around, 100-200 mA. Total consumption with the Pi's with dongle is around 400 mA for Zero 1.3 and W 1.1, for the 2W around 500 mA/max 700 mA (measured with Voltcraft PM-40 https://www.amazon.de/Voltcraft-PM-40-U ... B01ARW76KM).

Greets,

Bart.

Josh
Site Admin
Posts: 6592
Joined: 03 Nov 2007, 00:30

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Josh » 09 Dec 2025, 15:50

I can see that you have set "DisableSwitching" in the global config file. That results in the usb-modeswitch automatism doing exactly nothing.
Also, there is no point in putting device-specific data into the global configuration file. It will be ignored. (I think the "device_reference" file may be heavily outdated in that respect.)

I suspect that your modem might be one of those that self-switch after a certain time span. I know that some ZTE models do this.

The error messages point to a configuration problem: can't access interface, can't set configuration, device unconfigured. This means that the dongle isn't ready for use in that moment, whatever the reason.

Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 09 Dec 2025, 20:08

Hi Josh,

Ok, then I’ll let it on for a while and see what happens.
On the other hand: the dongle switches direct without problem in a RPI Zero 2W, but when I put the same SD-card with same RPI-os in Zero 1.3 it does nothing… hmmm.

The funny thing is that when I DiableSwitching=1 and added the configuration data with RPI5 and Trixie, the modem switched, helas only once….so that could be accidental?

I think I am mixed up what global configuration file (=usb_modeswitch.conf?) is/does…. If I understand your instructions right, I could use the usb_modeswitch.conf with DisableSwitching=0 with the instructions I put in there, usb_modeswitch will use the usb_modeswitch.conf-file for configutation.

Or puting a 41-zte_mf79n.rules files in /lib/udev/rules.d/ would be sufficiant to let usb_modeswitch read these rules.

For instance:

Code: Select all

# Part of usb-modeswitch-data, version 20191128
#
# Works with usb_modeswitch versions >= 2.4.0. Slash before %k parameter
# is for compatibility only. Versions >= 2.5.0 don't need it.
#
ACTION!="add|change", GOTO="modeswitch_rules_end"

# Adds a symlink "gsmmodem[n]" to the lowest ttyUSB port with interrupt
# transfer; checked against a list of known modems, or else no action
KERNEL=="ttyUSB*", ATTRS{bNumConfigurations}=="*", PROGRAM="usb_modeswitch --symlink-name %p %s{idVendor} %s{idProduct} %E{PRODUCT}", SYMLINK+="%c"

SUBSYSTEM!="usb", ACTION!="add",, GOTO="modeswitch_rules_end"

# ZTE MF79N (Variant), MF70
ATTR{idVendor}=="19d2", ATTR{idProduct}=="1405", RUN+="usb_modeswitch '/%k'"

LABEL="modeswitch_rules_end"
Or am I wrong…

Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 10 Dec 2025, 18:31

Hi Josh,

leaving the dongle on for a while to let is switch didn't work.
Also adjusting the configuration more to what I understand of usb_modeswitch and following your instructions more precisely didn't make the modem switch.So I is a deeper problem with I can't solve....

So thanks for your help and scrolling through the posts I think I come to a better solution for me: ZTE MF833U1 (viewtopic.php?t=3044 and viewtopic.php?f=3&t=3013&p=19921&hilit= ... 3u1#p19921). That looks like to me a more straight forward usb-ethernet setup with no hotspot etc, which I don't need.., not needing any switching.

Perhaps till later!

Bart Elffers.

Josh
Site Admin
Posts: 6592
Joined: 03 Nov 2007, 00:30

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Josh » 10 Dec 2025, 19:19

Katoen58 wrote: 09 Dec 2025, 20:08 Or puting a 41-zte_mf79n.rules files in /lib/udev/rules.d/ would be sufficiant to let usb_modeswitch read these rules.
Your initial device ID should already be included in the rules file of your usb_modeswitch package - unless it's seriously outdated.

Code: Select all

# ZTE MF668 (Variant), MF70
ATTR{idVendor}=="19d2", ATTR{idProduct}=="1225", RUN+="usb_modeswitch '/%k'"
This line (together with the accompanying config file "/usr/share/usb_modeswitch/19d2:1225") will handle your device if it is 'discovered' properly - which it seems not to be. The only thing that is lacking is the different target ID which is only required if you want to have the target state thoroughly checked.

If the device works on one similar system, with the same software, the only culprit can be the hardware, meaning the USB port of the Raspi.
During the development of PPPWidget and kin, I encountered the strangest behaviors of OTG ports. Sometimes, the order of insertion made a difference, e.g. first the host adapter, then the dongle OR both together, the dongle already plugged into the adapter.

Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 10 Dec 2025, 21:20

Hi Josh,
This line (together with the accompanying config file "/usr/share/usb_modeswitch/19d2:1225") will handle your device if it is 'discovered' properly
: I already thought that that should do the trick...

That of the USB-ports is interesting, can start without f.i. the Logitech mouse dongle. Or not inserting that one at all! Let you know what it does....

Katoen58
Posts: 6
Joined: 07 Dec 2025, 20:04

Re: ZTE MF79N not switching on Raspberry Pi (most of the time)

Post by Katoen58 » 11 Dec 2025, 22:28

Tried with only plugging zte dongle in different USB-ports, but no luck….

Allas, I’ll leave it now, will try the other dongle.

Josh, thanks for your help and perhaps till later.

Greets,

Bart.

PS: nice site about your American uncle!

Post Reply