The result of a blogging accident

Belated announcement: tollgate source released

Last weekend, tollgate’s source code was released. This is the project formerly known as portal2, which ran the captive portal system at StreetGeek and SAGAfest from January 2009 to September 2010. It’s a quota-managed captive portal system for Linux mainly aimed at LAN parties.

There’s a number of improvements in 2.8.4’s development branch already over 2.8.3:

  • Local sign-in and events management system.
  • Port forwarding system.
  • Migrating several systems over so they work with Django 1.2, and removing some older legacy code.
  • All the local authentication hacks have been eliminated.
  • Fixed XSS issue in captive landing page.

The code is released under the GNU Affero General Public License v3, and is available from my GitHub repository.

At some point in the future this’ll be pulled into a 2.8.4 release, after some further janitorial work is done. It’s been sitting around for a little while, may as well get it out there now. Eventually this will be migrated to become a part of the LanConnect project, with optional integration with it’s databases.

Vuzix Wrap 920 VGA on Linux

The Vuzix Wrap 920 are entry-level VR glasses. (Not to be confused with the 920VR, which has a USB interface that operates differently.)

There is a VGA adapter available for them, however I notice that the buttons on the controller and menus do not operate properly on Linux – after the first button press, the menu stops responding. This makes it impossible to select 3D mode or adjust any settings.

The controller works fine on Mac OSX and Windows in my tests, which left me scratching my head. It also works fine when you plug the VGA of a Linux box into it, and USB into another computer. I’ve also tried it with several other configurations, where I had a powered hub not connected to upstream USB, and plugging it into an iPhone USB wall charger, and still wouldn’t work.

Turns out, the controller presents in addition to a USB interface (1BAE:014B) for an internal sound card, a HID interface for the (optional) head tracking module. Linux doesn’t know how to handle it, so it presents it as a “hidraw” interface (typically /dev/hidraw0). You just need to read from the device, and suddenly it starts working! You can’t just ignore the device entirely (with a usbhid quirk or unloading the module), you must read from it otherwise events are blocked. This is probably due to a bug in the VGA adapter firmware, but was never found because Linux isn’t a supported platform.

This is simple to deal with. As root, run: dd if=/dev/hidraw0 of=/dev/null.

All the events will be read from the device, and simply discarded. If you watch it with hexdump, there’s some events that come up whenever you press a button on the controller. In the end, they don’t matter. I haven’t looked much in to it yet, but there’s probably a way that you could parse them, and possibly even reconfigure the device from software. This is needed regardless of whether you have the optional head-tracking sensors installed – I don’t have them.

I think that Mac OSX and Windows both do this in-kernel when it doesn’t know how to handle events, it’s probably just a quirk in how Linux handles these devices.