Jika pembaca ingat pada tulisan sebelumnya mengenai cara memanfaatkan router TP Link jadul tl-wr1043nd dengan modem 4G (baca disini lalu disini), ada pandangan seperti gini : "Ngapain susah susah mengoprek sesuatu yang sudah dibilang gak bisa dipakai di berbagai forum diskusi openwrt maupun beberapa konten youtube ?" Ya benar beberapa orang sudah menyatakan modem yang cocok dipakai bersama router openwrt adalah kakaknya DT100 yaitu versi hi-link DT-300 yang merupakan Mifi siap pakai dan juga bisa digunakan sebagai modem usb colok ke PC/Router. Ini dikarenakan modem hi-link memiliki processor kontroller didalamnya berbeda dengan DT-100 yang harus dikendalikan oleh software pada PC.
Lalu saya teringat dulu ketika saya beli modem ini, tujuan saya ingin meng-upgrade modem usb huawei 3G/UMTS ke teknologi 4G LTE yg katanya lebih kenceng, yang saya pasangkan dengan mikrotik dan terkejutnya saya DT-100 tidak support mikrotik maupun TP link WR840 yg spesial untuk dongle USB. Sehingga karena gagal maka modem ini sudah digudang hampir 8 tahun lamanya. Dan karena saya lagi mode mengirit maka saya mempunyai keyakinan akan adanya suatu perintah command yang bisa merubah modem ini dari usb storage ke usb modem seperti tangkapan log console berikut :
(jika ingin mencoba gunakan putty - SSH ke 192.168.1.1)
root@ROOter:~# lsusb
Bus 001 Device 007: ID 05c6:f000 Qualcomm, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@ROOter:~# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
|__ Port 1: Dev 7, If 0, Class=Mass Storage, Driver=, 480M
Thu Jan 1 00:00:11 1970 : usb-modeswitch Delay for boot up
Thu Jan 1 00:00:12 1970 : usb-modeswitch Delay for boot up
Tue Aug 12 06:03:02 2025 : ROOter Initialize Initializing Rooter
Tue Aug 12 06:03:06 2025 : usb-modeswitch Ignoring Linux Hub
Tue Aug 12 06:03:06 2025 : usb-modeswitch CURRMODEM 1
Tue Aug 12 06:03:07 2025 : usb-modeswitch Add : 1-1: Manufacturer=Qualcomm,_Incorporated Product=Qualcomm_CDMA_Technologies_MSM Serial=1234567890ABCDEF 05c6 f000
Tue Aug 12 06:03:07 2025 : usb-modeswitch 1 *****************************************************************
Tue Aug 12 06:03:07 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:08 2025 : usb-modeswitch 1 * Start of Modem Detection and Connection Information
Tue Aug 12 06:03:08 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:08 2025 : usb-modeswitch 1 * Product=Qualcomm_CDMA_Technologies_MSM 05c6 f000
Tue Aug 12 06:03:09 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:09 2025 : usb-modeswitch 1 *****************************************************************
Tue Aug 12 06:03:10 2025 : usb-modeswitch 1 Found Modem at 1-1 in Cfg#= 1 from 1 available
Tue Aug 12 06:03:21 2025 : usb-modeswitch 1 *****************************************************************
Tue Aug 12 06:03:21 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:21 2025 : usb-modeswitch 1 * Modem at 1-1 switched to : 05c6:f000
Tue Aug 12 06:03:21 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:22 2025 : usb-modeswitch 1 *****************************************************************
Tue Aug 12 06:03:22 2025 : Protofind 05c6/f000 Number Interfaces w/drivers : 1
Tue Aug 12 06:03:23 2025 : Protofind 05c6/f000 Driver Name : 0
Tue Aug 12 06:03:23 2025 : usb-modeswitch 1 *****************************************************************
Tue Aug 12 06:03:23 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:24 2025 : usb-modeswitch 1 * ProtoFind returns : 0
Tue Aug 12 06:03:24 2025 : usb-modeswitch 1 *
Tue Aug 12 06:03:24 2025 : usb-modeswitch 1 *****************************************************************
### USER
i have qualcomm usb dongle modem with switch mode from stroage to msm 6000. but how to switvh its mode in openwrt
### ASSISTANT
To switch a Qualcomm USB dongle from **storage mode (CD-ROM mode)** to **modem mode (MSM 6000 or similar)** on **OpenWRT**, you typically need to send a **USB mode switch command** using the `usb_modeswitch` utility. Many Qualcomm-based dongles (like older Huawei, ZTE, or other brands) come up as a USB storage device initially to install drivers on Windows, but they can be switched to modem mode for Linux systems.
Here’s how to do it on **OpenWRT**:
---
### ✅ Step 1: Install `usb-modeswitch`
Make sure you have the required packages installed on your OpenWRT system:
```bash
opkg update
opkg install usb-modeswitch
opkg install kmod-usb-serial
opkg install kmod-usb-serial-option # For Qualcomm/QMI modems
opkg install kmod-usb-serial-qualcomm # if available
```
Also, install `comgt` or `uqmi` depending on your modem type:
```bash
opkg install uqmi
```
---
### ✅ Step 2: Identify Your Dongle
Plug in your USB dongle and run:
```bash
lsusb
```
Look for a device that shows up as a **storage device** (often with a vendor like `12d1:1446` — common for Huawei). Example:
```
Bus 001 Device 003: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (Mass Storage Mode)
```
Note the **Vendor ID** and **Product ID**.
---
### ✅ Step 3: Use `usb_modeswitch` to Switch Mode
You can manually switch the mode using `usb_modeswitch`. Example:
```bash
usb_modeswitch -v 12d1 -p 1446 -M "55534243123456780000000000000011062000000100000000000000000000"
```
> 🔍 The `-M` flag sends a specific **SCSI command** to switch mode. The long hex string is a **"magic" control message** used to trigger the switch.
💡 Many Qualcomm/Huawei modems respond to the standard Huawei switch message:
```
55534243123456780000000000000011062000000100000000000000000000
```
---
### ✅ Step 4: Verify Switched Mode
After running `usb_modeswitch`, unplug and replug the dongle or run:
```bash
lsusb
```
You should now see a different product ID, e.g., `12d1:1001` or `12d1:141b`, which indicates **modem mode**.
Also check:
```bash
dmesg | tail
```
You should see new serial ports like `/dev/ttyUSB0`, `/dev/ttyUSB1`, etc.
---
### ✅ Step 5: Configure the Modem with `uqmi` or `qmi-network`
If your modem uses **QMI protocol** (common for Qualcomm MSM), use `uqmi`.
Install `libqmi` and `qmi-utils` if not already:
```bash
opkg install libqmi qmi-utils
```
Test QMI connection:
```bash
uqmi -d /dev/cdc-wdm0 --get-client-id wds
```
Or use `qmi-network` script:
```bash
qmi-network /dev/cdc-wdm0 start
```
You may need to set up a network interface in `/etc/config/network`.
---
### ✅ Optional: Automate Mode Switch
To auto-switch when the dongle is plugged in:
#### Option A: Use Hotplug Script
Create a hotplug script:
```bash
vi /etc/hotplug.d/usb/10-usb-modeswitch
```
Add:
```sh
#!/bin/sh
[ "$ACTION" = "add" ] || exit 0
# Replace 12d1:1446 with your dongle's storage mode VID:PID
if [ "$PRODUCT" = "12d1/1446/1" ]; then
sleep 2
usb_modeswitch -v 12d1 -p 1446 -M "55534243123456780000000000000011062000000100000000000000000000"
sleep 3
fi
```
Make executable:
```bash
chmod +x /etc/hotplug.d/usb/10-usb-modeswitch
```
> ⚠️ You may need to adjust the `PRODUCT` string. Check `/var/log/messages` or `dmesg` to see what `$PRODUCT` your device reports.
---
### ✅ Troubleshooting Tips
- Run `dmesg` after plugging in the dongle to see kernel messages.
- Some modems need a **specific config file** in `/etc/usb-mode.json` or use predefined rules in `usb-modeswitch`.
- If `usb_modeswitch` fails, try adding `-I` (ignore product ID after switch) or `-H` (Huawei mode).
- Some newer OpenWRT versions use `usb-mode-switch` daemon with config files in `/etc/usb-mode-switch.d/`.
---
### 📌 Summary
| Step | Action |
|------|--------|
| 1 | Install `usb-modeswitch`, `kmod-usb-serial*`, `uqmi` |
| 2 | Find VID:PID in storage mode using `lsusb` |
| 3 | Run `usb_modeswitch` with correct message |
| 4 | Confirm new mode and serial ports appear |
| 5 | Use `uqmi` or `qmi-network` to connect |
| 6 | Automate with hotplug script |
---
- Modem USB DT100 mengalami kegagalan perpindahan dari mode usb storage 05C6:F000 ke Modem 4G 05C6:6000
- OpenWrt versi terbaru menggunakan package "usbmode bukan lagi usb-modeswitch" dan mengakses file konfigurasi di /etc/usb-mode.json
- File konfigurasi ini sudah berusaha merubah mode dari modem namun tidak sesuai message yang disampaikan ke modem untuk switch, sampai saya mempunyai kode konfigurasi yang entah dari mana saya temukan pada forum diskusi disini
{
"messages": [
"555342431234567890ABCDEF80000671030000000000000000000000000000"
],
"devices": {
"05c6:f000": {
"*": {
"t_vendor": "05c6",
"t_product": "6000",
"msg": [ 0 ]
}
}
}
}