Flashing & Updating

How to flash and update the Doppelgänger firmware


This walkthrough will assume that you’re using Windows 11. However, the process should be similar regardless of your choice of operating system. We recommend using either macOS or Windows, as at the this of building this article, Linux interations resulted in mkLittleFS dependency errors. To build and install the Doppelgänger firmware you’ll to install for following dependencies:

VS Code and Dependency Installation

  1. VS Code
  2. Python Interpreter: Ensure that you have Add Python 3.X to PATH during the installation process
  3. Git: Use the default settings except on for the Default Editor change that from Vim to VS Code
  4. CH340 Drivers

PlatformIO IDE Installation

With VS Code and the required dependencies installed, open VS Code and install the PlatformIO Extension. Click on the PlatformIO Icon to start the PlatformIO Core Installation (it will appear under the Extensions: Marketplace icon). When prompted by VS Code, restart the application.

Loading Doppelgänger into PlatformIO

With VS Code open, click on the PlatformIO Icon and select Clone Git Project. In the search window, paste https://github.com/tweathers-sec/doppelganger.git and hit Enter. You will be prompted on where you want to store the project, select a location that suits your needs. When prompted, open the project and select Yes, I trust the authors.

Building and Flashing

With the project open, click on the PlatformIO Icon. This will open the PlatformIO tools. Use the following operations to build and upload the firmware/filesystem. Note, it is important to close the PlatformIO terminal after each operation using the Kill Terminal Icon (Trash Can). Failure to do so will result in errors when performing certain operations.

The following screenshot illustrates the location of the Kill Terminal Icon.

After selecting Upload and Monitor, you should see the following TTY output indicating a successful upload of the firmware and filesystem.

======================================
[GPIO] Setting DATA0 to pin: 26
[GPIO] Setting DATA1 to pin: 25
[GPIO] Ground should be conntected to GND
======================================
[FILESYSTEM] Initializing the filesystem...
*wm:v2.0.15-rc.1  D:2
======================================
*wm:AutoConnect
*wm:No wifi saved, skipping
*wm:AutoConnect: FAILED for  92 ms
*wm:StartAP with SSID:  doppelgänger_xxxx (last four of MAC Address)
*wm:AP IP address: 192.168.4.1
*wm:Starting Web Portal

Updating Doppelgänger

To update Doppelgänger, perform a git pull to update the repository and repeat the steps taken above. While the device does support OTA firmware updates using WiFiManager, the filesystem can only be updated using PlatformIO (at the time of this writing).