Legacy FreeBSD serial IO with Freetronics Leostick

Freetronics (www.freetronics.com) builds an Arduino Leonardo compatible device called the Leostick (www.freetronics.com/collections/arduino/products/leostick) that plugs in to a USB port and provides a builtin serial, keyboard and mouse emulation. Unfortunately, versions of FreeBSD before 9.0 don’t recognise the serial port. A hacked version of the FreeBSD modem driver can be created to allow communication with the Leostick.
The Leostick can be programmed with both its own firmware and the Arduino Leonardo firmware. There is a slight coding difference between the 2 in that the Arduino Leonardo firmware provides a test to see if the serial port is initialised and the Freetronics version does not.

Their respective vendor and product ids are:

0x2341 0x8036 Arduino Leonardo
0x2341 0x0034 Freetronics LeoStick v2.0

My slightly hacked version umodem can be found here: www.castro.aus.net/~maurice/OddsAndEnds/resources/uleo.tar.gz and has been tested on FreeBSD 5.41 (please note I have not tried programming the device via this driver only accessing the serial interface provided by the programmed device). The main changes in the code were:
  • adding the manufacturer and product to the products table
  • removing a test for CM over data

1 For very painful reasons I still have a few legacy FreeBSD boxes driving exotic hardware and needed to extend their ability to control additional hardware hence the need for an Arduino controlling a switch and the Leostick is a very low cost solution.