5 Replies Latest reply on Oct 16, 2015 6:33 PM by CMata_Intel

    Have to use ifconfig usb0 down each time I restart edison

    ChaseRLewis

      Anyone know a way to prevent having to call this command EVERY time I restart the edison? If I dont' call it I can't connect to it through XDK except over serial.

        • 1. Re: Have to use ifconfig usb0 down each time I restart edison
          jhane

          I disable the usb0 interface by doing this in my build.

           

          disable network on usb0

           

          diff --git a/meta-intel-edison/meta-intel-edison-distro/recipes-core/systemd/systemd_%.bbappend b/meta-intel-edison/meta-intel-edison-distro/recipes-core/systemd/systemd_%.bb

          index 07b6cb2..cc09b85 100644

          --- a/meta-intel-edison/meta-intel-edison-distro/recipes-core/systemd/systemd_%.bbappend

          +++ b/meta-intel-edison/meta-intel-edison-distro/recipes-core/systemd/systemd_%.bbappend

          @@ -4,7 +4,6 @@ SRC_URI += "file://journald.conf \

                       file://system.conf \

                       file://systemd-reboot-service.patch \

                       file://hsu-pm-runtime.service \

          -            file://usb0.network \

                       file://edison-machine-id.service"

           

          do_install_append() {

          @@ -12,7 +11,6 @@ do_install_append() {

               install -m 0644 ${WORKDIR}/journald.conf ${D}${sysconfdir}/systemd

               install -m 0644 ${WORKDIR}/system.conf ${D}${sysconfdir}/systemd

               install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd

          -    install -m 0644 ${WORKDIR}/usb0.network ${D}${sysconfdir}/systemd/network

           

               # enable timesyncd service

               install -d ${D}${sysconfdir}/systemd/system/sysinit.target.wants

           

           

          fix ssh problem when usb0 net interface is disabled

             

          - ssh was only being enabled when connected to a wired
            network(even though ssh over wifi worked) and when the usb0
            network was disabled ssh stopped working.  the nice comment
            in this file said this could be fixed by commenting out a line
            and now it works!

           

          diff --git a/meta-intel-edison/meta-intel-edison-distro/recipes-connectivity/openssh/openssh/sshd.socket b/meta-intel-edison/meta-intel-edison-distro/recipes-connectivity/ope

          index 2a1b012..b3749d2 100644

          --- a/meta-intel-edison/meta-intel-edison-distro/recipes-connectivity/openssh/openssh/sshd.socket

          +++ b/meta-intel-edison/meta-intel-edison-distro/recipes-connectivity/openssh/openssh/sshd.socket

          @@ -6,7 +6,7 @@ ExecStartPre=/bin/mkdir -p /var/run/sshd

          ListenStream=22

          # restrict access to wired access for security reasons

          # comment this line to remove restriction

          -BindToDevice=usb0

          +#BindToDevice=usb0

          Accept=yes

           

          [Install]

           

           

           

          jeff

          • 2. Re: Have to use ifconfig usb0 down each time I restart edison
            Intel_Peter

            Hello ChaseRLewis,

             

            I personally have never faced this issue, I'm not sure what's the reason for it. Nevertheless I can give a way to work around it.

            You will have to create a very simple shell script that includes the 'ifconfig usb0 down' command; it'll end up looking like this:

             

            #!/bin/sh
            ifconfig usb0 down
            

             

            Let's say that you called the script downusb.sh and it is stored in /home/root/, then you will have to create a system service that disables the USB0 interface for you every time you turn the board on. It'll look like this:

             

            #!/bin/sh
            [Unit]
            Description=Disables the usb0 interface automatically on boot
            [Service]
            ExecStart=/home/root/downusb.sh
            Type=idle
            [Install]
            WantedBy=basic.target
            

             

            We will call this service downusb.service and it has to be stored on /lib/systemd/system/. Once you have created it type the command 'systemctl enable downusb.service'.

            Then you can reboot the system and it should disable it automatically.

             

            Peter.

            1 of 1 people found this helpful
            • 3. Re: Have to use ifconfig usb0 down each time I restart edison
              ChaseRLewis

              Is it normal to have to manually create all these directories? Also is it necessary to do something like vim? I created these directories but I don't see them after making them when looking inside the edison from my OS (windows). I tried to cd to them and none of them existed so I created them with mkdir but vim isn't by default on the edison and I can't navigate to them to them via the F: directory I can see when I connect to the Edison. ????

              • 4. Re: Have to use ifconfig usb0 down each time I restart edison
                Intel_Peter

                No, it is not normal; all these directories should be on the Edison's file system. I mean you do have to create the files, but all the directories should already be there.

                Are you connecting your Edison's internal Linux terminal? Or where exactly are you creating these directories?

                If you are entering your Edison's terminal and you're not able to see those directories, then something might be wrong with your board's image. In that case I suggest you to re-flash the board.

                 

                Peter.

                • 5. Re: Have to use ifconfig usb0 down each time I restart edison
                  CMata_Intel

                  Hi ChaseRLewis

                   

                  Have you found a way to use the XDK without running the ifconfig usb0 down command?

                  Which image version do you have in your board? And, which XDK version are you using?

                   

                  Regards,

                  Charlie