1 Reply Latest reply on Jul 30, 2015 11:07 AM by PabloM_Intel

    usb0 configuration and usb switch position

    phil.w.howard

      I have an Edison on the the Arduino breakout board. There is a switch that enables either an USBA port or USBB port. When the switch is in the USBB position, I want the usb0 network connection to be made at boot time. If the switch is in the USBA position, I do not want this connection made at boot time. Can this be done?

        • 1. Re: usb0 configuration and usb switch position
          PabloM_Intel

          Hi phil.w.howard,

           

          I think you have two options to do this.

          If you access to your Edison and type “lsusb” you will see that if the switch is in the MicroUSB position you'll get this message “unable to initialize libusb: -99”. Now, if the switch is in the standard USB position the message you get says something like this “Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub”. You can make a service that uses this information, so that if lsusb is ‘unable to initialize’, the usb0 network connection will be made at boot.

          The other option would be to use the 5V pin of the standard USB port to know when to make the usb0 network connection, if this pin is set to 0V (meaning that the switch is in the MicroUSB position) the usb0 connection will be made. If the pin is set to 5V (meaning that the switch is in the standard USB position) the usb0 connection will not be made.

          The last option involves a bit of circuitry to get the state of the pin, so it won’t be as “clean” as the first option but I think both are feasible.

           

          Regards,

          PabloM_Intel