Bridge 2 MQTT Brokers and rename topics

At this point i’m not even sure.

Which file has the proper settings for emoncms?

in settings.ini i have:

[mqtt]
enabled = true
host = 'localhost'
port = 1883
user = 'emonpi'
password = 'emonpimqtt2016'
basetopic = 'emon'
client_id = 'emoncms'
userid = 1
multiuser = false

Ok, they are correct.

Anything in the emoncms log?

While in the settings file, check log level is 1.

[edit]
In the admin page check the service is running

image

And check for errors in that

systemctl status emoncms_mqtt.service
$ systemctl status emoncms_mqtt.service
● emoncms_mqtt.service - Emoncms emoncms_mqtt script
     Loaded: loaded (/etc/systemd/system/emoncms_mqtt.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/emoncms_mqtt.service.d
             └─emoncms_mqtt.conf
     Active: active (running) since Thu 2023-10-05 07:31:02 UTC; 14min ago
       Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
    Process: 1049 ExecStartPre=/bin/mkdir -p ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 1051 ExecStartPre=/bin/chown ${USER} ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 1054 ExecStartPre=/bin/touch ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
    Process: 1060 ExecStartPre=/bin/chmod 666 ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
   Main PID: 1061 (php)
      Tasks: 1 (limit: 6988)
     Memory: 706.6M
        CPU: 4.452s
     CGroup: /system.slice/emoncms_mqtt.service
             └─1061 /usr/bin/php /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php

Oct 05 07:31:02 fountain systemd[1]: Started Emoncms emoncms_mqtt script.

It appears i do not have an admin page :open_mouth:

How did you do the install?

Have you created 2 users?

I used the install scripts

i do not recall creating another user.

looking at it again, this user has an ID 2 number, so there must be an admin account, but i do not remember that

I think if you don’t know what the username is, you are stuck and will have to reinstall :frowning:

I tried the factory reset and i had to create a new account

Ah, yes. OK, did that leave the bridge in place?

Anything in the emoncms log?

Yes it did. The bridge still works.

The log is empty

only entry:

2023-10-05 08:46:41.348|WARN|index.php|406 Not Acceptable|dashboard/view

Did you set log level as 1?

Note make changes to settings.ini not default_settings.ini (it looks like you quoted the default settings above and these can be overridden by the settings.ini file)

Yes, i’m editing settings.ini

after setting emoncms log level to 1

the emoncms log is a constant stream of mqtt messages

2023-10-05 13:10:22.052|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power/state 232
2023-10-05 13:10:22.063|INFO|emoncms_mqtt.php|emon/inverter_1/battery_voltage/state 27.4
2023-10-05 13:10:22.074|INFO|emoncms_mqtt.php|emon/inverter_1/load_apparent_power/state 165
2023-10-05 13:10:22.085|INFO|emoncms_mqtt.php|emon/inverter_1/pv_current_2/state 1.4
2023-10-05 13:10:22.096|INFO|emoncms_mqtt.php|emon/inverter_1/temperature/state 33.0
2023-10-05 13:10:22.107|INFO|emoncms_mqtt.php|emon/inverter_1/load_percentage/state 4
2023-10-05 13:10:22.118|INFO|emoncms_mqtt.php|emon/inverter_1/battery_current/state 5.0
2023-10-05 13:10:22.129|INFO|emoncms_mqtt.php|emon/inverter_1/grid_power/state 0
2023-10-05 13:10:22.140|INFO|emoncms_mqtt.php|emon/inverter_1/pv_voltage_1/state 1.4
2023-10-05 13:10:22.150|INFO|emoncms_mqtt.php|emon/inverter_1/pv_voltage_2/state 166.0
2023-10-05 13:10:22.161|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power_1/state 0
2023-10-05 13:10:22.172|INFO|emoncms_mqtt.php|emon/inverter_1/device_mode/state Solar/Battery
2023-10-05 13:10:22.184|INFO|emoncms_mqtt.php|emon/inverter_1/grid_voltage/state 2.0
2023-10-05 13:10:22.195|INFO|emoncms_mqtt.php|emon/inverter_1/ac_output_frequency/state 49.9
2023-10-05 13:10:22.205|INFO|emoncms_mqtt.php|emon/inverter_1/ac_output_voltage/state 229.0
2023-10-05 13:10:22.216|INFO|emoncms_mqtt.php|emon/inverter_1/load_power/state 165
2023-10-05 13:10:22.227|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power_2/state 232
2023-10-05 13:10:22.238|INFO|emoncms_mqtt.php|emon/battery_1/current/state 5.0
2023-10-05 13:10:22.248|INFO|emoncms_mqtt.php|emon/battery_1/power/state 137
2023-10-05 13:10:22.259|INFO|emoncms_mqtt.php|emon/battery_1/state_of_charge/state 100
2023-10-05 13:10:22.271|INFO|emoncms_mqtt.php|emon/battery_1/voltage/state 27.4
2023-10-05 13:10:22.282|INFO|emoncms_mqtt.php|emon/total/battery_power/state 137
2023-10-05 13:10:22.293|INFO|emoncms_mqtt.php|emon/total/battery_state_of_charge/state 100
2023-10-05 13:10:24.-418|INFO|emoncms_mqtt.php|emon/inverter_1/grid_frequency/state 46.0
2023-10-05 13:10:24.-257|INFO|emoncms_mqtt.php|emon/inverter_1/pv_current_1/state 0.0
2023-10-05 13:10:24.-246|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power/state 232
2023-10-05 13:10:24.-234|INFO|emoncms_mqtt.php|emon/inverter_1/battery_voltage/state 27.4
2023-10-05 13:10:24.-224|INFO|emoncms_mqtt.php|emon/inverter_1/load_apparent_power/state 167
2023-10-05 13:10:24.-213|INFO|emoncms_mqtt.php|emon/inverter_1/pv_current_2/state 1.4
2023-10-05 13:10:24.-202|INFO|emoncms_mqtt.php|emon/inverter_1/temperature/state 33.0
2023-10-05 13:10:24.-192|INFO|emoncms_mqtt.php|emon/inverter_1/load_percentage/state 4
2023-10-05 13:10:24.-181|INFO|emoncms_mqtt.php|emon/inverter_1/battery_current/state 5.0
2023-10-05 13:10:24.-170|INFO|emoncms_mqtt.php|emon/inverter_1/grid_power/state 0
2023-10-05 13:10:24.-159|INFO|emoncms_mqtt.php|emon/inverter_1/pv_voltage_1/state 1.4
2023-10-05 13:10:24.-149|INFO|emoncms_mqtt.php|emon/inverter_1/pv_voltage_2/state 166.0
2023-10-05 13:10:24.-135|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power_1/state 0
2023-10-05 13:10:24.-124|INFO|emoncms_mqtt.php|emon/inverter_1/device_mode/state Solar/Battery
2023-10-05 13:10:24.-114|INFO|emoncms_mqtt.php|emon/inverter_1/grid_voltage/state 2.0
2023-10-05 13:10:24.-103|INFO|emoncms_mqtt.php|emon/inverter_1/ac_output_frequency/state 49.9
2023-10-05 13:10:24.-92|INFO|emoncms_mqtt.php|emon/inverter_1/ac_output_voltage/state 230.0
2023-10-05 13:10:24.-82|INFO|emoncms_mqtt.php|emon/inverter_1/load_power/state 167
2023-10-05 13:10:24.-71|INFO|emoncms_mqtt.php|emon/inverter_1/pv_power_2/state 232
2023-10-05 13:10:24.-60|INFO|emoncms_mqtt.php|emon/battery_1/current/state 5.0
2023-10-05 13:10:24.-49|INFO|emoncms_mqtt.php|emon/battery_1/power/state 137
2023-10-05 13:10:24.-39|INFO|emoncms_mqtt.php|emon/battery_1/state_of_charge/state 100
2023-10-05 13:10:24.-28|INFO|emoncms_mqtt.php|emon/battery_1/voltage/state 27.4
2023-10-05 13:10:24.-17|INFO|emoncms_mqtt.php|emon/total/battery_power/state 137
1 Like

OK, so are you sure these are not appearing on the inputs page?

image

nope

@TrystanLea - I am out of ideas. The script seems to be picking it up from MQTT but they are not appearing.

@Ashipa - have you checked the syslog? (journalctl -f) odd things can appear there.

$ journalctl -f
Oct 05 13:27:53 fountain systemd[1]: demandshaper.service: Failed with result 'exit-code'.
Oct 05 13:27:55 fountain systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 210.
Oct 05 13:27:55 fountain systemd[1]: Stopped emonHub data multiplexer.
Oct 05 13:27:55 fountain systemd[1]: Starting emonHub data multiplexer...
Oct 05 13:27:55 fountain systemd[3486]: emonhub.service: Failed to determine user credentials: No such process
Oct 05 13:27:55 fountain systemd[3486]: emonhub.service: Failed at step USER spawning /bin/mkdir: No such process
Oct 05 13:27:55 fountain systemd[1]: emonhub.service: Control process exited, code=exited, status=217/USER
Oct 05 13:27:55 fountain systemd[1]: emonhub.service: Failed with result 'exit-code'.
Oct 05 13:27:55 fountain systemd[1]: Failed to start emonHub data multiplexer.
Oct 05 13:27:58 fountain systemd[1]: run-docker-runtime\x2drunc-moby-717ff4a53101d9d546a10baeadc1487ecc2f763763db099af88c0ad8b824870e-runc.AyNGoX.mount: Deactivated successfully.
Oct 05 13:28:00 fountain systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 211.
Oct 05 13:28:00 fountain systemd[1]: Stopped emonHub data multiplexer.
Oct 05 13:28:00 fountain systemd[1]: Starting emonHub data multiplexer...
Oct 05 13:28:00 fountain systemd[3512]: emonhub.service: Failed to determine user credentials: No such process
Oct 05 13:28:00 fountain systemd[3512]: emonhub.service: Failed at step USER spawning /bin/mkdir: No such process
Oct 05 13:28:00 fountain systemd[1]: emonhub.service: Control process exited, code=exited, status=217/USER
Oct 05 13:28:00 fountain systemd[1]: emonhub.service: Failed with result 'exit-code'.
Oct 05 13:28:00 fountain systemd[1]: Failed to start emonHub data multiplexer.
Oct 05 13:28:05 fountain systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 212.
Oct 05 13:28:05 fountain systemd[1]: Stopped emonHub data multiplexer.
Oct 05 13:28:05 fountain systemd[1]: Starting emonHub data multiplexer...
Oct 05 13:28:05 fountain systemd[3514]: emonhub.service: Failed to determine user credentials: No such process
Oct 05 13:28:05 fountain systemd[3514]: emonhub.service: Failed at step USER spawning /bin/mkdir: No such process
Oct 05 13:28:05 fountain systemd[1]: emonhub.service: Control process exited, code=exited, status=217/USER
Oct 05 13:28:05 fountain systemd[1]: emonhub.service: Failed with result 'exit-code'.
Oct 05 13:28:05 fountain systemd[1]: Failed to start emonHub data multiplexer.
Oct 05 13:28:10 fountain systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 213.
Oct 05 13:28:10 fountain systemd[1]: Stopped emonHub data multiplexer.
Oct 05 13:28:10 fountain systemd[1]: Starting emonHub data multiplexer...
Oct 05 13:28:10 fountain systemd[3516]: emonhub.service: Failed to determine user credentials: No such process
Oct 05 13:28:10 fountain systemd[3516]: emonhub.service: Failed at step USER spawning /bin/mkdir: No such process
Oct 05 13:28:10 fountain systemd[1]: emonhub.service: Control process exited, code=exited, status=217/USER
Oct 05 13:28:10 fountain systemd[1]: emonhub.service: Failed with result 'exit-code'.
Oct 05 13:28:10 fountain systemd[1]: Failed to start emonHub data multiplexer.
Oct 05 13:28:16 fountain systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 214.
Oct 05 13:28:16 fountain systemd[1]: Stopped emonHub data multiplexer.
Oct 05 13:28:16 fountain systemd[1]: Starting emonHub data multiplexer...
Oct 05 13:28:16 fountain systemd[3517]: emonhub.service: Failed to determine user credentials: No such process
Oct 05 13:28:16 fountain systemd[3517]: emonhub.service: Failed at step USER spawning /bin/mkdir: No such process
Oct 05 13:28:16 fountain systemd[1]: emonhub.service: Control process exited, code=exited, status=217/USER
Oct 05 13:28:16 fountain systemd[1]: emonhub.service: Failed with result 'exit-code'.
Oct 05 13:28:16 fountain systemd[1]: Failed to start emonHub data multiplexer.

BTW, I’d slow this down. Every 2 seconds is a bit excessive and can overload the emoncms end. Once every 10 is quick enough, I’d suggest.

Unrelated (I suspect), but you want to stop and disable these 2 services.

Yeah , was going to ask if its safe to disable them.

where do i set the time intervals for the MQTT?

I think you said Solar Assistant was running on a Pi? Can you control the rate from there (MQTT is a dumb system in this respect).

No. there’s aren’t any settings on that end other than username/password

1 Like