Re: [beagleboard] Re: Why is usb0 configured?

2015-06-04 Thread Eric Schumann
I had to clean /etc/network/interfaces and /opt/scripts/boot/am335x_evm.sh
of all references to the USB0 items.

The udhcpd.conf file tells your beagle bone how to behave as a DHCP server
(which it had to do for USB since your PC would not be handing out DHCP
licenses to a device connected by USB).

When you modified the conf file, it started handing out DHCP leases on the
interface you put in (probably eth0, which is why your beagle bone was
giving out ip address to devices on your network). If you put the interface
back to usb0 in /etc/udhcpd.conf, it will stop doing that, and will have no
adverse consequences.

At some point you might want to disable udhcpd altogether as you will not
need it unless you intend the beagle bone be a DHCP server


-=Eric Schumann



my /etc/network/interfaces

start of file

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether 7c:66:9d:4e:5e:DD

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#wpa-ssid essid
#wpa-psk  password

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
#iface usb0 inet static
#address 192.168.7.2
#netmask 255.255.255.0
#network 192.168.7.0
#gateway 192.168.7.1

end of file

and my /opt/scripts/boot/am335x_evm.sh:


start of file

#!/bin/sh -e
#
# Copyright (c) 2013-2014 Robert Nelson robertcnel...@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a
copy
# of this software and associated documentation files (the Software), to
deal
# in the Software without restriction, including without limitation the
rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

#Based off:
#
https://github.com/beagleboard/meta-beagleboard/blob/master/meta-beagleboard-extras/recipes-support/usb-gadget/gadget-init/g-ether-load.sh

eeprom=/sys/bus/i2c/devices/0-0050/eeprom

#Flash BeagleBone Black's eeprom:
if [ -f /boot/uboot/flash-eMMC.txt ] ; then
eeprom_location=$(ls
/sys/devices/ocp.*/44e0b000.i2c/i2c-0/0-0050/eeprom 2 /dev/null)
eeprom_header=$(hexdump -e '8/1 %c' ${eeprom} -s 5 -n 3)
if [ x${eeprom_header} = x335 ] ; then
echo Valid EEPROM header found
else
echo Invalid EEPROM header detected
if [ -f /opt/scripts/device/bone/bbb-eeprom.dump ] ; then
if [ ! x${eeprom_location} = x ] ; then
echo Adding header to EEPROM
dd
if=/opt/scripts/device/bone/bbb-eeprom.dump of=${eeprom_location}
fi
fi
fi
fi

SERIAL_NUMBER=$(hexdump -e '8/1 %c' ${eeprom} -s 14 -n 2)-$(hexdump -e
'8/1 %c' ${eeprom} -s 16 -n 12)
ISBLACK=$(hexdump -e '8/1 %c' ${eeprom} -s 8 -n 4)

BLACK=
if [ x${ISBLACK} = xBBBK ] || [ x${ISBLACK} = xBNLT ] ; then
BLACK=Black
fi

mac_address=/proc/device-tree/ocp/ethernet@4a10/slave@4a100200
/mac-address
if [ -f ${mac_address} ] ; then
cpsw_0_mac=$(hexdump -v -e '1/1 %02X :' ${mac_address} | sed
's/.$//')
fi

mac_address=/proc/device-tree/ocp/ethernet@4a10/slave@4a100300
/mac-address
if [ -f ${mac_address} ] ; then
cpsw_1_mac=$(hexdump -v -e '1/1 %02X :' ${mac_address} | sed
's/.$//')
fi

unset boot_partition
boot_partition=$(LC_ALL=C lsblk -l | grep /boot/uboot | awk '{print $1}')
if [ x${boot_partition} = x ] ; then
gadget_partition=/dev/mmcblk0p1
else
gadget_partition=/dev/${boot_partition}
fi

modprobe g_multi file=${gadget_partition} cdrom=0 stall=0 removable=1
nofua=1 iSerialNumber=${SERIAL_NUMBER} iManufacturer=Circuitco
iProduct=BeagleBone${BLACK} host_addr=${cpsw_1_mac}

sleep 1

sed -i -e 's:DHCPD_ENABLED=no:#DHCPD_ENABLED=no:g' /etc/default/udhcpd
#Distro default...
deb_udhcpd=$(cat /etc/udhcpd.conf | grep Sample || true)
if [ ${deb_udhcpd} ] ; 

Re: [beagleboard] Re: Why is usb0 configured?

2015-06-04 Thread ferroamp
Hi Robert,

old thread I know but I've been trying to disable ethernet on USB0 and this 
is the closest I've gotten to an answer. 
Is this the correct way to go about it? 

I'm asking because I tried commenting out everything regarding usb0 in 
/opt/scripts/boot/am335x_evm.sh and /etc/network/interfaces as well as in 
/etc/udhcpd.conf.
I rebooted and the usb0 ehthernet was disabled (no USB0 when I did 
ifconfig) but my colleagues were a bit upset as I apparently had started a 
dhcp server on my beaglebone at the same time, which messed with our real 
dhcp server so they got bad ip addresses.

So, what did I do wrong? Should I have left the /etc/udhcp.conf alone?

cheers,

Per




On Friday, May 2, 2014 at 11:14:27 PM UTC+2, RobertCNelson wrote:


 On May 2, 2014 2:11 PM, geo...@gmail.com javascript: wrote:
 
  How do we disable the USB0 interface on the newer images? Do we wipe the 
 references from /opt/scripts/boot/am335x_evm.sh, and 
 /etc/network/interfaces, or is there something else?

 Correct..

 
 
 
  On Friday, April 11, 2014 11:49:51 AM UTC-4, RobertCNelson wrote:
 
  On Fri, Apr 11, 2014 at 10:41 AM,  xdon...@gmail.com wrote: 
   I installed an image which is 
 BBB-eMMC-flasher-ubuntu-13.10-2014-02-16-2gb. 
   Probably that's why I didn't find the file. I want to change the 
 default ip 
   address for usb0. I found out that in the script 
   /opt/scripts/boot/am335x_evm.sh there is one line to setup the port. 
 Can I 
   change it there? will it work? 
 
  Yeap, but also /etc/network/interfaces... (don't ask why i do it in 
  both places..) 
 
  Regards, 
 
  -- 
  Robert Nelson 
  http://www.rcn-ee.com/ 
 
  -- 
  For more options, visit http://beagleboard.org/discuss
  --- 
  You received this message because you are subscribed to the Google 
 Groups BeagleBoard group.
  To unsubscribe from this group and stop receiving emails from it, send 
 an email to beagleboard...@googlegroups.com javascript:.
  For more options, visit https://groups.google.com/d/optout.
  

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Why is usb0 configured?

2014-05-02 Thread geoskd
How do we disable the USB0 interface on the newer images? Do we wipe the 
references from /opt/scripts/boot/am335x_evm.sh, and 
/etc/network/interfaces, or is there something else?



On Friday, April 11, 2014 11:49:51 AM UTC-4, RobertCNelson wrote:

 On Fri, Apr 11, 2014 at 10:41 AM,  xdon...@gmail.com javascript: 
 wrote: 
  I installed an image which is 
 BBB-eMMC-flasher-ubuntu-13.10-2014-02-16-2gb. 
  Probably that's why I didn't find the file. I want to change the default 
 ip 
  address for usb0. I found out that in the script 
  /opt/scripts/boot/am335x_evm.sh there is one line to setup the port. Can 
 I 
  change it there? will it work? 

 Yeap, but also /etc/network/interfaces... (don't ask why i do it in 
 both places..) 

 Regards, 

 -- 
 Robert Nelson 
 http://www.rcn-ee.com/ 


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Why is usb0 configured?

2014-05-02 Thread Robert Nelson
On May 2, 2014 2:11 PM, geo...@gmail.com wrote:

 How do we disable the USB0 interface on the newer images? Do we wipe the
references from /opt/scripts/boot/am335x_evm.sh, and
/etc/network/interfaces, or is there something else?

Correct..




 On Friday, April 11, 2014 11:49:51 AM UTC-4, RobertCNelson wrote:

 On Fri, Apr 11, 2014 at 10:41 AM,  xdon...@gmail.com wrote:
  I installed an image which is
BBB-eMMC-flasher-ubuntu-13.10-2014-02-16-2gb.
  Probably that's why I didn't find the file. I want to change the
default ip
  address for usb0. I found out that in the script
  /opt/scripts/boot/am335x_evm.sh there is one line to setup the port.
Can I
  change it there? will it work?

 Yeap, but also /etc/network/interfaces... (don't ask why i do it in
 both places..)

 Regards,

 --
 Robert Nelson
 http://www.rcn-ee.com/

 --
 For more options, visit http://beagleboard.org/discuss
 ---
 You received this message because you are subscribed to the Google Groups
BeagleBoard group.
 To unsubscribe from this group and stop receiving emails from it, send an
email to beagleboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Why is usb0 configured?

2014-04-11 Thread xdong . cn
May I ask where do you find run_boot-scripts? I’m working on a BeagleBone 
Black and I can’t find this file.

Thanks!

On Thursday, October 10, 2013 9:36:36 AM UTC-5, syst...@gmail.com wrote:

 I am also trying to figure this one out, My run_boot-scripts is empty 
 anyway, But usb0 still comes up.

 On Sunday, October 6, 2013 9:23:02 AM UTC+10, George B wrote:

 I have commented usb0 out of /etc/networks/interfaces but it configures 
 anyway:

 # Ethernet/RNDIS gadget (g_ether)
 # ... or on host side, usbnet and random hwaddr
 #iface usb0 inet static
 #address 192.168.7.2
 #netmask 255.255.255.0
 #network 192.168.7.0
 #gateway 192.168.7.1

 But it comes up anyway:

 usb0  Link encap:Ethernet  HWaddr 0e:38:c9:c0:25:e6  
   inet addr:192.168.7.2  Bcast:192.168.7.3  Mask:255.255.255.252
   UP BROADCAST MULTICAST  MTU:1500  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000 
   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 This unit is nowhere near a USB port.  I really don't what this interface 
 up. 

 This is 

 3.8.13-bone28 #1 SMP Fri Sep 13 03:12:24




-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Why is usb0 configured?

2014-04-11 Thread Robert Nelson
On Fri, Apr 11, 2014 at 10:30 AM,  xdong...@gmail.com wrote:
 May I ask where do you find run_boot-scripts? I'm working on a BeagleBone
 Black and I can't find this file.

/boot/uboot/run_boot-scripts

btw, i've nuke that file interface on later images..

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Why is usb0 configured?

2014-04-11 Thread Robert Nelson
On Fri, Apr 11, 2014 at 10:41 AM,  xdong...@gmail.com wrote:
 I installed an image which is BBB-eMMC-flasher-ubuntu-13.10-2014-02-16-2gb.
 Probably that's why I didn't find the file. I want to change the default ip
 address for usb0. I found out that in the script
 /opt/scripts/boot/am335x_evm.sh there is one line to setup the port. Can I
 change it there? will it work?

Yeap, but also /etc/network/interfaces... (don't ask why i do it in
both places..)

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Why is usb0 configured?

2013-10-10 Thread systemxmw
I am also trying to figure this one out, My run_boot-scripts is empty 
anyway, But usb0 still comes up.

On Sunday, October 6, 2013 9:23:02 AM UTC+10, George B wrote:

 I have commented usb0 out of /etc/networks/interfaces but it configures 
 anyway:

 # Ethernet/RNDIS gadget (g_ether)
 # ... or on host side, usbnet and random hwaddr
 #iface usb0 inet static
 #address 192.168.7.2
 #netmask 255.255.255.0
 #network 192.168.7.0
 #gateway 192.168.7.1

 But it comes up anyway:

 usb0  Link encap:Ethernet  HWaddr 0e:38:c9:c0:25:e6  
   inet addr:192.168.7.2  Bcast:192.168.7.3  Mask:255.255.255.252
   UP BROADCAST MULTICAST  MTU:1500  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000 
   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 This unit is nowhere near a USB port.  I really don't what this interface 
 up. 

 This is 

 3.8.13-bone28 #1 SMP Fri Sep 13 03:12:24




-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.