Building WiCAN Pro Firmware (Forked)
This guide provides step-by-step instructions for setting up the ESP-IDF v5.5.3 environment and compiling the wambs/wican-fw fork on Linux (Ubuntu/Debian and openSUSE). We use an isolated directory approach to ensure this specific toolchain doesn't conflict with any existing ESP-IDF installations on your system.
1. Install System Prerequisites
Before downloading ESP-IDF, your Linux distribution needs several C-compilers, Python virtual environments, and USB libraries.
For Ubuntu / Debian
Open your terminal and run:
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
For openSUSE (Leap or Tumbleweed)
Open your terminal and run:
sudo zypper refresh
sudo zypper install -y git gcc make wget flex bison gperf python3 python3-pip python3-venv cmake ninja ccache dfu-util libusb-1_0-0 libffi-devel libopenssl-devel
2. Set Up ESP-IDF v5.5.3
The WiCAN Pro fork relies on ESP-IDF v5.5.3. We will install it into a dedicated ~/esp directory.
1. Create the workspace and clone ESP-IDF:
In your terminal and run:
mkdir -p ~/esp
cd ~/esp
git clone -b v5.5.3 --recursive [https://github.com/espressif/esp-idf.git](https://github.com/espressif/esp-idf.git) esp-idf-v5.5.3
2. Run the installation script:
This downloads the specific XTENSA toolchains and Python packages required for this version.
In your terminal and run:
cd esp-idf-v5.5.3
./install.sh all
3. Export the environment variables:
Note: You must run this command every time you open a new terminal window to compile the firmware. In your terminal and run:
. ./export.sh
3. Clone the WiCAN Fork
With the ESP-IDF environment active, pull down the custom fork. The --recursive flag is critical to ensure Git pulls in all required submodules. In your terminal and run:
cd ~/esp
git clone --recursive [https://github.com/wambs/wican-fw.git](https://github.com/wambs/wican-fw.git)
cd wican-fw
4. Build and Flash the Firmware
You are now ready to compile and flash the firmware to your WiCAN Pro.
1. Clean the build environment (Recommended):
Ensures no old artifact files conflict with your current setup. In your terminal and run:
idf.py fullclean
2. Compile the Firmware:
The first time you run this, it will take a few minutes to compile the ESP-IDF RTOS core alongside the application code. In your terminal and run:
idf.py build
5. Flash to the WiCAN Pro Device.
There are three ways to flash the WiCAN Pro SW:
1. Using the WiCAN Pro System page, do a firmware update using the generated bin file
2. Flash using the WiCAN Pro safe mode
Press the button on the WiCAN Pro and plugging it to the OBD2 port, but boot the device into safe boot so you can connect to it via 192.168.0.10 (via Wifi direct connect to the device) and load the bin file
3. Flash to the Device direct via USB:
Plug your WiCAN Pro into your computer via USB. On Linux, it typically enumerates as /dev/ttyACM0 or /dev/ttyUSB0. Permissions Note: Ensure your Linux user is part of the dialout group to access the serial port without sudo. (sudo usermod -a -G dialout $USER and reboot/re-login).
In your terminal and run:
idf.py -p /dev/ttyACM0 flash monitor
The monitor flag immediately opens a serial terminal to the device once flashing is complete, allowing you to watch the boot sequence. To exit the serial monitor, press Ctrl + ].