Hello. I’m getting close. I’m on a MacOS machine, have set up Visual Studio Code with the PlatformIO add-on installed. Cloned the github repo for emontx4 and attempt to compile emontx4 > firmware > EmonTx4_DB_12CT_Wifi by opening that folder.
Of course, it asks for a platformio.ini file.
Instructions elsewhere said the contents of this platformio.ini file should be the following:
[platformio]
default_envs = default
src_dir = .
[env]
platform = atmelmegaavr
framework = arduino
board = AVR128DB48
platform_packages = ; Compiles without this set?
; DxCore AVD-DB
platformio/framework-arduino-megaavr-dxcore@^1.5.6
board_build.f_cpu = 24000000L ; 24 MHz
# board_hardware.oscillator = external
board_hardware.uart = uart3 ; May not be required?
monitor_speed = 115200
lib_deps =
https://github.com/SpenceKonde/OneWire.git#36e2604
https://github.com/openenergymonitor/RFM69_LPL.git#909b91d
https://github.com/openenergymonitor/emonEProm#avrdb
https://github.com/openenergymonitor/EmonLibCM#avrdb
[env:default]
build_flags = -DUSING_OPTIBOOT ; Upload via uart
upload_protocol = arduino
upload_speed = 115200
upload_flags = -v ; Verbose
However, I wonder if that is not entirely correct when trying to use the DB type of firmware required by my board (12CT). I actually was able to build the standard 6CT version, as a test. lib_deps needs more items listed?
If I just forge ahead and try to compile the firmware I need, it will show error that emonLibDB.h is not available. I actually solved that by downloading it from Roberts page and copying it in to the root of this folder I’m working from.
Trying again, now I’m missing EEPROM.h and SPI.h and there’s a reference to emonLibCM also. I locate those files on github, copy to my directory, and give another go.
Generally, still not working. Obviously I have no idea what I’m doing.
I’ll keep trying, but any help would be appreciated (besides, ‘take a programming class’ though that would of course help).
lightly sanitized last run output:
Executing task: platformio run
Processing default (platform: atmelmegaavr; framework: arduino; board: AVR128DB48)
-------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/AVR128DB48.html
PLATFORM: Atmel megaAVR (1.9.0) > AVR128DB48
HARDWARE: AVR128DB48 24MHz, 16KB RAM, 128KB Flash
PACKAGES:
- framework-arduino-megaavr-dxcore @ 1.5.6
- toolchain-atmelavr @ 3.70300.220127 (7.3.0)
Converting EmonTx4_DB_12CT_WiFi_TSMod1.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 22 compatible libraries
Scanning dependencies...
Dependency Graph
|-- OneWire @ 2.3.5+sha.36e2604
|-- RFM69_LPL @ 0.0.0+20231004115937.sha.909b91d
|-- emonEProm @ 1.0.0+sha.b0859d6
|-- EmonLibCM @ 3.0.6+sha.90a4135
Building in release mode
Compiling .pio/build/default/src/EmonTx4_DB_12CT_WiFi_TSMod1.ino.cpp.o
Compiling .pio/build/default/lib710/OneWire/OneWire.cpp.o
Compiling .pio/build/default/libc15/RFM69_LPL/RFM69_LPL.cpp.o
Compiling .pio/build/default/lib4d4/emonEProm/emonEProm.cpp.o
Compiling .pio/build/default/libce6/EmonLibCM/emonLibCM.cpp.o
Compiling .pio/build/default/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART0.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART1.cpp.o
.pio/libdeps/default/emonEProm/emonEProm.cpp:12:10: fatal error: EEPROM.h: No such file or directory
****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:EEPROM.h"
* Web > https://registry.platformio.org/search?q=header:EEPROM.h
*
****************************************************************
#include <EEPROM.h>
^~~~~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART2.cpp.o
In file included from .pio/libdeps/default/EmonLibCM/emonLibCM.cpp:76:0:
.pio/libdeps/default/EmonLibCM/emonLibCM.h:63:10: fatal error: SPI.h: No such file or directory
*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:SPI.h"
* Web > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************
#include <SPI.h>
^~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART3.cpp.o
*** [.pio/build/default/lib4d4/emonEProm/emonEProm.cpp.o] Error 1
*** [.pio/build/default/libce6/EmonLibCM/emonLibCM.cpp.o] Error 1
Compiling .pio/build/default/FrameworkArduino/UART4.cpp.o
================================================= [FAILED] Took 0.47 seconds =================================================