Controlling the LURC

The first version of the 'front end' is basically a serial program running on the bifferboard, controlled over ssh. There are a few things we can use to send hex values from the linux command line. The first is minicom, which is hard to learn and was designed more for modems than byte banging. Minicom also requires you to do some fancy piping to make it output hex. The second option, which is simple and works, is python serial. As python has a command line interpreter, it's very quick and easy to do (example is below). The third option is a program written in by LyndonWhite called gen1 which uses c++ libserial. This also works, but hasn't been extensively tested. The source for gen1 is in the project repo on the main page. Instructions and some documentation is also below.

A Note about Licenses

Any Code found in the is not released for public or public use, or viewing. All Rights Reserved Lyndon "Frames" White, including the right to relicense. License for release is Pending. All Files in that Repository are Property of Lyndon "Frames" White and or BobTech

formatted string containing value expressions

Before I start on actual programs an explanation of: "formatted string containing value expressions" and how to encode values in them.

The formatted string containing value expressions is at the core of doing low level transmission. We know the decimal 65, hex 41, binary 0100 0001, and the ascii character 'A' all have the same binary representation, so to tell which we are using we have a series of deliminators - numbers preceded by:
# are decimal
$ are Hex
@ are binary
No deliminator, then ascii.

Putting a sign indicator after the deliminator is optional. It is required if you want to send a negative number.

You may put muliple values in the same string. eg: "a#21@1001111$-0F"

All values in a formatted string containing value expressions must be in the range -128 to 255 (inclusive) as they must fit in 8bytes (other values will cause an error). Negative numbers have the compliment of 2 representation for their binary form.

There are some problems with ascii - characters that can't be sent (in future versions this will be fixed by giving ascii a delineator and some more code to make that deliminator work, I think).
Characters that can't be sent:

  • The delineator characters: $#@
  • Numbers written immediately after a value that could have contained those digits:
    • 0,1,2,3,4,5,6,7,8,9 for decimal
    • 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,A,B,C,D,E,F for hex
    • 0,1 for binary

The code for this is normally in str2num.c[pp] (pipedream has it in its main (only file), bad coding practice I know)

Note: the Python (pySerial) Method uses a differnt way of deliminating various values, please see the Python Documentation for details the formatted string containing value expressions is only for PipeDream/Gen1

Minicom + PipeDream

Software Requirements

you may need to compile pipedream: g++ -o pipedream pipedream.cpp

About Pipedream

Pipedream is a direct derivative of str2Num.c[pp] (a twig , branching from a twig). It's basically str2Num made into a program. As such, it may refers to itself as str2num inside the source files (which you should read, they have some documentation in them)

How Pipedream works/how to use pipedream

Pipedream is a command line app that takes two parameters:

  1. A filename which is to be ignored (this is to get around minicom's desire to send files, using protocols)
  2. A formatted string containing value expressions (see above). If this parameter has a hash (#) in it you will need to put the whole string in quotes (" "), otherwise zsh will treat everything after the # as a comment, and won't pass it as a parameter.

Similarly for spaces, if there's a space in the parameter, put the whole parameter in quotes

Pipedream converts that string into its values, and then writes them to stdout. Any errors are written to stderr, and the program terminates.

Using Pipedream with minicom

First start minicom: minicom -o Check the settings are ok: port: /dev/ttyS0, Baud: 19200bps, 8N1. Now we need to set up minicom to use pipedream as a protocol. Press Ctrl-a, z to bring up the menu, then O to access configure minicom. (you could immediately press Ctrl-a, O). You can also check the port settings while you are here. Then go down to protocols and add it as a protocol - match the settings used for the ascii protocol already there, except the name will be pipedream, and the path is the path to the pipedream executable (if your started minicom in the pipedream folder then this is ./pipedream). While still in this "window", change the setting "use window for file selection" to No. Exit all menus.

Now pipedream has been set as a protocol for sending. This means that it's stdout has been redirected to the serial port, and that its stderr has been redirected to your screen.

Now send something with pipedream: Press Ctrl-A, S and select the pipedream protocol. Now you are asked for a file, give the path to any file, (I suggest making one in the folder you are in before you start minicom). Then put a space, and type the other parameter, the formatted string containing value expressions (see above)

Python Serial

Fire up python from command line and type the following (note you have to have python serial installed):

   1 import serial
   2 ser = serial.Serial('/dev/ttyS0', 19200)
   3 ser.write('\xd2\x80')

The final write command will send 0xd2 then 0x80, which in our case is used to turn the motor on.


gen1 is the first program built expressly for communicating with the AVR SerialComms (the so called "Oxinabox Lightweight Serial Protocol for Long-Range University of Western Australia Computer Club Cars). It doesn't do anything special, just sends the values of formatted strings containing value expressions out a serial port.

Software required:

gen1: You may need to build it - just use the make command.

Start it with sudo ./gen1
It takes 1 parameter, the device name for the port you want to transmit on. Once it gets started, you can type in formatted strings containing value expressions and then press enter and it will send them, and then be ready to go again.


Gen1.5 will also recognise Commands as detailed in cmdTable.h, but that's a future release.


The first release that does not run directly on the bifferboard. May have an ssh built into it, to communicate with gen1.5, on the bifferboard. Has a GUI, and the webcam diplay built in.


The Goal release, probably an upgrade of gen2. It supports the steering wheel and foot pedals.

A Note about Licenses

Any Code found in the repository is not release for public or public use, or veiwing. These Links are for internal use of BobTech only. All Rights Reserved Lyndon "Frames" White, including the right to reliscense. Liscense for release is Pending. All Files in that Repository are the Sole Property of Lyndon "Frames" White and or BobTech