JeVois  1.1
JeVois Smart Embedded Machine Vision Toolkit
Serial port user guide

The hardware serial port (UART port) on your JeVois smart camera is TTL-level (not RS-232 levels) and supports both 3.3V and 5V logic.

The logic voltage to use is supplied by the connected microcontroller to the smart camera (RED wire, IOREF voltage). This voltage should be provided by your micro-controller and should be the voltage at which your RX and TX signals operate). Arduino boards provide the IOREF pin for this purpose. Thus, a 5V Arduino will output 5V to IOREF, and will use 5V levels for RX and TX. In contrast, a 3.3V Arduino will output 3.3V to IOREF and will use 3.3V levels for RX and TX.

To connect to an Arduino board, you would typically do as follows:

Make sure that you do not use voltages in excess of 5.5V on all pins, otherwise you may damage your JeVois unit.
Power consumption on the serial port (all pins combined) is less than 1mA. Hence, it is apporpriate to directly use the IOREF pin of any Arduino (which, often, is rated for 50mA or less) with JeVois.
JeVois is not powered through the pins on the 4-pin serial connector. IOREF is only providing a voltage reference that determines which voltages should be used on the RX and TX pins, but IOREF is not connected to the main power supply of JeVois in any way. JeVois is exclusively powered through the mini-USB connector.

Changing the serial port settings

You can customize the settings of the serial port to match what your microcontroller can support, by editing the file JEVOIS:/config/params.cfg on your microSD card (source in ~/jevois/Config/params.cfg). The following options are supported (see The jevois-daemon executable for more configurations options supported at startup, and see jevois::Serial for full documentation of the serial interface):

  • serialdev - name of the serial device. The hardware serial port for the 4-pin connector is always /dev/ttyS0 on the JeVois platform.
  • serial:mode - Terminal emulation mode for input, should be Plain or VT100. Default is Plain.
  • serial:baudrate - baud rate to use. Should be one of 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000. Default is 115200. Note that some of the values listed here, which are supported by the hardware in theory, do not seem to work. Some tuning of the serial drivers for Allwinner chips in the Linux kernel may be required. The value 9600 has been confirmed to work and it what you should use if piping the serial data over a Bluetooth BLE link.
  • serial:linestyle - End of line style: should be
    • LF for 0x0a [\n];
    • CR for 0x0d [\r];
    • CRLF for 0x0d 0x0a [\r\n];
    • Zero for 0x00 [\0];
    • Sloppy for any of CR, LF, CRLF, 0xd0 (issued by some keyboards instead of Return), or Zero as input, and CRLF as outputs. Sloppy is the default.
  • serial:format - Data format. Should be a string with 3 characters:
    • Number of data bits: 5 to 8, default is 8
    • Parity: N for none, O for odd, E for even. Default is N
    • Stop bits: 1 or 2. Default is 2
    • Example: 8N1 (default)

For example, to reduce the serial rate to 9600 bauds when piping teh serial data to a Bluetooth BLE transmitter, params.cfg should contain:

The first line (serialdev=/dev/ttyS0) is necessary for the other options to be accepted. This is because, otherwise, the serial port is left undefined (serialdev is empty by default) until after params.cfg is parsed, and will be assigned a default value of /dev/ttyS0 later when jevois-engine starts its operations.

Wireless serial using bluetooth low energy (BLE)

We have successfully used an Adafruit Feather 32u4 Bluefruit LE to transmit JeVois serial data over bluetooth. Using this, you can control JeVois from a tablet running a bluetooth serial app (such as the BlueFruit app).

We connected its serial pins to the serial port of JeVois, and wrote a trivial piece of code that would just forward serial data between the serial pins and the BLE module of the Feather. It worked well at 9600 bauds but choked at 115200 bauds. Looks like serial transmission over BLE is limited to 9600 bauds. Have a look in JEVOIS:/config/params.cfg for config options we used when transmitting serial data over Bluetooth. Other serial-to-BLE modules are available and should work fine as well, but we have not yet tested. The main drawback with the Feather 32u4 Bluefruit LE is its price ($30).