This code powers the ESP32 that will monitor transformers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Andrew 82926b1f5c
Merge branch 'master' into andrews-local-changes
1 month ago
.vscode Add LED code 1 month ago
include Add LED code 1 month ago
lib v0.1 3 months ago
src Merge branch 'master' into andrews-local-changes 1 month ago
test inital code 7 months ago
.env.default changes to config 3 months ago
.gitignore change config to YAML 3 months ago
README.md added test for AT90E36 5 months ago
config.example.yml fixes 3 months ago
envSetup.py dirty commit of start on tasks 3 months ago
platformio.ini Merge branch 'master' into andrews-local-changes 1 month ago

README.md

ESP 32 Transformer Monitor

This is the code that will control the ESP32.

Requirements

We will be using PlatformIO for this project. This will allow us to possibly use its remote test and dev features.

You will need to change your upload port in platformio.ini.

Env variables

Add the env variables to a .env file before building it:

XFORMER_MON_WIFI_SSID=Your-WiFi-SSID
XFORMER_MON_WIFI_PASSWD=Your-WiFi-Password

# Your MQTT server
XFORMER_MON_MQTT_SERVER=xformer.utilitymonitor.io

XFORMER_MON_MQTT_USER=test

XFORMER_MON_MQTT_PASS=secure-mqtt-pass

XFORMER_MON_MQTT_ID=unique-id

XFORMER_MON_MQTT_PORT="8883"

# Must be "enabled" if using SSL!
XFORMER_MON_USE_SSL="enabled"

Development

Put .cpp files in src, .h files in include, and any libraries in lib.

Tests

Put tests in src/tests. These are not PlatformIO tests.

Run and upload tests using PlatformIO's VSCode extension. Or upload them using the command pio run -t upload -e Test[Name]. Name is the name of the test to run.

In general, when adding tests make sure to add Test to the beginning of the environment name. Make sure to only include the files for your test. See below for guidelines.

If you add a test, add an env section to platformio.ini with a syntax like the following:

[env:Test[NameOfTest]]
lib_deps = 
    [any libraries you need]
# filter everything else except the files needed for the test
build_src_filter = 
    -<*> 
    -<.git/> 
    -<.svn/> 
    +<tests/[NameOfTest].cpp>

Setup

Depending on which sensor is used, the board has to be set up differently.