Dietpi - autostart usb_modeswitch

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
nzbaxterman
Posts: 6
Joined: Wed Aug 19, 2015 10:54 am

Dietpi - autostart usb_modeswitch

Post by nzbaxterman » Mon Apr 17, 2017 2:27 am

Hello

I've just created a new Dietpi on a RPi2 and can't work out how to get usb_modeswitch to start automatically.

The apt-get install of usb-modeswitch seems to want to use upstart by default (as it creates a /etc/init/usb-modeswitch-upstart.conf) but I can't work out how to use this, or what dietpi uses by default.

I can create a script with the following - but this seems inelegant.
usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1f01
sleep 2
ifup usb0
sleep 2
route add default gw 192.168.8.1

How should I be getting usb_modeswitch to run automatically?

User avatar
Fourdee
Site Admin
Posts: 2785
Joined: Tue Feb 06, 2007 12:36 pm

Re: Dietpi - autostart usb_modeswitch

Post by Fourdee » Mon Apr 17, 2017 10:47 am

but I can't work out how to use this, or what dietpi uses by default.
Hi,

DietPi is Raspbian. Both use SystemD. If you installed usb_modeswitch via apt, same for both.
I can create a script with the following - but this seems inelegant.
As per: https://www.thefanclub.co.za/how-to/how ... and-wvdial
Config file is located here:

Code: Select all

/etc/usb_modeswitch.conf
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

nzbaxterman
Posts: 6
Joined: Wed Aug 19, 2015 10:54 am

Re: Dietpi - autostart usb_modeswitch

Post by nzbaxterman » Mon Apr 17, 2017 8:35 pm

I had followed as per https://www.thefanclub.co.za/how-to/how ... and-wvdial

But usb_modeswitch isn't getting run on boot. I've got around this by adding this to /etc/rc.local before exit 0:
/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1f01
ifup usb0

I'm running V148, but on the same devices running V100 I don't need to do this in rc.local.

Any thoughts?

nzbaxterman
Posts: 6
Joined: Wed Aug 19, 2015 10:54 am

Re: Dietpi - autostart usb_modeswitch (resolved)

Post by nzbaxterman » Fri Apr 21, 2017 11:35 pm

I found the installer doing an apt-get was only doing an "upstart" install, not systemd and udev.

Complied from the 2.5.0 sources and it's now running usb_modeswitch-dispatcher correctly.

Post Reply