Skip to content
Taraqur Rahman edited this page Jun 26, 2023 · 92 revisions

CDP and Apple

This page documents the steps to install Arduino IDE on macOS, set up your Dev environment, and prepare to upload the CDP on your electronics. This page will go through:

  • Part One: Install Arduino IDE on MacOS
  • Part Two: Install Libraries and Dependencies
  • Part Three: Upload CDP to electronics.

Some helpful links:

  • MacOS installation video
  • TTGO CH9102 driver fix here

** macOS Big Sur Fix** If your IDE does not compile because of an ESPtool.py problem run the following commands in order and then restart Arduino IDE:

mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 --depth 1 && \
cd esp32 && \
git submodule update --init --recursive --depth 1 && \
cd tools && \
python get.py 

wiki-section-border

Part One: Install the Arduino IDE on MacOS

  1. Download and install the Arduino IDE and make sure to select MacOS

  2. Install the Silicon Labs USB to UART Bridge VCP Driver From Downloads Page. Note: Make sure Silicon Labs has the necessary security preferences (go to System Preferences -> Security and Privacy -> General and allow Silicon Labs).

  3. Install the ESP32 core Library by opening the Arduino IDE menu and go to [File] > [Preferences]. In [Additional Boards Manager URLs] add the following string: https://dl.espressif.com/dl/package_esp32_index.json,https://adafruit.github.io/arduino-board-index/package_adafruit_index.json - if there is already a URL here, add a comma at the end and then add this URL.

  4. Next, you will need to load the ESP32 Boards to your Arduino IDE. From Arduino IDE menu, select [Tools] > [Board] > [Boards Manager], Search for "esp32". You should see the "esp32" by Espressif Systems" library. Install this library.

Board ESP32

wiki-section-border

Part Two: Install Libraries and Dependencies

In the fall of 2022, we changed our codebase to not depend on an included libraries folder anymore but to be able to install all the needed libraries through your IDE (Arduino IDE or PlatformIO).

Method A - Install libraries with the Arduino IDE (After V3.1)

After successfully installing the Arduino IDE you can add the ClusterDuck Protocol and the necessary libraries inside the Arduino IDE.

  1. Go to the Arduino IDE menu and go to [Tools] > [Manage Libraries].

  2. Inside the Libraries manager search and install the following libraries.

    Note: EspAsyncwebserver and Crypto libraries have to be added manual, see method C


Method B - Manual Install (Before version V3.1)

  1. Open up a terminal or a git command prompt
  2. Clone the ClusterDuck Protocol repository with:
    git clone --recursive https://github.com/Call-for-Code/ClusterDuck-Protocol.git
    
  3. Navigate into the CDP repo
    cd ClusterDuck-Protocol
    
  4. Update the submodules
    git submodule update --init --recursive
    
  5. Copy the ClusterDuck-Protocol folder into your local Arduino Libraries folder _/Users/USER/Documents/Arduino/libraries_
  6. Navigate into the ClusterDuck-Protocol folder and open the Libraries folder
  7. Copy all the libraries form the ClusterDuck-Protocol Libraries folder and paste it into your local Arduino IDE Libraries folder _/Users/USER/Documents/Arduino/libraries_.
  8. Open Arduino IDE
  9. You should now be able to see the examples by going to File -> Examples -> ClusterDuck Protocol

You should be able to pull new commits directly to this folder in your Arduino library.


Method C - Zip Install

Go to the following websites and download the Libraries:

To add Libraries by zip files. Go to Sketch > include Library > add .zip Library…

Method D - Automated Script (Requires Python 3)

This automated script will provide you the core libraries needed to run a basic ClusterDuck Network (no sensors)

Once ClusterDuck Protocol repository is installed:

  1. Open terminal and navigate to the ClusterDuck Protocol repo.

  2. Install a Python package called "requests"

    pip install requests
    
  3. Run the automation script

    python install-dependencies.py
    

Once the program is completed, the necessary libraries will be installed in the Arduino libraries folder.

wiki-section-border

Part Three: Upload CDP to Electronics

Now follow these steps to get started inside the Arduino IDE

Clone this wiki locally