Author Archives: noblep

Making the VoCore easier to connect to

After you get basic connectivity to your VoCore there are a couple of things you can do to make it a bit easier to work with on a daily basis. I work in Linux so my advice is oriented to the Linux/Unix way of doing things. Since modern apple systems are based on Unix there are parallels to the linux way, but I am not familiar with the details. If you work in on a Microsoft system you are on your own, PuTTY is a popular way to connect from Windows but it is very limited in some areas.

I work in a ssh session quite a bit and transfer files to the VoCore with scp so I set up ssh to log in without using a password. To do this you need a public key, either rsa or dsa. You may already have one, to see just run ls ~/.ssh in a terminal session. If you see either id_dsa.pub or id_rsa.pub you already have a key. If not you need to use ssh-keygen to set one up.

To allow connecting without the password nonsense you just run
scp ~/.ssh/id_rsa.pub root@your VoCore's IP:/etc/dropbear/authorized_keys
you will need to use your password one last time, from now on either ssh or scp will connect using your key for authorization.

Now that this is set up, using the VoCore’s IP is a pain as well, both having to type it and also because it may change from time to time. To avoid this I use avahi. In a ssh session on the VoCore you need a couple of packages:

opkg update
opkg install dbus avahi-daemon

If the opkg update returns an error then you need to set up a working opkg.conf. The openwrt snapshots have changed the layout of their package repository so you need something like this to access it:
src/gz base http://downloads.openwrt.org/snapshots/trunk/ramips/generic/packages/base
src/gz luci http://downloads.openwrt.org/snapshots/trunk/ramips/generic/packages/luci
src/gz management http://downloads.openwrt.org/snapshots/trunk/ramips/generic/packages/management
src/gz packages http://downloads.openwrt.org/snapshots/trunk/ramips/generic/packages/packages
src/gz routing http://downloads.openwrt.org/snapshots/trunk/ramips/generic/packages/routing
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

If you want to use my repository which mimics the original VoCore image you need this:
src/gz chaos_calmer_packages http://noblepepper.com/wp/wp-content/vocore-1.0b/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

For some reason the dbus/avahi configuration is not installed by the packages, you will need to get it like this:
cd /etc/dbus-1/system.d/
mv avahi-dbus.conf avahi-dbus.conf.orig
wget http://noblepepper.com/wp/wp-content/vocore-1.0a/avahi-dbus.conf
cd -

Now you need to enable and start the daemons like this:
/etc/init.d/dbus enable
/etc/init.d/dbus start
/etc/init.d/avahi-daemon enable
/etc/init.d/avahi-daemon start

Now you can use a name for your vocore instead of the IP, it is just the VoCore’s hostname followed by .local. You can see your hostname with
uci show system.@system[0].hostname
Which for me is VoCore, with some images it is OpenWrt. Now I connect to my VoCore like this:
ssh vocore.local

Since I am using linux I can also find the luci interface by entering vocore.local in my browser address bar, this should work out of the box for Apple users as well. If you are using windows you will need to install support for this, I believe the appropriate software is Bonjour

You should also go to System->System in luci and set the time zone to your location so the time is correct.

First steps in VoCore

When you first start working with OpenWrt it can be very confusing, hopefully this will help you get started. This page is oriented to the VoCore, but only a few details are specific to a VoCore since it is a fairly standard OpenWrt installation.

First you need to realize that the VoCore is based on the development trunk of OpenWrt which means things are always changing, each day there is a new build available from OpenWrt.org and this is where the VoCore is configured to get software packages. My VoCore came with an image based on the Linux 3.10 kernel, the latest builds are using a 3.14 kernel so you can’t use the kernel module packages unless you upgrade the kernel too. There are several configurations out there, some have no default password, others have the password set to vocore, some set a default IP of 192.168.61.1 others are set to 192.168.1.1. Of course you can (probably will) change this but when starting if the password or IP address doesn’t work, try the alternative.

When you first power up your VoCore it will open a WiFi access point with a ssid of VoCore_xxxxxx, connect your computer, smartphone, tablet whatever to this AP and open a browser and connect to the Luci configuration page. To do this enter the IP 192.168.61.1 in the address bar, if 192.168.61.1 doesn’t work try 192.168.1.1. This will give you the login page, log in and set a password by dropping down the system menu and taking the administration option.

You can wander around here and look at what is available but one of the first things I did was connect the VoCore to my home wireless network. It is easy to make the VoCore unreachable through the WiFi at this point so be ready to hookup the USB/Serial adapter to be able fix things. The key to not needing the adapter in the following is to NOT apply the changes until the very end, use the Save button NOT the Save & Apply button!

Here is how I set my VoCore up:
1. Drop down the Network menu and select WiFi, push the edit button and in the General Setup tab under Interface Configuration enter your network name for ESSID, select client in the Mode drop down, check the box by create and enter wwan for the interface name.
2. Press the Save button (not Save & Apply!).
3. Switch to the Wireless security tab and select your encryption type in the Encryption drop down and enter you network’s passphrase in the key field, push the Save button again.
4. Drop down the Network menu and select interfaces. On this page press the add new interface button and enter wwan for the Name of the new interface and select DHCP client for the Protocol of the new interface and check the radio button by Wireless Network and press the Submit button.
5. There should be a box at the top that says Unsaved Changes, click on this, double check the settings (especially the ESSID and passphrase) and then click the Save & Apply button.

The webpage will sit there forever with a spinning wheel because the VoCore has shutdown it’s AP and connected to your home network. Go to your wireless router’s dhcp client list and find the ip for the new connection, this is the VoCore so enter it in the browser’s address bar and login to the VoCore with the password you set.

gcc & g++ on an Arduino Yun

There is now a package available which will install GNU gcc on your yun, here is how I have it configured on my system. I was able to put together the openwrt package building on the work of dctsystems and some help from Federico Fissore. Sonnyyu has put out some great usage examples.

First to be sure I am starting with a clean slate I removed my microSD and flashed the latest Yun image (1.5.2) to my Yun using the Luci page at Backup Flash Firmware  with the keep settings box unchecked. This puts the Yun in a “factory” condition, so I needed to set my timezone and password and configure the Yun to connect to my WiFi network again. This step isn’t really necessary, I just did it to ensure I hadn’t forgotten anything needed to get gcc working.

Then I set my microSD up to be used as expanded disk space by the Yun. Follow the instructions here if you haven’t done this yet ExpandingYunDiskSpace. I used a 16gb UHS Class 1 microSD and set the data partition size to 11000MB which leaves just over 4GB for the system rootfs. The yun-gcc package definitely won’t fit in the space available unless you use a sd card, it doesn’t need to be 16GB, but they are cheap so I got a big one. Make sure you get a fast one, I tried some of this with an old Class 4 sd and it took over 3 times as long to accomplish things.

Next I installed some software we will want later. These commands in a ssh or terminal session will take care of this.

opkg update
opkg install binutils
opkg install make
opkg install tar

Now we are ready to install yun-gcc like this:

opkg -t /root install yun-gcc

This package will take about 20 minutes or more to install so be patient, once it finishes you will be ready to compile simple c or c++ programs. I prefer to download and install this package separately so I can see what is going on:

cd /mnt/sda1
wget http://downloads.arduino.cc/openwrtyun/1/packages/yun-gcc_4.6.2-2_ar71xx.ipk
opkg install yun-gcc_4.6.2-2_ar71xx.ipk

Most the examples sonnyyu gives in this forum thread should now work Example of Native GCC for Yun but with the ones that use a configure script, you should follow this first:

You need a real grep for many configure scripts to work, even the one that comes with grep (you need grep to compile grep???) the busybox version won’t suffice. You also need xz to uncompress the latest grep sources so here is how I dealt with it:

Download the grep sonnyyu provides a link to:

cd /mnt/sda1
wget -O grep_2.14-1_ar71xx.ipk https://www.dropbox.com/s/a9zuwmh3mipj7jt/grep_2.14-1_ar71xx.ipk?dl=0 --no-check-certificate
opkg install grep_2.14-1_ar71xx.ipk

This is enough to follow sonnyyu’s examples but I wanted to see if I could get the latest grep:

Download and compile xz:

cd /mnt/sda1
wget http://tukaani.org/xz/xz-5.0.7.tar.bz2
mkdir -p /usr/local/src
cd /usr/local/src
tar xvf xz-5.0.7.tar.bz2
cd xz-5.0.7
./configure
make
make install
cd ../

Traditionally, ./configure set things up to install in /usr/local so we need to add some things to our path:
export PATH=$PATH:/usr/local/bin:/usr/local/sbin

will add these to the current session, edit the fourth line in /etc/profile so they are available in future sessions:
#!/bin/sh
[ -f /etc/banner ] && cat /etc/banner

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export HOME=$(grep -e “^${USER:-root}:” /etc/passwd | cut -d “:” -f 6)
export HOME=${HOME:-/root}
export PS1=’\u@\h:\w\$ ‘

[ -x /bin/more ] || alias more=less
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi

[ -z “$KSH_VERSION” -o \! -s /etc/mkshrc ] || . /etc/mkshrc

[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }

Now we can download and compile the latest grep:

wget http://ftp.gnu.org/gnu/grep/grep-2.20.tar.xz
tar xvf grep-2.20.tar.xz
cd grep-2.20
./configure
make
make install
cd ../

You can uninstall the grep that came in the ipkg so most things will use the busybox version as expected and configure scripts that need full grep should be smart enough to find the one in /usr/local/bin:
opkg remove grep

Go try all the examples in sonnyyu’s post to make sure everything is working. We are working with a 400 Mhz single core cpu with very limited resources so expect things to take a while compiling but they should eventually get there!