Difference between revisions of "IoT - Collabs - ESP Firmware with Guru"

From The TinkerNet Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
==Modular Firmware==
 
==Modular Firmware==
  
===Baseline===
+
=== Baseline ===
  
 
This is the basis for pretty much ANY ESP-based firmware project.  It'll get your device online.
 
This is the basis for pretty much ANY ESP-based firmware project.  It'll get your device online.
  
[[Modular ESP Firmware - Baseline - Source|Source code]]
+
==== main.cpp ====
 +
<syntaxhighlight lang="cpp" line="1">
 +
#include "TopSecret.h"
 +
#include "functions.h"
 +
 
 +
void setup()
 +
{
 +
  Serial.begin(115200);
 +
  delay(50); // Delay to let the ESP get booted before sending out serial data
 +
  Serial.printf("\n+---------------------------------------+\n");
 +
  Serial.printf("|            ESP Baseline             |\n");
 +
  Serial.printf("+---------------------------------------+\n");
 +
 
 +
  setup_wifi();
 +
 
 +
  // setup_mqtt();
 +
 
 +
  pinMode(LED_BUILTIN, OUTPUT);
 +
  digitalWrite(LED_BUILTIN, HIGH);
 +
}
 +
 
 +
void loop()
 +
{
 +
  // put your main code here, to run repeatedly:
 +
}
 +
</syntaxhighlight>
 +
 
 +
==== The parts ====
  
 
[[Modular ESP Firmware - Baseline - Work Environment|Work Environment]] (Platformio/VSC setup)
 
[[Modular ESP Firmware - Baseline - Work Environment|Work Environment]] (Platformio/VSC setup)

Revision as of 14:14, 2 January 2021

Modular Firmware

Baseline

This is the basis for pretty much ANY ESP-based firmware project. It'll get your device online.

main.cpp

 1 #include "TopSecret.h"
 2 #include "functions.h"
 3 
 4 void setup()
 5 {
 6   Serial.begin(115200);
 7   delay(50); // Delay to let the ESP get booted before sending out serial data
 8   Serial.printf("\n+---------------------------------------+\n");
 9   Serial.printf("|             ESP Baseline              |\n");
10   Serial.printf("+---------------------------------------+\n");
11 
12   setup_wifi();
13 
14   // setup_mqtt();
15 
16   pinMode(LED_BUILTIN, OUTPUT);
17   digitalWrite(LED_BUILTIN, HIGH);
18 }
19 
20 void loop()
21 {
22   // put your main code here, to run repeatedly:
23 }

The parts

Work Environment (Platformio/VSC setup)

Declarations and Defines

Individual Functions

MQTT

This is intended to be added to the baseline.

You'll need to add:

lib_deps =
       PubSubClient

to your platformio.ini file.

Declarations and Defines

Individual Functions

OTA

Gurus source code...

Source code

Ffffffuuuuuuuu......

Configuration HotSpot

Source code

Wiegand RFID keypad

Source code

NeoPixels

Extreme WIP

This is intended to be added to the baseline.

You'll need to add:

lib_deps =
       Adafruit NeoPixel

to your platformio.ini file.

and put

#include <Adafruit_NeoPixel.h>

in your source

Declarations and Defines

Individual Functions

Web Serving

Source code

TFT Display

Source code

Climate Sensing

Source code

Energy Monitoring

Source code

Modularization Tutorial (WIP)

The source code...