# Connecting Teensy to VOXL 2

Source: https://forum.modalai.com/topic/4111/connecting-teensy-to-voxl-2
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Tags: voxl2
Posted: 2025-01-22 00:03:19 UTC by bkim1301
Replies: 1 · Views: 1546

## bkim1301 · 2025-01-22 00:03:19 UTC

I purchased a Starling 2 Max drone, and want to connect a Teensy 4.1 to the UART7 port on the M0151 B2B expansion. I followed the instructions for [VOXL 2 Connecting an External Flight Controller](https://docs.modalai.com/voxl2-external-flight-controller/#using-usbuart-addon-board-m0125-or-m0151), to get pinouts and ran a pyserial script from the home directory of the VOXL to test sending messages for the Teensy to read. Debugging with pyserial indicates that I connect to /dev/ttyHS1, but I do not read anything from the Teensy. 
```
#!/usr/bin/env python3

import sys
import serial
import time

class SerialPort:
    def __init__(self, port='/dev/ttyHS1', baudrate=115200):
        try:
            self.ser = serial.Serial(port=port,
                                     baudrate=baudrate,
                                     bytesize=serial.EIGHTBITS,
                                     parity=serial.PARITY_NONE,
                                     stopbits=serial.STOPBITS_ONE,
                                     timeout=1.0
                                    )
            print(f"Connected to {port} at {baudrate} baud")
        except serial.SerialException as e:
            print(f"Error opening serial port: {e}")
            sys.exit(1)

    def write(self, data):
        """Write data to serial port"""
        try:
            self.ser.write(data.encode())
            self.ser.flush()
        except serial.SerialException as e:
            print(f"Error writing to serial port: {e}")

    def close(self):
        """Close serial port"""
        if self.ser.is_open:
            self.ser.close()

def main():
    # Initialize serial port
    ser = SerialPort()

    # Run TX/RX test (Send test messages)
    try:
        while True:
            # Send test message
            ser.write('Test\n')
            print("Sent: 'Test'.")

            # Wait before next test run
            time.sleep(1)

    except KeyboardInterrupt:
        print("\nClosing serial port...")
    finally:
        ser.close()

if __name__ == '__main__':
    main()
```
What are possible next steps? Different changes to config files than documentation? Logic level shifter? 

TL;DR: I want to connect a Teensy to VOXL2 via UART7 port using standard Linux practices. 

Thanks!

## Reply by Eric Katzfey (ModalAI staff) · 2025-01-22 16:35:26 UTC

@bkim1301 I would start by connecting the VOXL 2 UART 7 to a PC with a serial to USB cable. Make sure you can communicate back and forth using that setup and then do the same with the Teensy before connecting the Teensy and the VOXL 2 together. It's often very helpful to use an oscilloscope on the rx / tx lines to verify that there is actually data flowing.
