Skip to main content

Day 3 Preparations

1. Install PlatformIO IDE

Please get the following things ready for tomorrow (so things are a little less chaotic).

  1. VSCode

  2. PlatformIO IDE

Once you have PlatformIO IDE installed please set up a new project with

a. Board details: NodeMCU ESP12 v1 b. Framework: IDE

After set up a project with these details, all required framework and libraries will be downloaded. You are ready for Day 3.

Detailed instructions

  1. Install VSCode
  2. Go to the Extension store and install PlatformIO IDE

platform.png

  1. In the VSCode left sidebar, you will see a new icon for PlatformIO.
sidebar
  1. Click on "Create new Project"

  2. Create a new Project.

newproject

  1. Select the board and framework.

selectboard

  1. Wait for libraries and example code to finish downloading.

downloading

  1. You will note, in the left file view, that new files for your project have been created.

files

  1. Open platformio.ini file and edit to following:
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
board_build.ldscript = eagle.flash.4m2m.ld
lib_deps =
earlephilhower/ESP8266Audio@^2.0.0
knolleary/PubSubClient@^2.8
board_build.filesystem = littlefs
upload_speed = 921600
  1. Open src/main.cpp file and edit to following:
/// blinky
#include <Arduino.h>

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}

This is to ensure the board and your setup is working.

  1. Compile and Upload the code to the board.

upload

uploading

You should see the board LED blinking.

2. Set up SoundManager and Data folder

  1. Download and unzip the SoundManager and Data folder.
  1. Copy the SoundManager and Data folder to your project folder with structure shown below.

soundmanager

3. Install MQTT Client (MQTTX)

Download and install MQTTX MQTT Client.

4. Make sure you have Node and NPM installed

Install Node.js (npm should come with it). node -v should say 16 or higher.