Emonhub upgrade not working

I have been successfully running an old version of emoncms with emonhub on a Raspberry pi for a very long time (more than ten years), but I have found that very occasionally, my temperature updates have stopped working, requiring a reboot. This only happens say once every few weeks, so it is difficult to debug.
I have since found that restarting the emonhub service resolves the issue. I was running version 2.1.2, so decided to update to the latest version before asking for any help.
I downloaded the latest version from git and installed using the script. I am now running version 2.7.2, which appears to be mostly working, except for updating emoncms.

Note that I had to manually install paho using the suggestion here: Emonhub - paho-mqtt fails to install - #16 by MBC

From my old installation, here is an extract of the log when sending to emoncms:

2025-01-26 17:52:25,251 INFO     emonCMS    sending: http://localhost/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1737913922.482998,23,17,0,55,2.8000000000000003,0,-68]]&sentat=1737913945

This command still works when pasting into a browser, and replacing the API key with the correct value.
Here is an extract of the log for the current version:

2025-02-19 13:17:15,852 DEBUG    RFM2Pi     7 NEW FRAME : OK 23 164 0 0 0 211 1 28 0 0 0 0 0 (-63)
2025-02-19 13:17:15,856 DEBUG    RFM2Pi     7 Timestamp : 1739971035.852215
2025-02-19 13:17:15,857 DEBUG    RFM2Pi     7 From Node : 23
2025-02-19 13:17:15,859 DEBUG    RFM2Pi     7    Values : [16.400000000000002, 0, 46.7, 2.8000000000000003, 0]
2025-02-19 13:17:15,860 DEBUG    RFM2Pi     7      RSSI : -63
2025-02-19 13:17:15,862 DEBUG    RFM2Pi     7 Sent to channel(start)' : ToEmonCMS
2025-02-19 13:17:15,863 DEBUG    RFM2Pi     7 Sent to channel(end)' : ToEmonCMS
2025-02-19 13:17:16,159 INFO     MQTT       Connecting to MQTT Server
2025-02-19 13:17:16,232 DEBUG    emonCMS    Buffer size: 1
2025-02-19 13:17:16,234 DEBUG    emoncmsorg Buffer size: 1
2025-02-19 13:17:16,235 INFO     emonCMS    sending: http://192.168.0.30/emoncms/input/bulk.json?sentat=1739971036 (68 bytes of data, 1 frames, uncompressed)
2025-02-19 13:17:16,266 INFO     MQTT       connection status: Connection successful
2025-02-19 13:17:16,270 DEBUG    MQTT       CONACK => Return code: 0
2025-02-19 13:17:16,285 WARNING  emonCMS    send failure: wanted 'ok' but got ''
2025-02-19 13:17:16,373 INFO     MQTT       on_subscribe

To me, this looks like the temperature signal is being received and processed, but the code is not including any data in the post to emoncms – just the sentat parameter.
Here is an extract from my config file:

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

Are you able to help please?

Maybe try replacing with the following:

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        senddata = 1    # Enable sending data to Emoncms.org
        sendnames = 0    # Send full input names (compression will be automatically enabled)
        interval = 30    # Bulk send interval to Emoncms.org in seconds

sendnames = 0 for compatibility with your inputs that will be number based.

Thanks for your help. I’ve tried your suggestion, but the post to emoncms remains the same - i.e. the data would appear to be missing.

The issue seems to be in the local emoncms install I think, perhaps that needs an update?

But emonhub has been working fine, and I can successfully post to it via a URL in the browser. From looking at the log, I think that for some reason, emonhub is only sending the sentat parameter, and none of the other data needed (unless the logging is misleading).

(68 bytes of data, 1 frames, uncompressed)

The log does indicate that one frame was sent, 68 bytes of data and without compression which is a newer feature. The content of the frame is not printed to the log.

Is there any way to log the contents?

I’m afraid not…

I noticed that one difference is that the API key is now passed in the Http header, rather than the URL. But even making some changes to the Python code, I still couldn’t get this to work.
So I have reverted, and added an hourly cron job to restart the emonhub service.