In order to build SlimeVR firmware and upload it to your tracker, you need to configure the project to match your specific hardware configuration. To do this, you need to modify two files:
- 1. Configuring platformio.ini
- 2. Configuring defines.h
platformio.ini file specifies the information about your MCU.
This file can be found in the root directory of the project:
The contents of
platformio.ini file should look as follows:
This field set your serial monitor speed in VSCode
monitor_speed = 115200. Change this if your board datasheet and documentation suggest so, but the defaults should work.
Important: Other env lines must be commented out with preceding semicolon (
If you’re using a board on ESP8266 processor, uncomment the following lines:
[env:esp12e] platform = espressif8266 board = esp12e
If you’re using a board on ESP32 processor, uncomment the following lines:
[env:esp32] platform = espressif32 board = esp32dev
If you’re having problems with setting the wifi credentials through the server, you can hardcode your wifi credentials to firmware.
To hardcode your wifi credentials, uncomment the following lines and replace
PASSWORD with your corresponding wifi credentials:
If you are having problems getting the tracker to connect to your Wi-Fi, review these troubleshooting steps:
- If your wifi password contains the
%character, replace it with
- If your network SSID contains non-alphanumerical characters, the tracker could fail to connect
- The ESP8266 and ESP32 only support 2.4GHz network bands.
defines.h file specifies the information about your IMU and MCU.
This file can be found in the
src directory of the project:
You can either edit the defines.h file manually or use the tool below to generate the contents of the file.
Select how you built your SlimeVR tracker:
After selecting the settings above, you can either:
- Use the download button below and replace your defines.h file.
- Copy and paste from the text field below into your IDE (such as VSCode).
If you have used the above tool, you are finished with the defines.h file.
You can also configure the defines.h file manually instead of using the tool above. Before any changes to the file, the contents of
defines.h file should look as follows:
First you need to change these lines to define your IMU model and MCU:
// Set parameters of IMU and board used #define IMU IMU_BNO085 #define BOARD BOARD_SLIMEVR #define IMU_ROTATION DEG_90 #define SECOND_IMU_ROTATION DEG_270 #define BATTERY_SHIELD_130K false
The following line defines which IMU is present:
#define IMU IMU_BNO085
To change IMU model, replace
IMU_BNO085 with one of the following values depending on your IMU model:
IMU_MPU9250 IMU_MPU6500 IMU_MPU6050 IMU_BNO080 IMU_BNO085 IMU_BNO055 IMU_BNO086
The following line defines which MCU board is present:
#define BOARD BOARD_SLIMEVR
To change the board model, you must replace
BOARD_SLIMEVR with one of the possible values:
- For most boards with ESP8266, set it to
BOARD_NODEMCU. For Wemos D1 Mini, you can use
- For boards with ESP32, set it to
- For other boards that don’t follow the pinouts of any defined board, set it to
BOARD_CUSTOMand define the pins yourself.
The following lines define the rotation of your IMU boards:
#define IMU_ROTATION DEG_90 #define SECOND_IMU_ROTATION DEG_270
To change the IMU board rotation, replace
DEG_270 if you have auxiliary IMU) with one of the following values. Top of this picture is the ceiling (or your head) and IMU facing away from you when mounted on the body.
#elif BOARD == BOARD_NODEMCU || BOARD == BOARD_WEMOSD1MINI #define PIN_IMU_SDA D2 #define PIN_IMU_SCL D1 #define PIN_IMU_INT D5 #define PIN_IMU_INT_2 D6 #define PIN_BATTERY_LEVEL A0 #define BATTERY_SHIELD_130K true
#elif BOARD == BOARD_WROOM32 #define PIN_IMU_SDA 21 #define PIN_IMU_SCL 22 #define PIN_IMU_INT 23 #define PIN_IMU_INT_2 25 #define PIN_BATTERY_LEVEL 36 #define BATTERY_SHIELD_130K true
#elif BOARD == BOARD_CUSTOM // Define pins by the examples above #define PIN_IMU_SDA 5 #define PIN_IMU_SCL 4 #define PIN_IMU_INT 14 #define PIN_IMU_INT_2 13 #define PIN_BATTERY_LEVEL A0
SDA and SCL pin for main and AUX trackers are always the same. You can define pins either by using pin name, like
D1, or by pin number, like
21. Check you board pinout for the details, or connect your tracker to the default pins, they’re recommended ones.
You need to put here your selected pins for I2C. Check pinout for details in terms of which ports could be used for I2C.
#define PIN_IMU_SDA D2 #define PIN_IMU_SCL D1
If you are using BNO you need to define INT pin:
#define PIN_IMU_INT D5
If you are using the second BNO you need to define INT pin for the second BNO, it must be another pin:
#define PIN_IMU_INT_2 D6
You need to change only the section between
#elif symbols with the selected board. If you are using VSCode, selected board section will light up, while other ones will be grayed out.
Battery level pin guide WIP.
Your firmware for your MCU and IMU configuration should now be complete!
Next step - Uploading the firmware
Created by adigyran#1121 with help from Musicman247#1341, edited and styled by CalliePepper#0666 and Emojikage#3095