Error in example temp sketch

Hi

 

i loaded up the example sketch for the temp node and there are some errors its throwing when i try to compile i quite cant figure:

 

emontx_lib.ino: In function 'void emontx_sleep(int)':
emontx_lib:17: error: 'UNO' was not declared in this scope
emontx_lib:17: error: 'wdt_reset' was not declared in this scope
print_to_serial.ino: In function 'void print_to_serial()':
print_to_serial:3: error: 'struct Payload' has no member named 'realPower'
print_to_serial:5: error: 'ct1' was not declared in this scope
print_to_serial:12: error: 'struct Payload' has no member named 'T1'
print_to_serial:14: error: 'struct Payload' has no member named 'T2'
print_to_serial:16: error: 'struct Payload' has no member named 'T3'
print_to_serial:18: error: 'struct Payload' has no member named 'T4'

 

i downloaded the sketch as its shown here:https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTx_temperature_examples/emontx_lowpower_temperature/emontx_lowpower_temperature.ino

 

the 2 last files listed as requirements i got from github... the libraries i got from the links in the sketch  

boelle's picture

Re: Error in example temp sketch

i guess most of them are related to print to serial... but is that one relly needed? most of it in there are sure related to printing power usage to the serial port but i will not be sitting with the laptop in the closet with my hotwater cylinder...

 

but an explanation on whats wrong would be apriciated...

boelle's picture

Re: Error in example temp sketch

print to serial stuff cleared... i just edited the file to contain only temp and battery....

 

but i cant quite figure the first 2 errors...

Jérôme's picture

Re: Error in example temp sketch

Did you get the openenergymonitor files as I suggested in that other thread ?

http://openenergymonitor.org/emon/node/2255

either git clone or archive download ?

 

boelle's picture

Re: Error in example temp sketch

yep i did

boelle's picture

Re: Error in example temp sketch

emontx_lib.ino:

void send_rf_data()
{
  rf12_sleep(RF12_WAKEUP);
  // if ready to send + exit loop if it gets stuck as it seems too
  int i = 0; while (!rf12_canSend() && i<10) {rf12_recvDone(); i++;}
  rf12_sendStart(0, &emontx, sizeof emontx);
  // set the sync mode to 2 if the fuses are still the Arduino default
  // mode 3 (full powerdown) can only be used with 258 CK startup fuses
  rf12_sendWait(2);
  rf12_sleep(RF12_SLEEP);
}

void emontx_sleep(int seconds) {
  // if (emontx.battery > 3300) {
    for (int i=0; i<seconds; i++) {
      delay(1000);
      if (UNO) wdt_reset();
    }
  // } else Sleepy::loseSomeTime(seconds*1000);
}

 

boelle's picture

Re: Error in example temp sketch

its line no 4 from button its complaing about

JBecker's picture

Re: Error in example temp sketch

Strange, if I download from your link given above, it compiles without problems. And there is no reference to emontx.lib in that code at all. So it should not try to use that.

Can you check again that you try to compile the correct sketch?

Jörg.

 

boelle's picture

Re: Error in example temp sketch

yep i will.... but in master sketch it says:

Other files in project directory (should appear in the arduino tabs above)
- emontx_lib.ino
- print_to_serial.ino

its line 35-37

 

boelle's picture

Re: Error in example temp sketch

to make sure here is the master sketch and the 2 others attached

 

above line 35 it says:

 

THIS SKETCH REQUIRES:

  Libraries in the standard arduino libraries folder:
- JeeLib  https://github.com/jcw/jeelib
- EmonLib  https://github.com/openenergymonitor/EmonLib.git
- OneWire library http://www.pjrc.com/teensy/td_libs_OneWire.html
- DallasTemperature http://download.milesburton.com/Arduino/MaximTemperature

 

of course it needs the libs... but since the words requires is meant for the whole block i assumed the sketch needs the 2 other files too.... and its emontx_lib.ino the fault comes up

emontx_lib.ino: In function 'void emontx_sleep(int)':
emontx_lib:17: error: 'UNO' was not declared in this scope
emontx_lib:17: error: 'wdt_reset' was not declared in this scope

 

the line that causes it is:

 

if (UNO) wdt_reset();

 

JBecker's picture

Re: Error in example temp sketch

Yes, but nothing from the emontx-lib.ino is used.

 

JBecker's picture

Re: Error in example temp sketch

I can also compile your sketch_apr17a.ino without problems !?!

There is also no reference to the other libs (ok, apart from the comment :-) ).

 

 

boelle's picture

Re: Error in example temp sketch

ok... just strange they put the the other 2 ino's as required but dont use them....

boelle's picture

Re: Error in example temp sketch

running without problems if remove those 2 ino's.... i guess they forgot to remove them as requirement

JBecker's picture

Re: Error in example temp sketch

I think they just converted an existing sketch to the lowpower_temperature sketch and forgot to delete the comments.

But if you just load the emontx_temperature_power.ino and press compile, it just compiles. What did you try instead (just curious)?

 

Edit: crossposting :-)  So you loaded the 'required' files and tried to compile.

boelle's picture

Re: Error in example temp sketch

yep... i put the 2 other ino's together with the master sketch... mainly bacause it said they where where required...

glyn.hudson's picture

Re: Error in example temp sketch

I guys, thanks for noticing this. Yes, we forgot to delete the comments that we copied across from another example. I've updated the github. 

Cheers, 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.