I’ve just bought an additional emonTH2 to go with the four I already have. Of course, I need to flash new firmware to enable it to send on device id 27.
It’s ages since I played with PlatformIO, so I did the following to get a known good image before I started editing.
git clone https://github.com/openenergymonitor/emonth2
cd emonth2/firmware
pio run
it threw the following errors:
Processing lpl (platform: atmelavr; framework: arduino; board: uno)
-------------------------------------------------------------------------------------------------------------------------------------
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x97 in position 8: invalid start byte:
File "/usr/local/Cellar/platformio/6.1.16/libexec/lib/python3.12/site-packages/platformio/builder/main.py", line 100:
env = DefaultEnvironment(**DEFAULT_ENV_OPTIONS)
File "/Users/garethhowell/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Defaults.py", line 82:
_default_env = SCons.Environment.Environment(*args, **kwargs)
File "/Users/garethhowell/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Environment.py", line 1208:
platform(self)
File "/Users/garethhowell/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Platform/__init__.py", line 138:
return self.generate(*args, **kw)
File "/Users/garethhowell/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Platform/darwin.py", line 58:
lines = f.readlines()
File "<frozen codecs>", line 322:
==================================================== [FAILED] Took 0.47 seconds ====================================================
Environment Status Duration
------------- -------- ------------
lpl FAILED 00:00:00.468
=============================================== 1 failed, 0 succeeded in 00:00:00.468 ===============================================
This is on a Mac running Sonoma and with python 3.11.
EDIT: I should have added that this is all within VSCode; which is my editor of choice.