emonTH - Arduino IDE - 'showString' was not declared in this scope

EmonTH2 - Firmware updating
Please can someone help?
PS - I’m new to Linux (i.e. installed it yesterday), Arduino’s, IDE’s, git & scripting, so this has been one hell of a learning curve.

I’ve eventually got to the stage of installing the Arduino IDE on Ubuntu 20.10 following the instructions on this website under the Guides section:

  • Installing the Arduino IDE – Ubuntu Linux

  • Installing the Arduino Libraries – Ubuntu Linux

and have attempted to ‘verify’ the latest emonTH2 firmware (v3.2.4) but get the error:

  • ‘showString’ was not declared in this scope

Please do not ask me to use PlatformIO because I have just wasted 2 half days following the guide on here and using the PlatformIO documentation without success. I never got the VSCode extension working, though I did manage to get the PIO cli to work, but gave up when i got dependency errors with ‘@c057b5f4c0’ & ‘@c5ce0922ef’.

I had searched the Community posts and eventually found this & it looks like a newer emonth2 firmware has been created but not uploaded to git, see here:
Emon devices factory testing transmissions of “zero values” Hardware

Is the answer to use the attached zip file EmonTH_V2-(V3.2.5) in that post?

I’d never do that. It’s malware in my book. It’s not fit for purpose. When I tried it, it moved directories and files without a by-your-leave, and it cost me hours (like you) to put it back to rights.

And that’s been left out of the code BECAUSE OF PLATFORMIO - as I understand it. Utter stupidity doesn’t describe it.

People claim it’s improved, that wouldn’t be hard. Publishing it as it was was grossly irresponsible. I suggest you send it to the bit bucket like I did and forever after use the Arduino IDE instead. (Couples very nicely with NP++ as an external editor.)

The ‘zero values’ sketch isn’t on Github because it hasn’t caught up. You can use that - it’s changed so that the factory test won’t write false values into your data on start-up - or you can put the declaration of showString into the failing sketch (just above the first function is my favourite place)

static void showString (PGM_P s);

Thanks Robert,
It was late last night by the time I’d got to the stage that I had and thought it best to leave until another day before continuing.
I kept my post relatively short to help others understand so that could with confirm my suspicion of the cause.
I had already wasted a whole day prior trying to get PlatformIO (PIO) working on Windows10 without success, that is one reason why I decided to rebuild my laptop with an Ubuntu image.
Luckily my mid 23 yr old son was able to provide some assistance because he has some previous self taught Arduino knowledge, and he couldn’t believe how useless PIO was to setup & attempt to get working, I should have listened to him because he told me to use the Arduino IDE from the get-go as it was easy to set-up & use, but I foolishly believed the comments that PIO with VSCode was the better option.
As for using NP++, I think that I’ll take that route because I’ve been a fan of that editor for many years.

My reason for trying to flash the firmware of an emonTH with the standard image is to test the process before I flash it with the dual DS18B20 firmware (multiple_ds18b20_external).

I’ll publish my results once I get a chance to assimilate what I’ve learnt over the past few days.

I’m not the only one here who can’t use that consignment of natural organic fertiliser, I won’t say I’m happy you too found it useless - but you understand what I mean. I’ve used compilers and linkers and IDEs for decades, I’ve never come across that sort of behaviour before and I hope I never do again. The Arduino has its quirks, like it ignores library paths, so if you have two variants of the same library with the same file names, it ignores the paths and it chooses which bits to use - and they might (I’ve never fully tested it) come from different versions. So be warned. I suspect that’s a by-product of dumbing down by the Arduino crowd, because all the other linkers I’ve come across respect paths.

I gave up on Windows when I bought a machine with Win8 on it, but I have Win10 inside a VM and that seems to work OK with the Arduino IDE. And the Ubuntu ‘Snap’ version of NP++ runs nicely.

1 Like

I’ve managed to successfully flash an emonTH with the latest firmware after adding

static void showString (PGM_P s);

and have confirmed that it reports it’s sensor data to the emonhub.

1 Like