Community
OpenEnergyMonitor

Community

Directly connecting to Optical Pulse Counter with RPi?


(Chris) #1

Hi guys,

On the old forum I asked this question once, but never got things working unfortunately. Now I am revisiting this project and have what might be a simple problem, but has so far proven a problem:

I have 2 pieces of hardware:

  • first gen Raspberry Pi, running the latest raspbian
  • the OEM Optical Pulse Counter (OPC)
    … and three cables that I need to stick into the gpio pins on my RPi. So far I have the ground and power connected properly, and when holding a blinkenlight under the sensor, the green LED on top blinks in unison. This implies that there also is “something” going over the third little cable, waiting to be listend to.

But, how do I listen to the ttl signal without adding any more hardware in between?

  • Which pin on the RPi (see https://pinout.xyz/ )
  • Which command(s) on the commandline, or perhaps a script.

I already tried a bunch of things, but that was all for pre-systemd linux. (http://elinux.org/RPi_Serial_Connection#Connection_to_a_microcontroller_or_other_peripheral) Nothing seems to be working, including:

cat /dev/ttyAMA0 whilst ttl cable connected to pin RX, or connected to pin TX, or a generic other GPIO pin
some minicom stuff, but in there, nothing happens.
python script in an attempt to read serial, nothing whatsoever

This leaves me wondering, what exactly is the OPC outputting, and how can I get this output to a commandline using only a Raspberry? I would expect that the OPC would do something such as print(“I saw a pulse”), in whatever form.

… and a quick follow-up: What is the baud rate of the OPC?


Pulse monitoring on a Pi
Minimum setup for Solar + Grid Monitoring
EmonTH with Flukso water probe
SMA inverter and Elster meter
4 CT emonBase using emonTx and Pi Zero W
Python script runs but emoncms.org does not update (Hangs at end of script)
[Newbie] water gas and electricity metering and live reading
Gas Monitoring
More than one optical pulse on an emonTX/emonPI
(Paul) #2

You can indeed use the optical pulse counter directly with a Pi.

I use a python script with 2 pulse counters, their data pins are connected to gpio pins 13 and 15, and are powered by pins 9 and 17 so that a simple 1x5 header socket could be plugged directly on the gpio pins (9-17 odds).

Rather than chop the rj45’s off the pulse counters I use a surface mount double rj45 socket with just 4 wires between the sockets and the Pi gpio.

The pulse counters are just a logic level switch, it just translates the light pulses to a distinct on or off signal. there is no baud as such although there is probably a maximum switching speed, but there is very little in the way of info on the shop sold device, We don’t even know what components are used. (hint hint @glyn.hudson can you share some tech info/schematic?)

The python code I use sends an accumulating count for each pulse counter to emonhub via a web socket. It may not suit your needs exactly but should get you started at least, there are notes but do ask if anything is unclear.

pulses.py.txt (3.5 KB)

And here’s a couple of pic’s of 2 pulse counters in situ, you can see the double rj45 socket in the top left corner of the enclosure.


Multiple apartments
Simple instructions for Rpi3.. please :(
Measuring compost pile heat production via water flow temperature difference
(Glyn Hudson) #3

Nice tidy setup :slight_smile:

I’ve shared all we know! I have tried my best to get the schematic from the factory in China but they won’t share it with us. I did tear down the unit and take some photos of the components inside. Everything we know is documented here: https://openenergymonitor.org/emon/opticalpulsesensor

I would love to have full schematics and gerbers, just like I would love the have full schematics showing how an ATmega328, ESP8266 and RFM69CW work :frowning:


(Chris) #4

Thanks for the awesome reply guys! I’ve got the OPC working. In sofar that when I hold a blinking light under the sensor, I get a binary blurp on screen (some unintelligible garbage, as if you read serial with the wrong baud rate.) But hey, as the OPC only does that when a pulse is detected, a boolean test works brilliantly.

I’ll make a short write-up including pics when I have the time. Really pulse-detection 101 without anything added.

Now, let the fun times begin :slight_smile:


(dBC) #5

It sounds like you might have a UART between the you and the sensor, which is probably not what you want for reliable operation. You want to talk directly to the GPIO subsystem which is what Paul’s python code above does.


(Brian Orpin) #6

@pb66, that is a super impressive setup.

Looking at it, how are you connecting the Pi and the EmonTX together (directly from the UART)? Is that documented somewhere?

It also strikes me again, that there should be a Wiki that folk can use to contribute solutions and setups for this great community. It is all well and good this being in the forum, but it is difficult to find if you are new in or even if you do a ‘I’m sure I remember’ …


(Paul) #7

Thanks, Brian.

Yes the emonTx 6pin header is connected to the Pi’s GPIO as per the usual “serial-direct” which I believe is documented somewhere in the wiki/site(s), the only real difference being I also connect the emonTx header’s “reset” pin to the Pi’s GPIO18 (pin12) so I can upload sketches to it much the same way we can to the RFM2Pi’s.

I choose to use just the “even” pins 4(5v), 6(gnd), 8(tx), 10(rx) and 12 (GPIO18 “reset”) so a 1x5 way connector could plug on to the Pi’s GPIO alongside the “odd” pins used for the pulse counters as described above.


Open collector
(Neil Trimboy) #8

Just starting a first time install.
I’ve installed emonSD-03May16 onto a pi and got that going along with an optical sensor wired to GPIO and using the script above from @pb66 .
Script worked out of the box :slight_smile: alothough I’ve reduced it to one sensor.

I am struggling though to get the data to appear on a node in emoncms.

My emonhob conf contains (as described in the sample py code)

[[Pulse]]
    Type = EmonHubSocketInterfacer
    [[[init_settings]]]
            port_nb = 50012
    [[[runtimesettings]]]
            timestamped = True

The pulses from the sensor seem to get into the log file fine :

2016-11-11 08:42:49,225 DEBUG    Pulse      1 NEW FRAME : 1478853769.06 18 1
2016-11-11 08:42:49,227 DEBUG    Pulse      1 Timestamp : 1478853769.06
2016-11-11 08:42:49,228 DEBUG    Pulse      1 From Node : 18
2016-11-11 08:42:49,229 DEBUG    Pulse      1    Values : [1]
2016-11-11 08:42:49,229 DEBUG    Pulse      1 Sent to channel' : ch1
2016-11-11 08:42:54,417 DEBUG    Pulse      2 NEW FRAME : 1478853774.31 18 3
2016-11-11 08:42:54,418 DEBUG    Pulse      2 Timestamp : 1478853774.31
2016-11-11 08:42:54,419 DEBUG    Pulse      2 From Node : 18
2016-11-11 08:42:54,420 DEBUG    Pulse      2    Values : [3]
2016-11-11 08:42:54,420 DEBUG    Pulse      2 Sent to channel' : ch1

That is where I now get stuck.
I think I need to create a node in the emonhub config so have added

[[18]]
    nodename = pulsecounter
    [[[rx]]]
    names = pulsecnt1
    scales = 1
    units = W

I now get two lines in my inputs, pulsecounter with a Key of p, and pulsecounter with a key of rssi. Neither gets updated.

I am suspicious that the log file when the pulsecounts arrive says…

Sent to channel’ : ch1

but at boot i get a line that says subscribed to ch2 ???

Any pointers appreciated, thanks

2016-11-11 08:24:04,037 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2016-11-11 08:24:05,040 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2016-11-11 08:24:05,041 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2016-11-11 08:24:05,042 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2016-11-11 08:24:05,043 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2016-11-11 08:24:05,045 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2016-11-11 08:24:05,046 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2016-11-11 08:24:05,051 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2016-11-11 08:24:05,053 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2016-11-11 08:24:05,056 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2016-11-11 08:24:05,058 INFO     MainThread Creating EmonHubSocketInterfacer 'Pulse' 
2016-11-11 08:24:05,059 DEBUG    MainThread Opening socket on port 50012
2016-11-11 08:24:05,060 DEBUG    MainThread Setting Pulse timestamped: True

2016-11-11 08:24:05,062 DEBUG    MainThread Interfacer: Subscribed to channel' : ch2
**THIS LINE HERE ??**

2016-11-11 08:24:05,153 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,258 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,361 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,465 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,569 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,673 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,778 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:05,781 INFO     MQTT       connection status: Connection successful
2016-11-11 08:24:05,783 DEBUG    MQTT       CONACK => Return code: 0
2016-11-11 08:24:05,885 INFO     MQTT       on_subscribe
2016-11-11 08:24:11,688 INFO     MQTT       Unexpected disconnection
2016-11-11 08:24:11,789 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:11,911 INFO     MQTT       Connecting to MQTT Server
2016-11-11 08:24:11,915 INFO     MQTT       connection status: Connection successful
2016-11-11 08:24:11,917 DEBUG    MQTT       CONACK => Return code: 0
2016-11-11 08:24:12,020 INFO     MQTT       on_subscribe

(Paul) #9

The [[Pulse]] socket interfacer is using the default “ch1” and “ch2” that are not used in the standard OEM settings for the emonpi variant of emonhub. try adding

        pubchannels = ToEmonCMS,

to the [[Pulse]] [[[runtimesettings]]] in emonhub.conf, a subchannels setting (currently ch2) is irrelevant as the data for this interfacer will only ever flow one way.

An alternative way of doing it could be to add “ch1” to the [[emoncmsorg]] and/or [[mqtt]] interfacers subchannels setting eg

        subchannels = ToEmonCMS, ch1

I only offer this alternative as an insight to how the “channels” are intended to work, the more channels used the more flexibility you have to direct the traffic, with just the one pubchannel “ToEmonCMS” this emonhub version works just like it’s original predecessor in that all traffic gets sent to the same place(s).


(Neil Trimboy) #10

Thanks @pb66, I’d actually guessed your initial suggestion previously but it results in
2016-11-11 10:05:01,976 WARNING MainThread Pulse thread is dead

Screen shot attached of the instant the first pulse is sent from py script (it is OK up until then)

It does though manage to get a single entry in the INPUTS section.

Your second suggested way seems to result in the same out come ?!


(Paul) #11

Oh dear!

I can only advise on how it was intended to work and what I’ve seen on the forum, I do not use this version and my “routing code” was removed and replaced with an external PubSub module after I had written and tested it.

This may also be linked to the previously seen “thread is dead” issues with this variant of emonhub as the “Pulse” thread should not be "Publishing: " that is the job of the MQTT interfacer (see the 4 log entries immediately prior to the first “WARNING MainThread Pulse thread”)

I’m just heading out shortly so I cannot look into it right now. I can try and help you further later on if I get time.


(Neil Trimboy) #12

OK thanks for your help so far.
If you could look again would be appreciated else I’m rather stuck.!

Midnight here anyway so off to bed…


(Paul) #13

I have submitted a PR for an additional log message to be added for the purpose of tracking whether the issue occurs before, during or after it’s cross thread adventures.

I have simply added this log message prior to the data frame actually being "sent to channel: " and added “(end)” to the existing log message after the frame is "Sent to channel: "

This allows us to determine if the issue occurs whilst doing “MQTT” activities or after it returns to it’s “Pulse” duties. The edits are simple enough to add manually if the PR doesn’t get pulled in.

These log messages are important to the existing “thread is dead” issues as in theory there should be no other logs produced between these 2 messages, by the same thread/interfacer. In practice I’m sure we will see at least the "Publishing: " logs.

It is also useful to your issue regardless of whether the 2 are linked or not as I notice in your original logs that the Pulse thread is returning from "Sending to: " the MQTT as the “Sent to channel’: ch1” log entry is produced afterwards.

however the screenshot shows no such entry despite the logs showing the MQTT was published, which means the thread failed immediately after doing “MQTT” duties or crashed immediately upon return, before writing the log entry.

Could you show me the logs? I’m interested to know if it is one specific channel or any channel that cause it to fail.


(Neil Trimboy) #14

Paul,

thanks. I have put in your changes, here is output.
This is from a running system, I then added the following
pubchannels = ToEmonCMS, to [[Pulse]][[[runtimesettings]]]]
and pressed SAVE at about 07:03:35

I then started your pulses.py script at about 07:04:05
As before it does manage to get a single entry into the INPUTs page

2016-11-13 07:02:28,903 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:02:57,652 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479020577
2016-11-13 07:02:58,957 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:02:58,958 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:03:27,702 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479020607
2016-11-13 07:03:29,002 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:03:29,003 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:03:35,115 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2016-11-13 07:03:35,116 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2016-11-13 07:03:35,117 DEBUG    MainThread Setting Pulse pubchannels: ['ToEmonCMS']
2016-11-13 07:03:35,118 DEBUG    MainThread Interfacer: Subscribed to channel' : ch2
2016-11-13 07:03:57,751 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479020637
2016-11-13 07:03:59,038 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:03:59,039 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:04:05,562 DEBUG    Pulse      1 NEW FRAME : 1479020645.42 18 0
2016-11-13 07:04:05,563 DEBUG    Pulse      1 Timestamp : 1479020645.42
2016-11-13 07:04:05,563 DEBUG    Pulse      1 From Node : 18
2016-11-13 07:04:05,564 DEBUG    Pulse      1    Values : [0]
2016-11-13 07:04:05,564 DEBUG    Pulse      1 Sent to channel(start)' : ToEmonCMS
2016-11-13 07:04:05,565 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 07:04:05,567 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:04:05,569 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 07:04:05,571 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:04:05,752 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:05,982 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:06,209 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:06,434 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:06,660 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:06,886 WARNING  MainThread Pulse thread is dead
2016-11-13 07:04:07,118 WARNING  MainThread Pulse thread is dead````

I will answer the following in separate post


(Neil Trimboy) #15

Slightly different result @pb66
This is with

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS, ch1
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
        senddata = 1                    # Enable sending data to Emoncms.org
        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
        sendinterval= 30                # Bulk send interval to Emoncms.org in seconds

[[Pulse]]
        Type = EmonHubSocketInterfacer
        [[[init_settings]]]
                port_nb = 50012
        [[[runtimesettings]]]
                #pubchannels = ToEmonCMS,
                timestamped = True

and nothing gets into my INPUT’s page

2016-11-13 07:26:15,356 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:26:15,357 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:26:44,151 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479022004
2016-11-13 07:26:45,456 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:26:45,457 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:26:53,582 DEBUG    Pulse      1 NEW FRAME : 1479022013.44 18 0
2016-11-13 07:26:53,583 DEBUG    Pulse      1 Timestamp : 1479022013.44
2016-11-13 07:26:53,584 DEBUG    Pulse      1 From Node : 18
2016-11-13 07:26:53,585 DEBUG    Pulse      1    Values : [0]
2016-11-13 07:26:53,585 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 07:26:53,724 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:53,950 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:54,175 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:54,417 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:54,645 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:54,871 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:55,097 WARNING  MainThread Pulse thread is dead
2016-11-13 07:26:55,323 WARNING  MainThread Pulse thread is dead```` 

HOWEVER
Just putting ch1 into MQTT subchannel gives

2016-11-13 07:30:22,070 INFO     MainThread EmonHub emonHub 'emon-pi' variant v1.2
2016-11-13 07:30:22,071 INFO     MainThread Opening hub...
2016-11-13 07:30:22,072 INFO     MainThread Logging level set to DEBUG
2016-11-13 07:30:22,073 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2016-11-13 07:30:22,080 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2016-11-13 07:30:24,084 WARNING  MainThread Device communication error - check settings
2016-11-13 07:30:24,085 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2016-11-13 07:30:25,087 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2016-11-13 07:30:26,089 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2016-11-13 07:30:27,092 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2016-11-13 07:30:28,094 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2016-11-13 07:30:29,096 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2016-11-13 07:30:29,097 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2016-11-13 07:30:29,098 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2016-11-13 07:30:29,099 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2016-11-13 07:30:29,101 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2016-11-13 07:30:29,103 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2016-11-13 07:30:29,107 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2016-11-13 07:30:29,109 DEBUG    MainThread MQTT Subscribed to channel' : ch1
2016-11-13 07:30:29,110 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2016-11-13 07:30:29,112 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2016-11-13 07:30:29,114 INFO     MainThread Creating EmonHubSocketInterfacer 'Pulse'
2016-11-13 07:30:29,116 DEBUG    MainThread Opening socket on port 50012
2016-11-13 07:30:29,117 DEBUG    MainThread Setting Pulse timestamped: True
2016-11-13 07:30:29,118 DEBUG    MainThread Interfacer: Subscribed to channel' : ch2
2016-11-13 07:30:29,210 INFO     MQTT       Connecting to MQTT Server
2016-11-13 07:30:29,315 INFO     MQTT       Connecting to MQTT Server
2016-11-13 07:30:29,319 INFO     MQTT       connection status: Connection successful
2016-11-13 07:30:29,321 DEBUG    MQTT       CONACK => Return code: 0
2016-11-13 07:30:29,423 INFO     MQTT       on_subscribe
2016-11-13 07:30:36,679 INFO     MQTT       Unexpected disconnection
2016-11-13 07:30:36,781 INFO     MQTT       Connecting to MQTT Server
2016-11-13 07:30:36,783 INFO     MQTT       Could not connect...
2016-11-13 07:30:37,886 INFO     MQTT       Connecting to MQTT Server
2016-11-13 07:30:38,009 INFO     MQTT       Connecting to MQTT Server
2016-11-13 07:30:38,028 INFO     MQTT       connection status: Connection successful
2016-11-13 07:30:38,030 DEBUG    MQTT       CONACK => Return code: 0
2016-11-13 07:30:38,132 INFO     MQTT       on_subscribe
2016-11-13 07:30:59,144 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479022259
2016-11-13 07:31:00,596 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:31:00,597 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:31:29,209 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479022289
2016-11-13 07:31:30,490 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:31:30,491 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:31:46,443 DEBUG    Pulse      1 NEW FRAME : 1479022306.35 18 0
2016-11-13 07:31:46,444 DEBUG    Pulse      1 Timestamp : 1479022306.35
2016-11-13 07:31:46,444 DEBUG    Pulse      1 From Node : 18
2016-11-13 07:31:46,445 DEBUG    Pulse      1    Values : [0]
2016-11-13 07:31:46,445 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 07:31:46,446 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 07:31:46,448 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:31:46,450 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 07:31:46,451 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:31:46,453 DEBUG    Pulse      1 Sent to channel(end)' : ch1
2016-11-13 07:31:51,867 DEBUG    Pulse      2 NEW FRAME : 1479022311.57 18 0
2016-11-13 07:31:51,868 DEBUG    Pulse      2 Timestamp : 1479022311.57
2016-11-13 07:31:51,869 DEBUG    Pulse      2 From Node : 18
2016-11-13 07:31:51,869 DEBUG    Pulse      2    Values : [0]
2016-11-13 07:31:51,870 DEBUG    Pulse      2 Sent to channel(start)' : ch1
2016-11-13 07:31:51,870 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 07:31:51,872 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:31:51,874 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 07:31:51,875 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:31:51,877 DEBUG    Pulse      2 Sent to channel(end)' : ch1
2016-11-13 07:31:57,045 DEBUG    Pulse      3 NEW FRAME : 1479022316.93 18 0
2016-11-13 07:31:57,046 DEBUG    Pulse      3 Timestamp : 1479022316.93
2016-11-13 07:31:57,047 DEBUG    Pulse      3 From Node : 18
2016-11-13 07:31:57,047 DEBUG    Pulse      3    Values : [0]
2016-11-13 07:31:57,048 DEBUG    Pulse      3 Sent to channel(start)' : ch1
2016-11-13 07:31:57,048 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 07:31:57,050 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:31:57,052 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 07:31:57,054 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:31:57,056 DEBUG    Pulse      3 Sent to channel(end)' : ch1
2016-11-13 07:31:59,303 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479022319
2016-11-13 07:32:00,601 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 07:32:00,602 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 07:32:02,123 DEBUG    Pulse      4 NEW FRAME : 1479022321.99 18 1
2016-11-13 07:32:02,124 DEBUG    Pulse      4 Timestamp : 1479022321.99
2016-11-13 07:32:02,124 DEBUG    Pulse      4 From Node : 18
2016-11-13 07:32:02,125 DEBUG    Pulse      4    Values : [1]
2016-11-13 07:32:02,126 DEBUG    Pulse      4 Sent to channel(start)' : ch1
2016-11-13 07:32:02,127 INFO     Pulse      Publishing: emon/18/1 1
2016-11-13 07:32:02,136 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:32:02,139 INFO     Pulse      Publishing: emonhub/rx/18/values 1
2016-11-13 07:32:02,141 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:32:02,144 DEBUG    Pulse      4 Sent to channel(end)' : ch1
2016-11-13 07:32:07,257 DEBUG    Pulse      5 NEW FRAME : 1479022327.2 18 2
2016-11-13 07:32:07,258 DEBUG    Pulse      5 Timestamp : 1479022327.2
2016-11-13 07:32:07,259 DEBUG    Pulse      5 From Node : 18
2016-11-13 07:32:07,259 DEBUG    Pulse      5    Values : [2]
2016-11-13 07:32:07,260 DEBUG    Pulse      5 Sent to channel(start)' : ch1
2016-11-13 07:32:07,261 INFO     Pulse      Publishing: emon/18/1 2
2016-11-13 07:32:07,262 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:32:07,264 INFO     Pulse      Publishing: emonhub/rx/18/values 2
2016-11-13 07:32:07,265 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:32:07,266 DEBUG    Pulse      5 Sent to channel(end)' : ch1
2016-11-13 07:32:12,680 DEBUG    Pulse      6 NEW FRAME : 1479022332.58 18 2
2016-11-13 07:32:12,681 DEBUG    Pulse      6 Timestamp : 1479022332.58
2016-11-13 07:32:12,682 DEBUG    Pulse      6 From Node : 18
2016-11-13 07:32:12,682 DEBUG    Pulse      6    Values : [2]
2016-11-13 07:32:12,683 DEBUG    Pulse      6 Sent to channel(start)' : ch1
2016-11-13 07:32:12,684 INFO     Pulse      Publishing: emon/18/1 2
2016-11-13 07:32:12,685 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:32:12,686 INFO     Pulse      Publishing: emonhub/rx/18/values 2
2016-11-13 07:32:12,688 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:32:12,689 DEBUG    Pulse      6 Sent to channel(end)' : ch1
2016-11-13 07:32:17,940 DEBUG    Pulse      7 NEW FRAME : 1479022337.85 18 2
2016-11-13 07:32:17,941 DEBUG    Pulse      7 Timestamp : 1479022337.85
2016-11-13 07:32:17,941 DEBUG    Pulse      7 From Node : 18
2016-11-13 07:32:17,942 DEBUG    Pulse      7    Values : [2]
2016-11-13 07:32:17,942 DEBUG    Pulse      7 Sent to channel(start)' : ch1
2016-11-13 07:32:17,943 INFO     Pulse      Publishing: emon/18/1 2
2016-11-13 07:32:17,945 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 07:32:17,946 INFO     Pulse      Publishing: emonhub/rx/18/values 2
2016-11-13 07:32:17,947 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 07:32:17,948 DEBUG    Pulse      7 Sent to channel(end)' : ch1
2016-11-13 07:32:23,291 DEBUG    Pulse      8 NEW FRAME : 1479022343.15 18 2
2016-11-13 07:32:23,292 DEBUG    Pulse      8 Timestamp : 1479022343.15
2016-11-13 07:32:23,292 DEBUG    Pulse      8 From Node : 18
2016-11-13 07:32:23,293 DEBUG    Pulse      8    Values : [2]
2016-11-13 07:32:23,293 DEBUG    Pulse      8 Sent to channel(start)' : ch1
2016-11-13 07:32:23,294 INFO     Pulse      Publishing: emon/18/1 2

So it seems I can send the pulses though to MQTT, get the pulses appearing in INPUTS and can generate a Whaccumulator feed and show a graph.
Cant though get the data to my remote Emoncms.org

Aside : thanks for removing the KEY, ill remember next time !


(Paul) #16

Okay so that last configuration seems to work ok except for the data not reaching emoncms.org, which would seem correct for the settings as MQTT is configured to listen to both ToEmonCMS and ch1, where as emoncmsorg is configured for just ToEmonCMS and the Pulse data is only going to ch1, correct?

Can you confirm what happens if you then just have “ch1,” without the “ToEmonCMS” for the emoncmsorg subchannels? I assume it will kill the thread based on the previous tests.

As a seperate test from that same “almost working” starting point can you also try adding " pubchannels = ch1, ToEmonCMS " to the Pulse settings? Just to try using 2 seperate channels rather than getting the 2 target interfacers to listen on the same channel.

Perhaps even try these tests again after disabling the RFM2Pi interfacer with a hash in front of the "Type = ",

I will ponder on these logs for a bit and take another look at the code.


(Neil Trimboy) #17

That would be my assumption, but my understanding and experience of this system is next to nothing

Test 1

It does !
Config is

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ch1, 
        #subchannels = ToEmonCMS, 
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
        senddata = 1                    # Enable sending data to Emoncms.org
        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
        sendinterval= 30                # Bulk send interval to Emoncms.org in seconds

[[Pulse]]
        Type = EmonHubSocketInterfacer
        [[[init_settings]]]
                port_nb = 50012
        [[[runtimesettings]]]
                #pubchannels = ToEmonCMS,
                timestamped = True

Output :

2016-11-13 10:13:57,580 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 10:13:57,580 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:14:26,308 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479032066
2016-11-13 10:14:27,594 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 10:14:27,595 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:14:47,217 DEBUG    Pulse      1 NEW FRAME : 1479032087.07 18 0
2016-11-13 10:14:47,218 DEBUG    Pulse      1 Timestamp : 1479032087.07
2016-11-13 10:14:47,218 DEBUG    Pulse      1 From Node : 18
2016-11-13 10:14:47,219 DEBUG    Pulse      1    Values : [0]
2016-11-13 10:14:47,219 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 10:14:47,220 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 10:14:47,223 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:14:47,225 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 10:14:47,227 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:14:47,443 WARNING  MainThread Pulse thread is dead
2016-11-13 10:14:47,669 WARNING  MainThread Pulse thread is dead
2016-11-13 10:14:47,895 WARNING  MainThread Pulse thread is dead
2016-11-13 10:14:48,121 WARNING  MainThread Pulse thread is dead
2016-11-13 10:14:48,347 WARNING  MainThread Pulse thread is dead
2016-11-13 10:14:48,572 WARNING  MainThread Pulse thread is dead

Test 2

Same as Test 1 but with RFM2Pi disabled as u describe gives :

2016-11-13 10:20:09,350 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:20:38,115 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479032438
2016-11-13 10:20:39,397 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 10:20:39,398 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:20:47,742 DEBUG    Pulse      1 NEW FRAME : 1479032447.67 18 0
2016-11-13 10:20:47,743 DEBUG    Pulse      1 Timestamp : 1479032447.67
2016-11-13 10:20:47,743 DEBUG    Pulse      1 From Node : 18
2016-11-13 10:20:47,744 DEBUG    Pulse      1    Values : [0]
2016-11-13 10:20:47,744 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 10:20:47,746 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 10:20:47,747 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:20:47,749 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 10:20:47,751 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:20:47,814 WARNING  MainThread Pulse thread is dead
2016-11-13 10:20:48,066 WARNING  MainThread Pulse thread is dead
2016-11-13 10:20:48,291 WARNING  MainThread Pulse thread is dead
2016-11-13 10:20:48,516 WARNING  MainThread Pulse thread is dead

Test 3
RFM2Pi ENABLED
pubchannels = ch1, ToEmonCMS added to Pulse as here :

[[Pulse]]
        Type = EmonHubSocketInterfacer
        [[[init_settings]]]
                port_nb = 50012
        [[[runtimesettings]]]
                pubchannels = ch1, ToEmonCMS
                timestamped = True

Shown at point of saving config file

2016-11-13 10:26:31,459 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 10:26:31,460 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:26:36,000 DEBUG    Pulse      8 NEW FRAME : 1479032795.99 18 10
2016-11-13 10:26:36,001 DEBUG    Pulse      8 Timestamp : 1479032795.99
2016-11-13 10:26:36,002 DEBUG    Pulse      8 From Node : 18
2016-11-13 10:26:36,002 DEBUG    Pulse      8    Values : [10]
2016-11-13 10:26:36,003 DEBUG    Pulse      8 Sent to channel(start)' : ch1
2016-11-13 10:26:36,004 INFO     Pulse      Publishing: emon/18/1 10
2016-11-13 10:26:36,014 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:26:36,016 INFO     Pulse      Publishing: emonhub/rx/18/values 10
2016-11-13 10:26:36,026 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:26:36,028 DEBUG    Pulse      8 Sent to channel(end)' : ch1
2016-11-13 10:26:42,371 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2016-11-13 10:26:42,373 DEBUG    MainThread MQTT Subscribed to channel' : ch1
2016-11-13 10:26:42,373 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2016-11-13 10:26:42,374 DEBUG    MainThread Setting Pulse pubchannels: ['ch1', 'ToEmonCMS']
2016-11-13 10:26:42,375 DEBUG    MainThread Interfacer: Subscribed to channel' : ch2
2016-11-13 10:26:43,448 DEBUG    Pulse      9 NEW FRAME : 1479032803.29 18 11
2016-11-13 10:26:43,449 DEBUG    Pulse      9 Timestamp : 1479032803.29
2016-11-13 10:26:43,449 DEBUG    Pulse      9 From Node : 18
2016-11-13 10:26:43,450 DEBUG    Pulse      9    Values : [11]
2016-11-13 10:26:43,450 DEBUG    Pulse      9 Sent to channel(start)' : ch1
2016-11-13 10:26:43,451 INFO     Pulse      Publishing: emon/18/1 11
2016-11-13 10:26:43,461 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:26:43,463 INFO     Pulse      Publishing: emonhub/rx/18/values 11
2016-11-13 10:26:43,465 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:26:43,467 DEBUG    Pulse      9 Sent to channel(end)' : ch1
2016-11-13 10:26:43,467 DEBUG    Pulse      9 Sent to channel(start)' : ToEmonCMS
2016-11-13 10:26:43,468 INFO     Pulse      Publishing: emon/18/1 11
2016-11-13 10:26:43,470 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:26:43,471 INFO     Pulse      Publishing: emonhub/rx/18/values 11
2016-11-13 10:26:43,473 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:26:43,509 WARNING  MainThread Pulse thread is dead
2016-11-13 10:26:43,737 WARNING  MainThread Pulse thread is dead
2016-11-13 10:26:43,962 WARNING  MainThread Pulse thread is dead
2016-11-13 10:26:44,188 WARNING  MainThread Pulse thread is dead
2016-11-13 10:26:44,415 WARNING  MainThread Pulse thread is dead
2016-11-13 10:26:44,642 WARNING  MainThread Pulse thread is dead

result is


Test4
Same as Test 4 but with RFM2Pi disabled as u describe gives :

2016-11-13 10:31:01,475 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 10:31:01,475 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 10:31:10,436 DEBUG    Pulse      1 NEW FRAME : 1479033070.18 18 0
2016-11-13 10:31:10,437 DEBUG    Pulse      1 Timestamp : 1479033070.18
2016-11-13 10:31:10,438 DEBUG    Pulse      1 From Node : 18
2016-11-13 10:31:10,438 DEBUG    Pulse      1    Values : [0]
2016-11-13 10:31:10,439 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 10:31:10,440 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 10:31:10,442 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:31:10,443 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 10:31:10,445 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:31:10,446 DEBUG    Pulse      1 Sent to channel(end)' : ch1
2016-11-13 10:31:10,447 DEBUG    Pulse      1 Sent to channel(start)' : ToEmonCMS
2016-11-13 10:31:10,447 INFO     Pulse      Publishing: emon/18/1 0
2016-11-13 10:31:10,449 INFO     Pulse      Publishing: emon/18/rssi 0
2016-11-13 10:31:10,450 INFO     Pulse      Publishing: emonhub/rx/18/values 0
2016-11-13 10:31:10,452 INFO     Pulse      Publishing: emonhub/rx/18/rssi 0
2016-11-13 10:31:10,648 WARNING  MainThread Pulse thread is dead
2016-11-13 10:31:10,875 WARNING  MainThread Pulse thread is dead
2016-11-13 10:31:11,102 WARNING  MainThread Pulse thread is dead
2016-11-13 10:31:11,328 WARNING  MainThread Pulse thread is dead
2016-11-13 10:31:11,553 WARNING  MainThread Pulse thread is dead
2016-11-13 10:31:11,779 WARNING  MainThread Pulse thread is dead

(Paul) #18

Ok so removing the RFM2Pi has no impact, it was a long shot but I just wanted to rule out any “clashing” or conflicts caused by multiple connections, from what read about the pydispatcher module it should work but most users here will only have one channel so it wasn’t proven, but from what I can tell you are not currently using it so I would leave it disabled whilst we debug, it can’t hurt.

My Bad!, Can you remove the “ToEmonCMS” from the MQTT interfacer settings and retry test 3, My intention was to have traffic heading to MQTT on a separate channel to the traffic going to emoncmsorg, but I forgot the MQTT was still listening to “ToEmonCMS” as well, due to there not being any traffic on there during the last test.

So to confirm the RFM2Pi is disabled, Pulse sending to both “ch1” and “ToEmonCMS”, emoncmsorg listening to “ToEmonCMS” and MQTT listening to “ch1”

Hopefully this test will show MQTT successfully publish and then “Sent to channel(start)’ : ToEmonCMS”, if that is not followed by line containing “adding frame to buffer =>” then it would point to the emoncmsorg interfacer causing the Pulse thread to fail. If that is the case we can add a couple of log entries to the emoncmsHTTP interfacer to pinpoint where.


(Neil Trimboy) #19

Output

2016-11-13 19:46:48,468 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 19:46:48,469 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 19:47:17,242 INFO     emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1479066437
2016-11-13 19:47:18,524 DEBUG    emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2016-11-13 19:47:18,525 INFO     emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2016-11-13 19:47:26,505 DEBUG    Pulse      1 NEW FRAME : 1479066446.27 18 1
2016-11-13 19:47:26,506 DEBUG    Pulse      1 Timestamp : 1479066446.27
2016-11-13 19:47:26,507 DEBUG    Pulse      1 From Node : 18
2016-11-13 19:47:26,508 DEBUG    Pulse      1    Values : [1]
2016-11-13 19:47:26,508 DEBUG    Pulse      1 Sent to channel(start)' : ch1
2016-11-13 19:47:26,509 DEBUG    Pulse      1 Sent to channel(end)' : ch1
2016-11-13 19:47:26,510 DEBUG    Pulse      1 Sent to channel(start)' : ToEmonCMS
2016-11-13 19:47:26,545 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:26,771 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:26,997 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:27,223 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:27,477 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:27,750 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:27,976 WARNING  MainThread Pulse thread is dead
2016-11-13 19:47:28,202 WARNING  MainThread Pulse thread is dead

Config here :


[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[RFM2Pi]]
    #Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
        com_baud = 38400                        # 9600 for old RFM12Pi
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,

        group = 210
        frequency = 433
        baseid = 5                              # emonPi / emonBase nodeID
        quiet = true                            # Report incomplete RF packets (no implemented on emonPi)
        calibration = 230V                      # (UK/EU: 230V, US: 110V)
        # interval =  0                         # Interval to transmit time to emonGLCD (seconds)

[[MQTT]]

    Type = EmonHubMqttInterfacer
    [[[init_settings]]]
        mqtt_host = 127.0.0.1
        mqtt_port = 1883
        mqtt_user = emonpi
        mqtt_passwd = emonpimqtt2016

    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ch1

        # emonhub/rx/10/values format
        # Use with emoncms Nodes module
        node_format_enable = 1
        node_format_basetopic = emonhub/

        # emon/emontx/power1 format - use with Emoncms MQTT input
        # http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
        nodevar_format_enable = 1
        nodevar_format_basetopic = emon/

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS, 
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
        senddata = 1                    # Enable sending data to Emoncms.org
        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
        sendinterval= 30                # Bulk send interval to Emoncms.org in seconds

[[Pulse]]
        Type = EmonHubSocketInterfacer
        [[[init_settings]]]
                port_nb = 50012
        [[[runtimesettings]]]
                pubchannels = ch1, ToEmonCMS
                timestamped = True

Hope thats what u asked for, thanks


(Paul) #20

Yes, I think we’re getting somewhere now.

Before adding a load of extra log messages, could you just try adding a second value to your pulse.py? By coincidence I was just about to post a quick comment about a possibility that the emoncmsorg interfacer is not seeing the single value as a “list of one item” and trying to perform an array function (for each in…) might be tripping it up, your new log could support that theory too.