On 13/02/14 03:58, Mark Hatch wrote:
Thanks a lot for clearing some of this up!
So I'm trying to get a mesh network running for a university
project using AHCPD/Babel.
The goal would be for a Ethernet connected node
(beaglebone) to use DHCP to acquire an IP address, and then
it would share it's internet connection over ad-hoc wlan
with it's peers (also beaglebones).
If I can't get AHCPD/Babel to run properly, I'll
probably just use a regular ad-hoc network with static
IPs. ('m severely time-constrained as this project is due
by the end of the semester... and this is only a part of
it!)
To assign addresses and handle DNS I would recommend dnsmasq.
I compiled the source code on the bbb. Have you installed
gcc/make/etc on the beaglebone black? I think you can also install
it using opkg.
08 - Installing dnsmasq
Source
Site:
http://www.thekelleys.org.uk/dnsmasq/
File: dnsmasq-2.66.tar.gz
Version: 2.66
Compile and Install
Extract dnsmasq-2.66.tar.gz into the home directory.
cp ~/libconfig-1.4.9/aux-build/install-sh
~/dnsmasq-2.66/install-sh
Modify variable in Makefile to
INSTALL = ~/dnsmasq-2.66/install-sh
Build and install:
make
make install
dnsmasq Service
Create a file /lib/systemd/dnsmasq.service which contains:
[Unit]
Description=A lightweight DHCP and caching DNS server
After=networking.service
[Service]
Type=forking
ExecStart=/usr/local/sbin/dnsmasq
ExecStop=/usr/bin/killall dnsmasq
[Install]
WantedBy=multi-user.target
Create a link to the dnsmasq service file
cd /etc/systemd/system
ln -f /lib/systemd/dnsmasq.service dnsmasq.service
Start the service:
systemctl daemon-reload
systemctl enable dnsmasq.service
Configuration file
Create a configuration file /etc/dnsmasq.conf with the following
lines
resolv-file=/var/run/ppp/resolv.conf
interface=eth0
no-hosts
dhcp-range=192.168.0.50,192.168.0.70,12h
dhcp-option=252,"\n"
dhcp-option=vendor:MSFT,2,1i
Restart beagle to allow the dnsmasq service to start.
Yes I have got my wifi module working, I was already
able to ping
google.com from wireless ad-hoc beaglebones
over my laptop's eth0 which was awesome!
Now I just want to replicate this with only
beaglebones, which is why I need the kernel changes for
NAT.
great
I do have a microSD card for testing. I ran into some
complications last night trying to format the card
properly because the mkcard.sh script was not working
for me.
I don't use the script. Instead I just use the gnome disk utility.
ie
Installing on SD card
Use the disk utility application to create the partitions on a blank
micro SD card and mount them.
Create DOS Partition with following:
Size: 8.00 MB
Type: FAT
Name: BEAGLEBONE
The edit the DOS partition with the following:
Partition Label:
Type: W95 FAT32 (LBA) (0x0c)
Bootable: Check this tickbox
Create a Linux partition to fill the rest of the SD card:
Size: 7.940 GB
Type: Ext4
Name: Angstrom
Take Ownership of filesystem: Not checked
Encrypt underlying device: Not checked
Then mount both partitions. The dos partition will be mounted at
/media/BEAGLEBONE and the Linux partition will be mounted at
/media/Angstrom.
Copy the Angstrom distribution files to the SD card:
cd
~/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/deploy/images/beaglebone
sudo cp u-boot-beaglebone-2011.09+git-r30.img
/media/BEAGLEBONE/u-boot.img
sudo cp MLO-beaglebone-2011.09+git /media/BEAGLEBONE/MLO
sudo echo "optargs=quiet" > /media/BEAGLEBONE/uEnv.txt
sudo tar zxv -C /media/Angstrom -f
Angstrom-console-image-eglibc-ipk-v2012.12-beaglebone.rootfs.tar.gz
sudo tar zxv -C /media/Angstrom -f
modules-3.8.13-r23a-beaglebone.tgz
The SD card now is ready for the Beaglebone. Demount the partitions.
Make sure when the system boots for the first time to run:
depmod -a
Do you know of any good guides for testing the
kernel? I didn't know you could test it before flashing
it.
That's what the SD card is used for. Once that is complete you have
to build a flasher. But you can complete all software development
using the SD card.
I'm also still trying to work through bitbake and
just building the custom kernel. It's been difficult to
distinguish how the images get built, since there are
lots of defconfigs (ti-linux-psp-3.2 vs.
linux-mainline-3.8.0) and I'm unsure how they all get
tied together.
01 - Building Angstrom-v2012.12
This guide details the process of building a console image from the
Angstrom source on an Xubuntu 12.04.3 32-bit Linux host.
Prerequisites
Then we need some additional development tools. Enter the following:
sudo apt-get install sed wget cvs subversion git-core
coreutils unzip texi2html texinfo docbook-utils gawk
python-pysqlite2 diffstat help2man make gcc build-essential g++
desktop-file-utils chrpath
/bin/sh (ls -l /bin/sh) is symbolically linked to dash. "dash" is a
POSIX compliant shell that is much smaller than "bash". Some broken
shell scripts still make use of bash extensions while calling into
/bin/sh. To work around this issue call "sudo dpkg-reconfigure dash"
and select No when it asks you to install dash as /bin/sh.
Download Angstrom Distribution and Build
To download the distribution for Beaglebone enter the following
commands:
cd ~/Projects
mkdir angstrom-v2012.12
cd ./angstrom-v2012.12
git clone
git://
github.com/Angstrom-distribution/setup-scripts.git
cd setup-scripts
MACHINE=beaglebone ./oebb.sh config beaglebone
MACHINE=beaglebone ./oebb.sh update
And to compile the console version of the distribution:
. ~/.oe/environment-angstromv2012.12
bitbake console-image
During these steps the computer must be connected to the Internet.
Custom Kernel
Delete the contents of the directory
/home/rlyon/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/deploy/images/beaglebone
Clean distribution with following commands
bitbake u-boot-denx -c cleansstate
bitbake virtual/kernel -c cleansstate
bitbake -c clean console-image
Create the boot files MLO and u-boot with the following command:
bitbake u-boot-denx
Set up the custom kernel we require:
bitbake virtual/kernel -c configure
cd
~/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git
make ARCH=arm menuconfig
Disable watchdog shut down:
-> Device Drivers
-> Watchdog Timer Support
-*- WatchDog Timer Driver Core
[*] Disable watchdog shutdown on close
*** Watchdog Device Drivers ***
< > Software watchdog
< > Synopsys DesignWare watchdog
< > MPcore watchdog
<*> OMAP Watchdog
<*> TWL4030 Watchdog
< > Max63xx watchdog
Enable NAT:
Then copy the configuration file:
~/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git/.config
to
~/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git/.config.old
~/Projects/angstrom-v2012.12/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git/defconfig
~/Projects/angstrom-v2012.12/setup-scripts/sources/meta-beagleboard/common-bsp/recipes-kernel/linux/linux-mainline-3.8/beaglebone/defconfig
~/Projects/angstrom-v2012.12/setup-scripts/sources/meta-ti/recipes-kernel/linux/linux-ti33x-psp-3.1/beaglebone/defconfig
~/Projects/angstrom-v2012.12/setup-scripts/sources/meta-ti/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/defconfig
Then compile:
cd ~/Projects/angstrom-v2012.12/setup-scripts
bitbake virtual/kernel
bitbake console-image
Maybe this will give you some ideas.