Ollie v2

An even better all-in-one USB to isolated-UARTx2/CAN/RS485/RS232 converter

Sep 07, 2023

Project update 2 of 6

USB High Speed & API Example

by Ali Slim

While the original version of Ollie was compatible with multiple CAN firmware versions, Ollie v2 currently supports only one firmware based on the LAWICEL protocol. However, a significant advantage of Ollie v2 is its use of a USB High Speed interface, which allows access to the CAN bus at its maximum speed. In contrast, most other adapters use a USB Full Speed CDC interface, which has a one-millisecond framerate with a maximum of 64 bytes per frame, so isn’t capable of operating at the CAN bus maximum speed.

Moreover, Ollie v2 provides a robust API supporting multiple programming languages, including C#, C, and Python, for both Windows and Linux platforms. Here’s a brief Python example to demonstrate how to use the Ollie v2 CAN interface.

import sys
import time

import can

# run ollie_v2.sh to rename COM port interface
CAN_DEV = '/dev/MEATPI-CAN0'

def main():
    """main routine."""
    try:
        bus = can.interface.Bus(bustype='slcan',
                                channel=CAN_DEV,
                                bitrate=1000000)
    except Exception as err:
        print(err)
        sys.exit(1)

    # send standard frame
    msg = can.Message(arbitration_id=0x100,
                      extended_id=False,
                      data=[0x00, 0x01, 0x02, 0x03])
    bus.send(msg)

    # send extended frame
    msg = can.Message(arbitration_id=0x100,
                      extended_id=True,
                      data=[0x00, 0x01, 0x02, 0x03])
    bus.send(msg)

    # send RTR frame
    msg = can.Message(arbitration_id=0x100,
                      extended_id=True,
                      is_remote_frame=True)
    bus.send(msg)

    time.sleep(5)

    bus.shutdown()


if __name__ == '__main__':
    main()

Sign up to receive future updates for Ollie v2.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects