Emonhub Adding other nodes

hallo , i hope you can help me , i had a emonbase+tx+th configured and just purchased 2 extra emonTH (node 25/26) , before adding to the emonhub i updated the firmware with the :
emonTH_DHT22_dual_DS18B20.ino

i replaced the node ID in the INO file with the ID on the emonTH and from the ide  serial monitor  seems all is ok (except some asci numbers somewhere , like there was some boud rate problem...) , the readings are ok .

But i am really not able to see the new nodes in the EMONHUB , what i am missing? surely is something stupid , but could someone help me ?

this is what i done to add the nodes :

1)in the EmonHub Config Editor i added some text for the new nodes, like :

[[25]]
    nodename = emonTH_5
    firmware =emonTH_DHT22_dual_DS18B20.ino
    hardware = emonTH_(Node_ID_Switch_DIP1:ON_DIP2:ON)
    [[[rx]]]
       names = temperature, external temperature, humidity, battery
       datacode = h
       scales = 0.1,0.1,0.1,0.1
       units = C,C,%,V

2) now are in the node list, but always inactive ...
Please help .

pb66's picture

Re: Emonhub Adding other nodes

It looks like that sketch was written for the older "RFu" based emonTH where as any recently purchased emonTH's will be the later v1.5 "non-RFu" type, You will need to make changes to that sketch or use a later one.

Additionally if the sketch was running the payload is defined as battery humidity internalTemp externalTemp1 externalTemp2 so either the sketch or emonhub would of needed editing so they match too.

Paul 

scubammx's picture

Re: Emonhub Adding other nodes

thanks pb66 . but there is something i do not understand :
this sketch works perfectly "emonTH_DHT22_DS18B20_RFM69CW"
and inside is written "RFu JeeLib        https://github.com/openenergymonitor/RFu_jeelib   //library to work with CISECO RFu328 module"
this is the non working sketch "emonTH_DHT22_dual_DS18B20" and inside are written the same stuff,  both says are using the same RFu328 module ...
So what is wrong ? can you please be more clear so i will try to solve the problem.
thanks

Robert Wall's picture

Re: Emonhub Adding other nodes

Look inside your emonTH. Which version do you have? If there are 3 layers of pcb, and the middle layer has written on it "CISECO" and "RFμ", then you have a V1.4. ("V1.4" is written on the underneath side of the pcb, you must take it out of the case to see.) If there are two layers, the main pcb and the radio module, then you have a V1.5.

Also look at the radio module (the top layer of pcb on both versions) and say which version of that you have. Pictures to help you: http://openenergymonitor.org/emon/buildingblocks/which-radio-module

glyn.hudson's picture

Re: Emonhub Adding other nodes

Can you post the serial debug at startup from the emonTH in question so we can see exactly what code you are running. The emonTH's should have been shipped with V2.6 the latest code with pulse counting support emonTH_DHT22_DS18B20_RFM69CW_Pulse. This sketch requires the following decoder, just replace nodeID with your node ID:

[[23]]
    nodename = emonTH_5
    firmware = V2.x_emonTH_DHT22_DS18B20_RFM69CW_Pulse
    hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:OFF)
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulseCount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

If you're running emonPi, or a recent emonBase SD card, you should be able to hit update to pull in support for the latest emonTH firmware: http://openenergymonitor.org/emon/modules/emonpi#update

scubammx's picture

Re: Emonhub Adding other nodes

hallo dear, what you mean with "Can you post the serial debug at startup from the emonTH ", let me understand what you need so i can post.
BTW i have 1.5 version cause i received 3 days ago the emonth.

scubammx's picture

Re: Emonhub Adding other nodes

I also would like to know is the text "firmware=" in the decoder in the emonhub.conf need to be the exact name of the firmware i used, or if is just for reference, cause sometimes i find with .ino extensions and sometimes not , so i suppose this is not to be cause of my problem.

glyn.hudson's picture

Re: Emonhub Adding other nodes

No firmware = is just a note to remind you. The important part of the node decoder is the names, datacode(s), scales and units. 

Firmware debug is the serial print at the beginning of a sketch as viewed in a serial window. I saw that you mentioned that you had re-uploaded your own firmware when you changed node ID. I just want to check exactly what version you have, so I can ensure the emonhub.conf node decoder is correct.

pb66's picture

Re: Emonhub Adding other nodes

Paolo - It looks like the note about the RFu library in  emonTH_DHT22_DS18B20_RFM69CW has been left over from it's v1.5 update, I see no reference to include RFu_JeeLib, where as there is in emonTH_DHT22_dual_DS18B20, bothe were originally written for the "RFu" emonTH but the "dual" doesn't seem to have been ported to the v1.5 emonTH yet.

Paul

scubammx's picture

Re: Emonhub Adding other nodes

Dear , you can see below :
with the sketch below :
emonTH_DHT22_DS18B20_RFM69CW_Pulse.ino
i am getting these from the serial :

00
OpenEnergyMonitor.org
emonTH - Firmware V2.60
RFM69CW Init>
Node: 26 Freq: 433Mhz Network: 210
No DHT22
Detected 2 DS18B20
DS18B20 Temperature: 18.80C, Battery voltage: 1.20V, Pulse count: 1n

and node is found correctly

with the dual sketch
emonTH_DHT22_dual_DS18B20.ino

I am getting :
emonTH bo (some ascii texts) OpenEnergyMonitor.org
Node: 26 Freq: 433Mhz Network: 210
(some ascii texts)to find DHT22 temp & humidity sensor... trying
Unable to find DHT22 temp & humidity sensor... giving up
(some ascii texts)DS18B20 External 1
Found DS18B20 External 2
emonTH payload:
  Battery voltage: 0.70V
  External sensor 1: 18.80C
  External sensor 2: 19.10C
Internal DHT22 sensor: not present

and node is not found

-----------------------------------

with the multiple sketch

emonTH_DHT22_multiple_DS18B20.ino

I am getting(only at 4800 baud) :

emo
Node: 20 Freq: 433Mhz Network: 210
(some ascii texts)to find DHT22 temp & humidity sensor... trying
Unable to find DHT22 temp & humidity sensor... giving up
Locating devices...Found 2 devices.
Parasite power is: OFF
Found device 0 with address: 28FFC662741503E1
Setting resolution to 12
Resolution actually set to: 12
Found device 1 with address: 28FF56AB731502D8
Setting resolution to 12
Reso (ascii characters)actually set to: 12
 rf packet length calculated at: 10
DONE
emonTH payload:
19.10  Battery voltage: 0.70V

And node is not found
---------------------------
this is my node 25 conf in emonhub:
[[25]]
nodename = emonTH_7
firmware = emonTH_DHT22_DS18B20_RFM69CW
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:ON)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V

you can see then from the not working sketches i am getting some glitches ascii codes in the serial monitor, maybe this is the reason of the problem? i tried of course different baud rates.

pb66's picture

Re: Emonhub Adding other nodes

Maybe try a new set of batteries or an external power source first, are you using the programmer supplied by the shop? those voltages look very low at 0.7 and 1.2. I don't know for sure but would expect ~2.6 to be as low as you could go, certainly during debugging >3v would be advised (at least).

The minimum/standard baud is 9600, I don't think 4800 has ever been used by OEM.

Paul

scubammx's picture

Re: Emonhub Adding other nodes

hi dear, i am using the programmer got in the shop, and the battery problem is only temporary, is also not working at 2.7V , now is 0.7v cause i put a wrong battery , i will replace this evening, but the errors does are not cause of this , i am sure .
regarding the baud , with the multisensor sketch if i put 9600 baud i will get only ascii text ... if 4800 seems works ...
all the other sketches i tried ar working goot at 9600
Paolo

scubammx's picture

Re: Emonhub Adding other nodes

Just to avoid misunderstanding I replaced the batteries and now the voltage is 3,1... But still not working

pb66's picture

Re: Emonhub Adding other nodes

With the correct power supply what is the "debug" serial output? What baud can you now connect at?

Obviously the batteries won't change the fact the "dual" sketch is currently only for the "RFu" emonTH not your later type so it is not expected to work without some code changes. The other sketch has been changed for use with v1.5 emonTH so you should now be able to use baud 9600 and get good values from it.

Paul

scubammx's picture

Re: Emonhub Adding other nodes

hi pb66, exactly same baud problem only on the multi sketch, but not with the "dual" , but is no problem i would like to try ust the "dual" to start work , and i am sorry but dont understand where is the problem  with my 1.5 emonth, can you give me some suggestion on what to revise ?  i really do not understand what is the problem...
i do not expect that anybody redo the sketch for me, i just need some help please.....
 

scubammx's picture

Re: Emonhub Adding other nodes

in the "Multi " sketch i found "Serial.begin(4800)" as default, so i changed it to 9600

and on both "multi" and "dual" i found :
" #include <RFu_JeeLib.h>  "

white the "pulse" working sketch have :
" #include <JeeLib.h>  "

ll the other codes related to the RF comunication seems same

Could be this the problem ?

I am going to try and let you know.

pb66's picture

Re: Emonhub Adding other nodes

From your 2nd post above

"thanks pb66 . but there is something i do not understand :
this sketch works perfectly "emonTH_DHT22_DS18B20_RFM69CW"
and inside is written "RFu JeeLib        https://github.com/openenergymonitor/RFu_jeelib   //library to work with CISECO RFu328 module"
this is the non working sketch "emonTH_DHT22_dual_DS18B20" and inside are written the same stuff,  both says are using the same RFu328 module ..."

Correct as I said the note in the "emonTH_DHT22_DS18B20_RFM69CW" sketch is out of dateand the "dual" is still for the "RFu", You now mention the "dual", the "multi" and the "pulse", What sketch are you actually trying to use? will one of the working sketches not do what you need?

"and on both "multi" and "dual" i found :" #include <RFu_JeeLib.h>  ""

Correct they were both written for the v1.4 "RFu" older device and have not been altered for the v1.5. from memory I believe it is probably just the RF, you need to check the pin numbers used and the JeeLib "import" must be changed, The devices you have will also be rfm69 not rfm12 so a "#define RF69_COMPAT 1" will probally be required too, you can use the "emonTH_DHT22_dual_DS18B20" as a guide since that too was originally for the v1.4 but has since been altered.

Paul

scubammx's picture

Re: Emonhub Adding other nodes

ok , i will try to figure our something starting from the "dual" .

And yes, the "pulse" is working perfectly , just i need to use more temperature sensors , so i wanted to use Multi or Dual ....

pb66's picture

Re: Emonhub Adding other nodes

Robert is the expert in this area so he may come to your rescue with some pointers to adapt the code for the v1.5 rfm69, he's also better experienced with multiple temp sensor code.

Paul

Robert Wall's picture

Re: Emonhub Adding other nodes

OK, will do, but not today!

scubammx's picture

Re: Emonhub Adding other nodes

ok thanks so much , i will wait for your help, in the meanwhile is will keep experimenting!
thanks everybody

Robert Wall's picture

Re: Emonhub Adding other nodes

As Paul (pb66) said, the obvious way to tell whether a sketch is suitable for the emonTH V 1.5 is to check which library is actually in use - ignore the comments!

If the sketch has:

#define RF69_COMPAT 1       // Set to 1 if using RFM69CW or 0 is using RFM12B
#include <JeeLib.h> 

then it is suitable for the emonTH V1.5

If it has:

#include <RFu_JeeLib.h>

then it is for the V1.4

Here are the differences between the V1.4 and the V1.5 I/O designations:

Function:	LED DIP1 DIP2 Pulse Pulse DS18B20 DS18B20		
                               I/P  IRQ	    Pwr     Data		 

V1.4            D9   -    -	D2    0	    D5	  D19/ADC5

V1.5		D9   D7	  D8	D3    1     D5    D19/ADC5



Function:	DHT22  DHT22  Batt Processor Radio  SEL SCK SDI SDO IRQ IRQ
               	 Pwr   Data          type           DIO DIO DIO DIO no  DIO	 	

V1.4             D6  D18/ADC4 AIO1  RFu328  RFu/12B -   13  11  12   1   3		

V1.5             D6  D18/ADC4 AIO1 ATMega328 69CW   10  13  11  12   0   2	 

In order to convert a sketch from hardware version 1.4 to hardware version 1.5, then in addition to changing the library and adding the line to select the correct code for the radio, you will also need to change the I/O designations.

So, for example, in a V1.4 sketch you have

const int ONE_WIRE_BUS=19;
const int DHTPIN=18; 

which does not need changing because D18 and D19 are used for the same function in both. But if you convert a sketch with a pulse input, then you will need to change both the interrupt number and the pin.

If you are reprogramming the emonTH, there is no need to add the part of the program that reads the DIP switches, as you will write your own ID permanently into the sketch.

scubammx's picture

Re: Emonhub Adding other nodes

thanks RObert , i will try something this evening and come back here for feedback ....

scubammx's picture

Re: Emonhub Adding other nodes

Hi Robert, hi everyone... I am not a professional programmer ... and i was not able to figure out how to convert the multiple sensors sketches to the new emonth rfm69 radio ...
Can someone update the sketches for me ? ( if is easy...) otherwise give me some more tips , cause i  should really need to add multiple sensors to my 3 emonth 1.5 , but i am only loosing time in this way...
thanks so much to anyone want to help!
 

Robert Wall's picture

Re: Emonhub Adding other nodes

Which sketch (URL on Github please) do you want converting?

Caveat: I don't have an emonTH V1.5, so you'll be doing the testing!

scubammx's picture

Re: Emonhub Adding other nodes

Thanks, this is the multiple sketch i would like to upload to my emonth

1) https://github.com/openenergymonitor/emonTH/tree/master/emonTH_DHT22_mul...
this is the multiple sensors sketch with auto scan for the address , if works is the better,   but has selected inside 4800 baud that is strange , and as default work on my emonth ( without RF of course ) but in the serial monitor i see some asci text ... dont know the reason .

2)https://github.com/openenergymonitor/emonTH/tree/master/emonTH_DHT22_dual_DS18B20
this is the DUAL and need to put the address of each sensor , i done it and working fine on the serial monitor ( except radio of course) .
In this case seems also easier to add more sensor.

you can choose which one you prefer, i think multiple will be better cause of the auto scan...

Grazie!

 

Robert Wall's picture

Re: Emonhub Adding other nodes

Here's your preferred sketch. It is untested because I don't have an emonTH V1.5, but it has compiled so there's a chance that it will work.

scubammx's picture

Re: Emonhub Adding other nodes

thanks! i will try tomorrow and will give you feedback, thjanks so much for your fast feedback

scubammx's picture

Re: Emonhub Adding other nodes

Dear Robert , the sketch is working perfectly !!!  thanks so much, that was very important for me !

glyn.hudson's picture

Re: Emonhub Adding other nodes

This example is now in the emonTH github https://github.com/openenergymonitor/emonTH/tree/master/emonTH_V1_5_DHT22_multiple_DS18B20

Thanks Robert and scubammx for testing. 

Comment viewing options

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