> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oryx.mechatronstudio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect the device

> Linking an ESP32 generator over USB, sending it the signal and controlling it.

The app can send the signal you have open to an **ESP32 generator** and play it
on its outputs.

<Note>
  The link is **point to point**: everything happens between your computer and the
  device. There is no server in between, no account, and nothing goes out to the
  internet.
</Note>

## Requirements

| What     | Detail                                                                    |
| -------- | ------------------------------------------------------------------------- |
| Board    | A classic ESP32 (WROOM / DevKit v1)                                       |
| Firmware | The Oryx Signal sketch, flashed once. See [Firmware](/en/device/firmware) |
| Cable    | The same one you flash the sketch with                                    |
| Browser  | Chrome, Edge, Opera or Firefox                                            |

<Warning>
  **Safari cannot talk to the serial port**, so there the option is not offered. If
  your browser does not support it, the app says so: *"This browser cannot talk to
  the serial port."*
</Warning>

## Connecting

<Steps>
  <Step title="Leave the board plugged in">
    Over USB, with the usual cable.
  </Step>

  <Step title="Open Device → Choose port">
    The browser shows the list of ports and you pick the board's.
  </Step>

  <Step title="Wait for the handshake">
    The app introduces itself and keeps retrying until the device finishes
    booting and answers.
  </Step>
</Steps>

There is no network to switch and no address to find out.

<Tip>
  Opening the port **resets the board** on almost every development module,
  because the USB converter uses those same lines for auto-boot. The app does not
  fight it: it keeps trying until the device answers.
</Tip>

### If something fails

| Message                                    | What to check                                                         |
| ------------------------------------------ | --------------------------------------------------------------------- |
| *No port was selected*                     | The browser dialog was cancelled                                      |
| *The port could not be opened…*            | The Arduino IDE serial monitor is open and holding the port: close it |
| *The device did not answer*                | The board does not have the Oryx Signal firmware                      |
| *The device runs another firmware version* | Reflash it with the sketch that ships with this version of the app    |
| *The link with the device was lost*        | The cable came loose or the board reset                               |

## Sending the signal

The device plays back **from its own memory**: first you send it the whole
signal and only then tell it to start. Once loaded, it keeps playing even while
you edit something else on screen.

The panel shows a summary —*"3 channels · 240 steps"*— and the send status:

| Status                                        | What it means                            |
| --------------------------------------------- | ---------------------------------------- |
| **Nothing sent yet**                          | The device is empty                      |
| **Sending…**                                  | The signal is on its way                 |
| **The signal is on the device**               | What is inside is what you see on screen |
| **The signal changed since it was last sent** | You edited something: send it again      |

<Note>
  What comes out of the device is exactly what you drew, including the analog
  curves with their rounding.
</Note>

### Adjustment notices

If what you see on screen does not fit into the device as is, the app tells you
before sending:

| Notice                                                                                                         | What happened                             |
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| *The device has N outputs for this mode: the extra channels are not sent*                                      | There are more channels than pins         |
| *The signal is empty: there is nothing to play*                                                                | Nothing is drawn                          |
| *The signal does not fit in the device memory at the requested resolution: it is sent with N samples per step* | The resolution was lowered to make it fit |

## Controlling playback

| Button                         | What it does                                      |
| ------------------------------ | ------------------------------------------------- |
| **Start signal**               | Starts playback                                   |
| **Stop signal**                | Stops it                                          |
| **Restart from the beginning** | Goes back to the start and zeroes the lap counter |

## Live parameters

<AccordionGroup>
  <Accordion title="Voltage">
    In **analog**, it is the amplitude of what the DAC puts out, between 0 and
    3.3 V.

    In **digital**, a pin swings between 0 and 3.3 V and knows nothing of
    intermediate levels. There this value goes out as a **reference voltage** for
    the external stage —divider, buffer or level shifter— that sets the real pulse
    height.

    <Warning>
      Without that external stage, in digital the pins always output 3.3 V and the
      voltage setting changes nothing.
    </Warning>
  </Accordion>

  <Accordion title="Step time">
    How long each step of the signal lasts, in microseconds.
  </Accordion>

  <Accordion title="Cycles (RPM)">
    At **0**, the step time rules.

    Above **0**, one full pass of the signal is one engine revolution:

    ```
    step time (µs) = 60 000 000 / (rpm × total steps)
    ```

    This is what turns a CKP signal into an engine speed sweep.
  </Accordion>
</AccordionGroup>

<Note>
  Changing the step time or the cycles **restarts the pass in progress**, so the
  change shows on the oscilloscope right away. The lap counter is not zeroed: that
  is what *Restart* is for.
</Note>

## If the cable comes loose

The signal stops on its own and the outputs go low. It is on purpose: the device
cannot find out that you closed the tab, so if it goes a while without receiving
anything it treats the link as finished.

Connect again and resend the signal to carry on.

## Board outputs

| Mode        | Where it comes out                                                         |
| ----------- | -------------------------------------------------------------------------- |
| **Digital** | GPIO 16, 17, 18, 19, 21, 22, 23, 13 — one pin per channel, in editor order |
| **Analog**  | GPIO 25 (DAC1) and GPIO 26 (DAC2) — up to two channels                     |

In digital, the voltage value comes out on **GPIO 25** as a steady reference
voltage.
