monTX endless loop

Hy,

I assembled my emonTX and was testing it. I found the sketch "emonTX CT123" compiled and transfer was also successful. only the programm was stopped by the line

rf12_initialize(nodeID, freq, networkGroup);

so marked out this line and the following

rf12_sleep(RF12_SLEEP);

so the sketch was running but with curios results showing the window of the serial monitor:

 

monTX CT123 example
OpenEnergyMonitor.org
Node: 10 Freq: 868Mhz Network: 210
 vor rf12 nach Init rf12 nach PinMode nach LEDLoop12730 3303
emonTX CT123 example
OpenEnergyMonitor.org
Node: 10 Freq: 868Mhz Network: 210
 vor rf12 nach Init rf12 nach PinMode nach LEDLoop12696 3303

 

the remarks like "vor rf12" and "nach Init".... are debugging Serial.print to see where the programm is running.

 

can anyone help me to explain this strange behaviar?

 

altprog

Robert Wall's picture

Re: monTX endless loop

Do you have JeeLib installed?  It is required: "#include <JeeLib.h>  "  If not, you must download and install it in the Arduino IDE "libraries" directory according to the readme.

[Edit] "12696 3303" appear to be correct: Power = 12.696 kW and EmonTx battery voltage = 3.303 V.

 

altprog's picture

Re: monTX endless loop

Hi,

the whole library "jcwjeelibf48cee8" which includes JeeLib.h is in the folder libraries. The compiler compiles without any remarks, so i believe he founds JeeLib.h.

a graet question for me is also why the program starts always after a few seconds by the beginning wit the setup-routine.

 

Robert Wall's picture

Re: monTX endless loop

Did you rename the directory  "jcwjeelibf48cee8" to "JeeLib" ?

 

Robert Wall's picture

Re: monTX endless loop

According to the JeeLib software, the RFM12B has a power-on reset which takes "several seconds".  The rf12_initialize function will not return until that has completed.

altprog's picture

Re: monTX endless loop

Hi,

 

no did not rename the library, i will try it. But would that not cause a compiler error?

Robert Wall's picture

Re: monTX endless loop

Not renaming the library directory does not appear to cause a compiler error ( ! ), but the instruction in the readme is:

Unpack the archive and rename the result to `JeeLib`. 
Put it in the `libraries` folder in your Arduino sketches area. 
Restart the Arduino IDE to make sure it sees the new files.

I have been trying to reproduce your error and I cannot, even by changing the folder name. But there must be a reason why the instructions clearly state it must be renamed. So if renaming the library folder does not help, the only suggestion I have is to check that you have assembled the emonTx correctly. Does it look like this (except that on mine, the SMD of the RF12 module is a resin blob like this)?

 

altprog's picture

Re: monTX endless loop

Congratulations and many thanks. I renamed and restart and it works!!

Thank you for this quick help. I see now this on the Serial Monitor:

P: 0 3303
P: 4 3303
P: 0 3303
P: 0 3303
P: 0 3303
P: 0 3303
P: 11 3303
P: 0 3303
P: 0 3303
P: 2 3303
P: 3 3303
P: 0 3303
P: 0 3303
P: 0 3303
P: 0 330

 

Now I can rest for this evening

Robert Wall's picture

Re: monTX endless loop

I agree with you - I would say that not generating a compiler error is a bug in the Arduino IDE software!  However, it is the way it is.

Comment viewing options

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