Connecting ========== The Teensy has two primary ways of being connected: USB2 and Ethernet. This section is about connecting via USB while the :ref:`networking` section is about Ethernet. Being able to connect to the device is the prequisite to be able to :ref:`flash ` the device over USB. .. note:: Teensy has multiple USB operating modes. However, only two of them are neccessary: Bootloader mode and Serial terminal mode. If your device is in some other mode, try to power cycle it or to load a new firmware. USB Serial terminal connection ------------------------------ The Teensy contains a USB CDC device, i.e. it is a virtualized usb serial port which is completely agnostic to serial device parameters such as baud rate, stop bits, etc. This means you can use your favourite serial terminal to communicate with the teensy. Valid examples are GNU ``screen`` or the Arduino built in terminal. If you have :ref:`PlatformIO ` installed, you can invoke the command ``pio device monitor`` which automatically searches for the correct device port. The terminal speaks JSON. Try typing in ``{'type':'ping'}`` and hit enter to see the reply. If you type in any non JSON text, you should get an error message. The firmware terminal has no readline support and does not support control characters such as arrows or the deletion key. .. _udev: Neccessary ``udev`` rules on linux to connect Teensy via USB ------------------------------------------------------------- When you start on a fresh Linux PC, you need to make sure to be able to reach out to the Teensy via USB via the ``/dev/ttyACM0`` file. You can grab them at https://www.pjrc.com/teensy/00-teensy.rules . You should also ensure to be in the correct user group to access this file; after adding yourself to the group (such as ``sudo gpasswd -a YOUR-LOCAL-USERNAME dialout``), you have to sign out and sign in again on your desktop. This procedure is not neccessary on Mac or Windows. Finding the USB device on Mac ----------------------------- Sometimes it can be hard to find the proper Teensy USB device file on Mac. The proper serial terminal device file can be found with ``ls /dev/cu.usbmodem*``