Connect PC Directly

Bernd Lietzow edited this page Dec 19, 2012 · 1 revision
Clone this wiki locally

Connect your PC directly to Hexabus

This guide deals with setting up your Hexabus so that it's directly connected to your Linux PC. If you want to use an OpenWRT router, please refer to the page Routing Hexabus Packets.

Please note: There is no native Windows support for HexaBus devices at the moment. However, under HexaBus virtual machine a workaround using a virtual linux machine can be found.

Set up your USB stick

Put your USB stick into your PC. It may take a few seconds until the lights start flashing. When the green light is on constantly, the stick is ready.

The stick will provide your PC with a network interface named usb0. Just type ifconfig usb0 up to activate it. Since the USB stick knows its own address, it should just work from now on. If you use an automatic network configuration tool (like NetworkManager which comes with Ubuntu), tell it not to try to get an IPv4 address on the interface, and set the IPv6 address configuration to manual.

Choose an address prefix which you want to use (caca is used in the instructions below) and enter the address which is printed on the USB stick into the address field of your NetworkManager, replacing the default prefix fe80 with your own. Under prefix, you should enter 64.

screenshot from networkmanager

If you set up your network through the command line interface, you should also add the global IP (the one with your prefix) to the interface. Don't forget to replace the address with the one which is printed on the USB stick.

ifconfig usb0 add caca::50:c4ff:fe04:13/64

Now pair your Hexabus Plugs with your USB stick. To do this, press the button on the stick with a Hexabus PairingDevice until the red light starts flashing. Now press the button on the Plug until the red light starts flashing. After a few seconds, both the light on the plug and the one on the stick should flash green a few times. Your Hexabus devices are now paired and ready to communicate with each other.

hexabus pairing device

All Plugs paired to the same stick can also communicate amongst each other.

From your PC, you can ping the Plugs by entering the command ping6 -Iusb0 fe80::... (enter the address printed on the bottom of the plug). The fe80::...-addresses are link-local addresses. As long as you don't use radvd, you can only use those. The problem with them is that you always have to specify an interface when using a link-local address (that's what the -Iusb0 is for).

Set up radvd

In order to use global IPv6 addresses, you have to install the router advertisement daemon radvd. It should be in your distro's packet manager. Set up the configuration file /etc/radvd.conf with the following content:

interface usb0
  AdvSendAdvert on;
  AdvLinkMTU 1280;
  AdvCurHopLimit 128;
  AdvReachableTime 360000;
  MinRtrAdvInterval 100;
  MaxRtrAdvInterval 150;
  AdvDefaultLifetime 200;
  prefix caca::/64
    AdvOnLink on;
    AdvAutonomous on;
    AdvPreferredLifetime 4294967295;
    AdvValidLifetime 4294967295;

See the line prefix caca::/64? Replace the caca with the prefix you chose earlier. Now start radvd (just enter sudo radvd or use some startup script, probably your radvd package came with one).

Now you should be able to ping your plugs with the global IP addresses. Just enter ping6 caca::... (your own Plug's IP address, of course). Replace the caca:: with your prefix. Notice that you don't need the -Iusb0 any more.