confusion with Inputs received from the emonTxV3_4_continuous_kwhtotals

I have uploaded the emonTxV3_4_continuous_kwhtotals sketch to my emonTx V3.4 following the information from the document at https://github.com/openenergymonitor/documentation/blob/master/Applicati...

I appear to be getting 15 Inputs and not the 9 Inputs as explained below.

The above document is for emonTx V3 using the emonTxV3_continuous_kwhtotals_noeeprom

this shows a total of 9 Inputs.

 

If I look at the serial ports data using minicom I see the following:

pi@emonbase ~ $ sudo minicom -D /dev/ttyAMA0 -b38400

Welcome to minicom 2.6.1

OPTIONS: I18n
Compiled on Apr 28 2012, 19:24:31.
Port /dev/ttyAMA0

Press CTRL-A Z for help on special keys

OK 10 147 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-45)
OK 10 152 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-45)
OK 10 157 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-46)
OK 10 167 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-42)
OK 10 172 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-39)
OK 10 177 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-43)
OK 10 182 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-41)
OK 10 187 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-42)
OK 10 192 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-39)
OK 10 197 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (-39)

OK nd   1   2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8   9

seems to be 29 values and this does not seem to match what I have configured in the /boot/emonhub.conf settings; which I have set as follows, based on the above document:

[[99]] datacodes = L, h, h, h, h, l, l, l, l

L = unsigned long h = signed integer l = signed long

I also seem to be receiving an rssi ? (-39) as the last item

If I connect the USB serial programmer direct to the emonTx V3.4 to my Linux box I see the following:

 ~$ date ; sudo minicom -D /dev/ttyUSB0 -b9600
Sun May 17 01:25:45 NZST 2015

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Jan  1 2014, 17:13:19.
Port /dev/ttyUSB0, 01:25:32                                                                        
                                                                                                   
Press CTRL-A Z for help on special keys 

                                                                                                  
----------------------------------                                                                 
Sketch ID:  emonTxV3_continuous_kwhtotals_noeeprom.ino                                             
ADC mode:       free-running                                                                       
Extra Features: none                                                                               
powerCal_CT1 =      0.2619                                                                         
phaseCal_CT1 =      0.22                                                                           
powerCal_CT2 =      0.2619                                                                         
phaseCal_CT2 =      0.41                                                                           
powerCal_CT3 =      0.2619                                                                         
phaseCal_CT3 =      0.60                                                                           
powerCal_CT4 =      0.0478                                                                         
phaseCal_CT4 =      1.25                                                                           
----
voltage thresholds long:
  upper: 64000
  lower: -64000
0
1
2
3
4
5

CTRL-A Z for help | 9600 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0

 

I am doing something wrong here?

I do not understand why I am seeing 15 items on my Inputs page of my local

http://emonbase/emoncms/input/view

I have been working on this all day and I am not sure what is going on here.

Any ideas?

Thanks. Kind regards, Adrian Smith

 

pb66's picture

Re: confusion with Inputs received from the emonTxV3_4_continuous_kwhtotals

Hi Adrian

In that guide you seem to have not fully implemented this part

Under the title 'Nodes' replace the lines:

[[99]] 
        datacode = h 
        datacodes = l, h, h, h,

with:

[[10]] 
        datacodes = L, h, h, h, h, l, l, l, l

You have changed the datacodes but not set the node id to 10.

In " L, h, h, h, h, l, l, l, l " there are 5 longs and 4 integers, the longs are 4bytes each anf the ints 2bytes, (5x4) + (4x2) =28 bytes, the "29 values" you see in minicom are the 28 individual byte values plus the additional RSSI (signal strength) added by the receiving device ie not originating from the emonTx sketch. Plus the leading node id of course.

Because you effectively have node 99 defined rather than node 10, node 10 is assumed to be 14 integers, ie 28 bytes at 2bytes per integer as any undefined values are assumed to be ints by default. So the 14 ints plus the rssi is what you are seeing in emoncms.

If you change the [[99]] to [[10]] then the 28 bytes will be decoded as L, h, h, h, h, l, l, l, l and give you the 9 values plus the rssi so you should see 10 active inputs and the remaining 5 inactive inputs can be deleted.

Paul

AdrianSmith's picture

Re: confusion with Inputs received from the emonTxV3_4_continuous_kwhtotals

Thanks Paul. I just changed the [[99]] to [[10]] as you suggested; and it was shown in the guide, and it now works correctly as you described.

 

I was confused by the following bolded statement below in the guide:

Under the title 'Nodes' replace the lines:

[[99]] datacode = h datacodes = l, h, h, h,

with:

[[10]] datacodes = L, h, h, h, h, l, l, l, l

Change [[10]] to the node id of your emontx if its different.

 

I assumed that because I had [[99]] previously and it worked that I did not have to change it to 10.

Next I will follow the guide exactly.

 

 

Final question:

I have had my emonbase  & emonTx running for almost two weeks, and as part of trying to get this working I deleted all of my local two weeks worth of data.

So far I have not deleted my data at emoncms.org.

Can I keep my existing data at emoncms.org, and change the Inputs and Feeds to match my new Inputs; or will I have to delete all of the existing Inputs and Feeds; and start over?

Thanks. Kind regards, Adrian Smith

 

pb66's picture

Re: confusion with Inputs received from the emonTxV3_4_continuous_kwhtotals

The best way to preserve your "node 10 " data/settings etc at emoncms.org would be to change node id. On the later emonTx's you can do this without changing the sketch as there is a "node 9 or 10" switch.

You will of course have to re-edit the recently changed [[10]] to [[9]] in emonhub.conf.

Paul

Comment viewing options

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