Hot water tank temperature monitoring

No, it’s not possible. The device has only the compiled code, not human-readable source.

“Board” is Arduino Uno
“Port” is whatever appears and disappears when you plug in and unplug the programmer (USB end from the computer)
“Programmer” doesn’t matter for this - mine is set to AVRISP

I gave up on Windoze when I got this machine with Windoze 8 on it. Enough said.

If that refers to VSCode, it is multi-platform (and open source IIRC) even though it is an MS tool.

My “daily driver” is a Mac, but I use Windows and Linux as well on a daily basis. To be honest, they’ve all reached a parity in my view and the GUIs all the look the same to me these days.

Yes, the thing I love about VS Code is the cross-platform nature so I don’t have to keep interrupting my muscle memory. And, MS have indeed open-sourced a lot of their projects these days - who knew! The MS of today is very different to the MS from Windows 8 era (I used to share your reservations…).

Compilation error:

Line 101:

#include <SI7021.h>

Can’t find mention of this library on either the Learn page or the V1.x or V2.x GitHub pages.

Searching GitHub globally yields 13 different repos that have it and Google has countless more results.

Any idea which repo has the correct library I need?

Edit:
There are references to AdaFruit’s libraries throughout OpenEnergyMonitor repos, so I would I be correct in assuming this is the one to install?

Edit2:
Apparently not. The filename is different and it specifically says it is only for their own board.

I don’t have an emonTH V2, and G&T appear to have omitted a link from the top of the source file. I think the Adafruit one is more likely than most to be a valid choice.

Let’s ask @Gwil
Where is the library for the SI7021? There’s no mention of it and no link in the comment at the top of the source file, where it should be.
[Not everybody can or wants to use platformio - it screwed my system up for a start.]
Then, can you add it to the tables in Learn→Electricity Monitoring→Using the Arduino IDE for all 3 OS’s please?

I think it may be this one.

In the platformio.ini file it mentions a hash on line 28:

Si7021 @c5ce0922ef

Searching PlatformIO libraries for SI7021 leads to this one which mentions that hash as a version number and includes a link to the above GitHub page.

Reckon my detective work checks out?

I can’t see a copyable link there - I’m now very, very suspicious of anything related to platformio, having been badly burned by it.

[Edit]
Looks like it’s stolen from LowPowerLabs…
[Edit 2]
And that’s 500 / 504 to me.
I can get to GitHub - LowPowerLab/SI7021: Si7021 temperature & humidity sensor arduino library and that’s all.

Yes, GitHub is down for me as well. I managed to have a look at it but, alas, I was too late to download the repo zip file, so I shall have to wait :timer_clock: :roll_eyes:

I shall take heed and stay away from PlatformIO (I didn’t want to have to learn how to use yet another tool to get this job done anyway!).

Thanks for confirming my hypothesis nonetheless.

Very wise.

I keep a local download of the Git stuff that I need, and don’t allow it to update my working files. I have a script to do that.
I downloaded and installed platformio, looked at it briefly, thought (like you) ‘Hmm… yet another IDE to have to learn’; then continued with my old ways as there was stuff I needed to get on with. In the process, I ran my script to update my Git copy and there were errors all over the place - it seems that I’d told platformio to USE those as sources and instead it MOVED the directories, causing my script to fail. That’s the behaviour of malware, in my book. Platformio got deleted double-quick. Then I had a few hours restoring everything to their rightful places. :rage:


I’ve managed to download the raw files now, but can’t do any more for a while.

[Edit]
Yep, as I suspected. The platformio files are byte-for-byte identical to the LowPowerLabs
SI7021.zip (3.1 KB)

If you then get an error about “ShowString”; here is what to do: Arduino IDE compilation errors

Oh boy, this is a world of pain.

Next compilation error (not one listed on your thread):

Line 202:
'load_config' was not declared in this scope

The full error message is attached (I can’t see how to paste it into a preformatted text box on this forum): error2.txt (3.5 KB)

Looking at the repo (emonth2/firmware/src at master · openenergymonitor/emonth2 · GitHub), load_config is declared in the config.ino file.

Maybe this file should be a header file - then included in the sketch?

The file should be in Github, alongside the main source file. Download it and put it in the same directory.

In fact, you should have downloaded both files together and kept them in the same directory, as both are needed. (And I agree, the Arduino world is dumbed down, seemingly to make it harder for those of us used to ‘conventional’ edit - compile - link cycle.)

config.ino is intimately bound to the associated main sketch, even though all the config.ino’s are similar. The function is to initialise the sketch, either with values retrieved from EEPROM or from the user via the serial interface.

I suspect it was Glyn who decided that the functions should be in a separate file rather than included as part of the main file. It makes sense to me, the ‘config’ happens only at startup, thereafter the main file runs on forever. But there’s no technical reason that I know of to necessitate a separate file - the dedicated functions (i.e. most of the config.ino file) can’t be shared with another sketch.

No joy, exact same error message as before.

Arduino IDE seems to recognise the config.ino file exists though, it automatically opened it as a new tab next to the main sketch file.

It still thinks “‘load_config’ was not declared in this scope”?

I’ve put the SI7021 library into my libraries directory and compiled my emonTH_V2 on the second try - after declaring ShowString.

load_config( ) is the first function in the file - it is there, isn’t it? If it isn’t, you must have the wrong config.ino.

You are compiling the main file for the emonTH_V2 (unfortunately it has the decidedly non-unique name src.ino)? It starts with the comment
emonTH V2 Low Power SI7021 Humidity & Temperature, DS18B20 Temperature & Pulse counting Node Example
and the last change was
V3.2.1 - (30/11/16) Fix emonTx port typo

@Gwil, @glyn.hudson

I see an error in config.ino, lines 44-48. The curly brackets are wrong, they should be deleted. As it stands, if a value is not set for case ‘i’, it falls through to case ‘b’. It only “works” and doesn’t cause a problem because bandToFreq( ) returns zero and the if in case ‘b’ also fails, but it’s a problem in waiting.

      case 'i': //set node ID
        if (value){
          nodeID = value;
        break;
      }

should be

      case 'i': //set node ID
        if (value)
          nodeID = value;
        break;
      

alternatively

      case 'i': //set node ID
        if (value)
        {
          nodeID = value;
        }
        break;

but the brackets are not strictly necessary.

Yes, same error as before.

First, and only, mention is on line 202:
load_config();

Yes, but it is version 3.2.4:
V3.2.4 - (25/05/18) Add prompt for serial config

The file I was talking about is config.ino. There has to be a good reason why it can’t see the declaration for load_config( ) and it’s complaining:

/Users/lhs/Documents/Arduino/src/src.ino: In function 'void setup()':
src:202:5: error: 'load_config' was not declared in this scope
     load_config();                                                        // Load RF config from EEPROM (if any exist)
     ^~~~~~~~~~~

I don’t know how the Arduino compiler/linker works down at intimate detail level, but it’s messed about with the normal way of doing things and the presence of a definition of a function in a file in the same directory as the main source file is normally enough. Hence my question: is the function there? So in /Users/lhs/Documents/Arduino/src you should have two files, src.ino and config.ino.

Here’s what I see (now V3.2.4) having renamed the main file (8 or 10 windows open in my editor all called “src.ino” does my head in) and after adding the declaration for ShowString( ). How that got missed, I know not.
image
And there’s the definition of load_config( ) in the config.ini file.

If you want to cut your losses and not waste any more time messing, and given you don’t want and need to recover the stored values from EEPROM, just delete line 202. It’s only storing the values of RF frequency, NodeID and the Group and then only if you’ve changed them from the defaults set in lines 84 - 86 using the serial programmer at startup (which you haven’t, and probably never will).

Apologies for the late reply, it was my turn at childcare and home schooling yesterday and today.

Deleting line 202 did make it past that error, only to encounter another compilation error further on (I don’t have the error message to hand right now). Given that you managed to successfully compile it with those exact same files I suspect Arduino just doesn’t like my Mac for some reason.

I shall give it another go with a Windows laptop when I get a chance and let you know how I get on.

Once again, I really appreciate all the time you and everyone else has taken to guide me through this.

Thanks, I’ve made the change.

1 Like