Skip to content

Use third-party boards

Totem Library supports all ESP32 based development boards. It includes required functionality for X4 Module and allows to use some features with third-party development boards.
Irrespective of product, all ESP32 MCU has integrated BLE connectivity. Library utilizes it by allowing to connect and control Totem modules wirelessly.
For using with X4 Module - set up with Totem.X4.begin().
For using BLE feature with third-party boards - set up with Totem.BLE.begin().
For more about interfaces - read Interfaces information.

Notice

Totem.X4.begin() should be used when compiling code for X4 Module. Using this initialization for other boards will result in runtime error.
X4 Module is able to use both interfaces at the same time, if required:

void setup() {
    Totem.X4.begin();
    Totem.BLE.begin();
}

Using library with ESP32 DevKitC

ESP32 Devkit

To set up a project with ESP32 DevKitC follow these steps:

  1. Click + New Project. Project Wizard will open.
  2. Fill in fields:
    Name: type in any project name.
    Board: select Espressif ESP32 Dev Module.
    If using another board that is listed - select it.
    Framework: select Arduino Framework.
  3. Click Finish and project will be created.
  4. PlatformIO icon → PIO HomeLibraries → Tab Installed → select Totem Library.
  5. In Examples tab select "BLE\X3_FBI_LedBlink".
    Or "BLE\X4_LedBlink" to control X4 board.
  6. Copy all X3_FBI_LedBlink.ino file content to src/main.cpp file (located in Explorer).
    Click View → Explorer if you don't see project files list.
  7. Make sure initialization is set to Totem.BLE.begin() inside setup() function.
  8. Connect ESP32 DevKitC to PC.
  9. Select PlatformIO: Upload.
    At this stage code should compile without errors and upload to ESP32 DevKitC.
  10. Now select PlatformIO: Serial Monitor and you should start seeing text displayed.
  1. Select ToolsBoardESP32 ArduinoESP32 Dev Module.
    If using another board that is listed - select it.
    Other default settings:
    Upload Speed: 921600
    CPU Frequency: 240Mhz
    Flash Frequency: 80Mhz
    Flash Mode: QIO
    Flash Size: 4MB
    Partition Scheme: Default 4MB with spiffs
    Core Debug Level: None
    PSRAM: Disabled
  2. Click FileExamples.
  3. Scroll down to Examples from Custom Libraries.
  4. Select Totem Library and open "BLE → X3_FBI_LedBlink" example.
    Or "BLE → X4_LedBlink" to control X4 board.
  5. A window will open with selected project.
    If modifying an example project - Arduino IDE will ask to save it as a new project.
  6. Make sure initialization is set to Totem.BLE.begin() inside setup() function.
  7. Connect ESP32 DevKitC to PC.
  8. Click ToolsPort and select port displayed there.
    If Port is not available - check if board is on and plugged to PC with USB cable.
    If there are multiple ports, disconnect USB cable and check which one is gone. Reconnect and select it.
  9. Click ToolsSerial Monitor. A window will open. It will display output from connected board. Leave it open.
    Set baud to 115200.
  10. Click SketchUpload and wait till it completes.
    At this stage code should compile without errors and upload to ESP32 DevKitC.
    After upload, you should start seeing text displayed in Serial Monitor.