Skip to content

PlatformIO

faraday edited this page Jun 27, 2025 · 27 revisions

PlatformIO CLI

Prerequisites: PlatformIO CLI

  1. Open your terminal or command line interface and navigate to your root project directory

  2. Upload the example firmware using the following command template:

    EXAMPLE_DIR=[RELATIVE_EXAMPLE_PATH] platformio run -e [BOARD_ENVIRONMENT] -t upload
    

    The -e flag allows you to pass the desired board environment. The -t flag is to pass in the task to execute, in this case upload (default is build)

    Relative Paths for the Examples Included in the CDP:

    Basic-Ducks/DuckLink
    Basic-Ducks/MamaDuck
    Basic-Ducks/PapaDuck
    Basic-Ducks/DetectorDuck
    Custom-Mama-Examples/Custom-Mama-Example
    Custom-Papa-Examples/AWS-PapaDuck
    

    If you don't supply an EXAMPLE_DIR= argument, it will default to Basic-Ducks/MamaDuck

    Officially Supported Board Environments for the CDP:
    Board names prefixed with local_ will use your local version of the ClusterDuck Protocol. If you do not need to make any changes to the protocol, you should be using prod_ .

    prod_heltec_wifi_lora_32_V2
    local_heltec_wifi_lora_32_V2
    
    prod_heltec_wifi_lora_32_V3
    local_heltec_wifi_lora_32_V3
    
    prod_lilygo_t_beam_sx1276
    local_lilygo_t_beam_sx1276
    
    prod_lilygo_t_beam_sx1262
    local_lilygo_t_beam_sx1262
    
    prod_ttgo_lora32_v1_3
    test_ttgo_lora32_v1_3
    
    

    For example, if you want to run the example DuckLink firmware using a Lilygo T-Beam with the sx1276 LoRa chip and production CDP, you would run this command:

    EXAMPLE_DIR=Basic-Ducks/DuckLink platformio run -e prod_lilygo_t_beam_sx1276 -t upload
    

    If you are flashing from Windows, you may need to run the commands separately as below instead:

    $env:EXAMPLE_DIR=Basic-Ducks/DuckLink
    platformio run -e prod_lilygo_t_beam_sx1276 -t upload
    
  3. If the upload was successful, you can view the serial log using this command:

    platformio device monitor
    
Clone this wiki locally