Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emonhub not receiving data, may not be sending data #134

Open
wrvolz opened this issue Oct 12, 2020 · 14 comments
Open

emonhub not receiving data, may not be sending data #134

wrvolz opened this issue Oct 12, 2020 · 14 comments

Comments

@wrvolz
Copy link

wrvolz commented Oct 12, 2020

I just upgraded to Buster and in the process I also upgraded emoncms and emonhub. It appears that emonhub is not receiving data. I can see the light on the radio receiver blink about every 10 seconds so I know it getting that far. But nothing is coming into the hub. The log is below:

2020-10-12 02:46:50,235 INFO MainThread Opening hub... 2020-10-12 02:46:50,238 INFO MainThread Logging level set to DEBUG 2020-10-12 02:46:50,239 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 2020-10-12 02:46:50,241 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s 2020-10-12 02:46:52,248 INFO MainThread RFM2Pi device firmware version: [RF12demo.12] 2020-10-12 02:46:52,249 INFO MainThread RFM2Pi device current settings: O i15 g210 @ 433 MHz q1 2020-10-12 02:46:52,251 INFO MainThread Setting RFM2Pi calibration: 230V (1p) 2020-10-12 02:46:53,253 DEBUG MainThread Setting RFM2Pi interval: 300 2020-10-12 02:46:53,361 DEBUG RFM2Pi RFM2Pi broadcasting time: 02:46 2020-10-12 02:51:53,411 DEBUG RFM2Pi RFM2Pi broadcasting time: 02:51
The Config file is:

`[reporters]

This reporter sends data to emonCMS

[[emonCMS]]

Type = EmonHubEmoncmsReporter

Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
    pubchannels = ToRFM12,
    subchannels = ToEmonCMS,
    url = https://localhost/emoncms #(defaults to emoncms.org)
    apikey = whatever...
    sendstatus = 1
    senddata = 1

`
I've tried both Types. http and https and with only url and apikey. This is config is from an earlier version of emoncms. I do not have an 'interfaces' section.

Now it did seem to be getting some data from somewhere. An earlier part of the log had this:

2020-10-12 01:51:48,165 INFO emonCMS sending: http://localhost/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1602480154.0,8,605,0,170,0,12760,3000,3000,3000,3000,3000,3000,1,0,-64],[1602480168.07,8,606,0,161,0,12770,3000,3000,3000,3000,3000,3000,1,0,-63],[1602480173.82,8,612,0,163,0,12760,3000,3000,3000,3000,3000,3000,1,0,-62],[1602480183.65,8,643,0,164,0,12764,3000,3000,3000,3000,3000,3000,1,0,-63],[1602480193.74,8,634,0,164,0,12768,3000,3000,3000,3000,3000,3000,1,0,-63],[1602480199.17,23,154,152,1058,23,1,0,-56],[1602480203.67,8,640,0,172,0,12779,3000,3000,3000,3000,3000,3000,1,0,-62]... 2020-10-12 01:51:48,188 WARNING emonCMS send failure: wanted 'ok' but got 'false'
I'm not getting this data any longer. Also note the last warning. And that the apikey is either not filled in or masked for the log. I also tried copying the first entry above and subbed my apikey and it returned 'false'.

Help? Thanks in advance

@alexandrecuer
Copy link
Contributor

Do you have the MQTT interfacer activated ? you need something like that in the emonhub conf :

[[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
        # interval =  300                         # 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 = 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/

normaly the http_interfacer is more for sending datas to a remote server, on the cloud
if you work locally on an emonpi, the radio interfacer received the datas and the MQTT interfacer publish them to MQTT. Then specific services will do the job within emoncms...

best

Alex

@wrvolz
Copy link
Author

wrvolz commented Oct 12, 2020 via email

@alexandrecuer
Copy link
Contributor

The log seems OK : it is receiving and publishing correctly for node 8
you've got the line

emonhub/rx/8/values 2420,0,116,0,128.08,300,300,300,300,300,300,1,-63

so you should see something in emoncms (input module) as far as node 8 is concerned....

Maybe check the node configuration for node 23 in case node 8 works and node 23 no

if you do not receive anything neither from node 23 nor node 8, check the services, for example via the admin module...you should see at least emoncms_mqtt and mosquitto running (green light)....if not the problem should be at this (service) level

@wrvolz
Copy link
Author

wrvolz commented Oct 12, 2020 via email

@alexandrecuer
Copy link
Contributor

check the emonhub.conf file to understand how to setup nodes, yu must have an interfacers section and a nodes section :
cf https://github.com/openenergymonitor/emonhub/blob/master/conf/emonhub.conf

screen copy of what should be the admin page :
image

if your emoncms installation is broken and if you want to check the services status, you can log in your emonpi through ssh

assuming your pi is 192.168.1.2 and you have a linux desktop, launch a shell and type ssh pi@192.168.1.2
then enter your password

once logged, you will be able to check the service status

systemctl status emoncms_mqtt.service
systemctl status mosquitto.service

How old was your installation ?
Did you make a backup before upgrading ?
you have a fresh image here : https://community.openenergymonitor.org/t/emonsd-24jul20-release/15170
if you have a backup, you can try to restore it on a new SD after burning a fresh image...
the fact is that emoncms ecosystem has got a complex build process, so when things are broken, it is sometimes hard to fix

for demandshaper, I don't know as I don't use this module...maybe go to the OEM community forum :
https://community.openenergymonitor.org/

@wrvolz
Copy link
Author

wrvolz commented Oct 12, 2020 via email

@alexandrecuer
Copy link
Contributor

there is a module called backup
it can be launched in command line
maybe do a git clone and launch the install process

cd /opt/emoncms/modules
git clone https://github.com/emoncms/backup
cd backup
./install.sh

check the config.cfg file created by the install process to check where the backup will be created and launch the export:

./emoncms-export.sh

hope your mariadb server is working fine -)

if not there could be another solution : read the card with a linux machine and copy all the /var/opt/emoncms directory, your feeds are inside...
if you don't have a lot of feeds, it is possible to create an sql script to feed a fresh database....

@wrvolz
Copy link
Author

wrvolz commented Oct 12, 2020 via email

@alexandrecuer
Copy link
Contributor

alexandrecuer commented Oct 13, 2020

Here is the correct link

https://github.com/openenergymonitor/emonhub/blob/master/configuration.md

You should not have two RFM2Pi interfacers déclared in the conf....

Did you take a look at the scripted install ?
https://github.com/openenergymonitor/EmonScripts

Check the install folder....mosquito script....
https://github.com/openenergymonitor/EmonScripts/blob/master/install/mosquitto.sh

@wrvolz
Copy link
Author

wrvolz commented Oct 13, 2020 via email

@alexandrecuer
Copy link
Contributor

I've asked several times so I'll be clear. I have on RFM module. I have
a EmonTX v3 (node 8). I have a EmonTH v5 (node 23)...... I've seen nothing about how to interface emonhub if 2 or more nodes are sending in data. This seems like a simple question since OpenEnergyMonitor sells these devices.

to be clear, the RFM interfacer can manage multiple nodes : there is nothing to do. Just declare one interfacer and the 2 nodes in the conf, that's it. emonhub should do the job....if it does not, it is surely because your emoncms_mqtt service is not working....

@wrvolz
Copy link
Author

wrvolz commented Oct 13, 2020 via email

@wrvolz
Copy link
Author

wrvolz commented Oct 13, 2020 via email

@wrvolz
Copy link
Author

wrvolz commented Oct 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants