Community
OpenEnergyMonitor

Community

Emonhub Not Updating Arduino serial pulses, ADE9K SPI okay

Tags: #<Tag:0x00007fdb683081a8>

I am using emonSD-30Oct18, Emoncms Version low-write 9.9.8.
For my Energy Data I am using a ADE9K SPI C++ EmonPI using snprintf( postcmd, 1024,"/usr/bin/curl,…etc to http://192.168.1.77/emoncms/input/post...etc)
about every 10 seconds.

For Water, Gas, Sump Pump runs I am using
Trystan Lea Arduino 12 input Pulse Counting Sketch.
The Arduino does a Serial.print about every 10 seconds.

It has been running for about 6 weeks so far.
It runs great, very accurate, but about
every 3 weeks the Emonhub stops updating the
Arduino serial pulses. SPI posting continues to work fine.

Rebooting the Pi from the Emoncms Adminstration resolves the problem.

The only thing I noticed so far is that the Swap --> Memory
from the Emoncms Adminstration was at 93.05% before reboot.

I will continue to trouble-shoot, if anyone
had a similiar, I would appreciate any suggestions.
Thanks in Advance.

######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
#######################       Interfacers       #######################
#######################################################################

[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
        #calibration = 230V              # (UK/EU: 230V, US: 110V)
        #quiet = true        # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
        # THIS WAS COMMENTED BEFORE dlp interval =  0      # Interval to transmit time to emonGLCD (seconds)

[[SerialTx3e]]
     Type = EmonHubTx3eInterfacer
      [[[init_settings]]]
           # Un-comment line below if using RS485 adapter
           #com_port = /dev/ttyRS485-0
           # default com port if using USB to UART adapter
           #com_port= /dev/tty/ACM0 1/1/2019 dlp use this id /dev/ttyUSB0 don't work
           #com_port= /dev/ttyUSB0
           #com_port= /dev/ttyS0
           com_port = /dev/ttyAMA0
           com_baud = 115200
      [[[runtimesettings]]]
           pubchannels = ToEmonCMS,
	   nodeoffset = 8
     
[[SPI_ADE9K]]
        Type = EmonHubSocketInterfacer
        [[[init_settings]]]
                port_nb = 50012
        [[[runtimesettings]]]
                timestamped = true
                url = http://localhost/emoncms
                #apikey = 84b1837bffb6d3db93dff4e0887d9a15
                pubchannels = ToEmonCMS,
	       #nodeoffset = 13
                nodeId = 13
   		#baseid = 13
[[MQTT]]

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

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

        # 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

#######################################################################
#######################          Nodes          #######################
#######################################################################

[[8]]
    nodename = emontx3
    [[[rx]]]
       #names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      names = pulse1, pulse2, pulse3, pulse4, pulse5, pulse6, pulse7, pulse8, pulse9, pulse10, pulse11, pulse12
       ##datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      ## datacodes = h,h,h,h,h,h,h,h,h,h,h,h
       datacode = 0
       #scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       scales = 1,1,1,1,1,1,1,1,1,1,1,1
       #units =W,W,W,W,V,C,C,C,C,C,C,p
       units =p,p,p,p,p,p,p,p,p,p,p,p


[[13]]
    nodename = ADE9K
    [[[rx]]]
       names = L1V, L1A, L1W, L1VA, L1pf, L2V, L2A, L2W, L2VA, L2pf, L12W
       scales = 1,1,1,1,1,1,1,1,1,1,1
       units =V,A,W,VA,pf,V,A,W,VA,pf,W

Please put 3 backticks on a separate line before and after a quoted piece such as the conf file. Doing so prevents symbols within the file being interpreted as mark-up.

Thanks Robert, I started to correct, but noticed that you must of added the three backticks for me. Thank You. I also added a jpg attachment, but I did not see it when I looked at my post. I may not have attachment privileges. Not a problem, it was just a screenshot of Admin view of the Swap Memory at 93.05%.

You had uploaded a screenshot. I think it didn’t appear because of white space issues - I’d mistakenly put it inside the backticks. But we generally prefer to have the data copied and pasted where practical, rather than having an image.

This is an issue with /var/log filling up (clue is that swap is full). Update and it should be fixed I think.

There is a known issue that fills the log partition, eventually stopping emoncms updating. One of the symptoms is that swap space gets used, rarely gets used otherwise.

There have been some changes to the new emonhub service recently to elieviate that issue and they came in just after emoncms v10 so just running an update may fix this, it’s certainly a good place to start

Thanks pb66 borpin.
I updated from Emoncms from 9.9.8 to 10.0.2.
Checking disk (df -h) space before and after, confirms your replies that the var\log is filling up.

I won’t know for sure for about 3 more weeks, but this most likely the problem.

Thanks Much.

Version 9.9.8 Before Update
image
Version10.0.2 After Update
image

Odd, /var/log & /home/pi/data/ has gone from the output of df -h @pb66

The second pic has been posted in error I suspect. /var/tmp and /tmp are both missing, /boot is apparently on the 6th partition of the sdcard and the hostname is raspberrypi not emonpi, I doubt this is of an emonsd image at all.

1 Like

Oops! The second picture was wrong. It was from a RPI3 running a 10.1" LCD for a Emoncms Local Display. It has been corrected in the post.
Thanks for catching that!

1 Like