Optware / Optware-ng

279 stars 52 forks source link

Package request: usb-modeswitch #234

Closed me11ved closed 6 years ago

me11ved commented 6 years ago

Hi Alex. Please configure the package: usb-modeswitch Thank you!

alllexx88 commented 6 years ago

Hi. I've been looking into it for a while. Looks like adding the original usb_modeswitch is not an option, since it relies on udev heavily to do the switching. The other option is to add OpenWRT's usbmode, which can run as a daemon and doesn't need udev. The latter needs OpenWRT's libubox, so I'll need to add this first. Doing so is on my To-Do list, so please stay tuned 😄

UPD: Sorry, usbmode doesn't run as a daemon, but it's still better, since it reads a settings file to switch the supported devices. usb_modeswitch, if run manually, needs to be "fed" with a device settings file to do the switching, all the "auto" magic is done using udev.

alllexx88 commented 6 years ago

Added.

ipkg update
ipkg install usb-modeswitch

Usage:

Usage: /opt/sbin/usbmode <command> <options>
Commands:
        -l              List matching devices
        -s              Modeswitch matching devices

Options:
        -v              Verbose output
        -c <file>       Set configuration file to <file> (default: /opt/etc/usb-mode.json)

If your device firmware supports custom hotplug scripts (e.g., TomatoUSB does), you can add /opt/sbin/usbmode -s hotplug command to automatically switch supported devices. If not, you'll have to manually call /opt/sbin/usbmode -s after plugging the device in. In theory, at least, since I don't have a supported device here that can be switched, so feedback is appreciated 😄

me11ved commented 6 years ago

Thanks, Alex. The problem is found in the firmware of merlin. After updating the program, the modem does not see it. I had to roll back the firmware.