Modem Huawei E3531 from storage to serial modem mode - procedure I used


I migrated my HA instance to Proxmox 7.3 and struggle (again…) to make my Huawei E3531 USB stick recognized as a serial modem (12d1:1001) because the backup/restore process in HA seems to ignore the file(s) you installed in the boot partition… So you have to install it again manually (but of course I had no copy of it)… So my modem was back as a storage USB (12d1:1f01)
I searched on google the procedure to move back the modem to serial mode and it seems I am not the only one having problems with this process…

So after a couple hours of test (and frustration…), here is how I did it:

  1. Disconnect the Huawei Modem from the HA node.
  2. Format a USB memory stick (formatted in FAT32) that you will call CONFIG
  3. Create on that USB stick a directory called udev
  4. Create a file in udev directory called 10-gsm-modem.rules (use Notepad++ on Windows to make sure the end of line is in LF format) with the following content:
ACTION=="add" \
, ATTRS{idVendor}=="12d1" \
, ATTRS{idProduct}=="1f01" \
, RUN+="/sbin/usb_modeswitch -v 12d1 -p 1f01 -I -M '55534243123456780000000000000011062000000100000000000000000000' "
  1. Connect that USB stick with the file udev/10-gsm-modem.rules on your HA node.
  2. To load the content of the USB stick, two options here:
    • restart HA to load the content of the stick at boot…
    • or what I did is to go to HA Console (or SSH to the HA node) or in a terminal and type:
      ha os import
      The file 10-gsm-modem.rules will now be loaded in the boot partition of HA in /etc/udev
      You can verify it is correctly loaded by connecting to the HA console and type the following when you have the prompt of HA cli:
HA > login
ls /etc/udev

You should see your file listed …

Now, plug your modem on HA node… Type lsusb in a terminal…Your modem should be in serial modem mode (12d1:1001)… and you should have 3 ttyUSB devices (at least)…

Let me know if this is helping or any problems you are experiencing (I have not tested this procedure if your modem is recognized as a Hi-Link modem (12d1:14dc)… In this case you maybe have to replace the 1f01 in the file by 14dc (but to be tested))…