Help Required on Getting Homebrew EmonPi Running

Strictly speaking the “boolean” datatype is not (no longer?) supported by Arduino (or in C++), it should be a “bool” datatype and regardless of which is used, it should be lowercase true and false.

I think the Arduino IDE has toughened up on some loose ends recently, see the “Arduino IDE problem - showString( )” thread for info on the showstring() error.

I had hoped it was a simple case of changing that one variable when I suggested this route (silly me!), I’m sorry it’s not worked out that way but the emonPi FW is not recompiled very often and when it is (unfortunately) it’s usually only ever done on a Linux PC using PlatformIO and a set of Libraries that are stuck in time rather than the latest versions, it’s only when users such as yourself run into difficulties we become aware of any issues.

If you are up for trying to iron out these wrinkles we can try and help you through them.

First you could replace all “boolean” declarations with “bool” whilst also editing the declared values to lowercase as well. [edit - see the bolded last line of this post first]

Where the bools are used can be edited from if (USA==TRUE) to just if (USA) so that it is a logic test on the value itself and not a test to see if the value equals something eg TRUE.

some further reading on the bool vs boolean thing

The firming up of the position on using booleans has happened since the emonpi FW was written, it could be argued that it’s an Arduino IDE issue/bug but the “bool” datatype is the way forward even if backward compatibility is supported.

Looking at the changelog there was a change back in version “ARDUINO 1.6.0rc2 - 2015.01.20” of the Arduino core that states “Arduino “boolean” type is now mapped to “bool” instead of “uint8_t””, perhaps the ability to use uppercase “TRUE” and “FALSE” was lost in that move, you could try changing the case of all the boolean values to lower as a first step rather than changing to bools, it might be just the uppercase it objects to (worth a try?).