2016-10-09 12:09:39.002 |WARN| phpmqtt_input.php| Connecting to MQTT server: Connection Refused: not authorised.: code: 5
And the following in the emonhub.log
2016-10-09 11:46:53,502 INFO MQTT Could not connect...
2016-10-09 11:46:54,294 INFO MainThread Deleting interfacer 'MQTT'
2016-10-09 11:46:54,295 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2016-10-09 11:46:54,297 ERROR MainThread could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'
2016-10-09 11:46:54,297 ERROR MainThread Unable to create 'RFM2Pi' interfacer: global name 'EmonHubInterfacerInitError' is not defined
2016-10-09 11:46:54,298 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2016-10-09 11:46:54,299 INFO MainThread MQTT Init mqtt_host=192.168.0.41 mqtt_port=21 mqtt_user=pi
2016-10-09 11:46:54,302 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2016-10-09 11:46:54,304 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2016-10-09 11:46:54,404 INFO MQTT Connecting to MQTT Server
2016-10-09 11:46:54,406 INFO MQTT Could not connect...
I tried serveral user id’s and passwords.
The config file is as follows (baseid = 8, mqtt_host = 192.168.0.41):
[[RFM2Pi]]
Type = EmonHubJeeInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 38400 # 9600 for old RFM12Pi modules
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
group = 210
frequency = 433
baseid = 8 # 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_host = 192.168.0.41
mqtt_port = 81
mqtt_user = 'pi'
mqtt_passwd = '********'
I had the same issue, for me it was because I had not updated the location of the password file in the mqtt config, Check step 5 in the SD build. If you are installing manually I recommend reviewing the SD image build instructions. There are a few steps here that I think are missing on the other build instructions.
Turn off Mosquitto persistence and enable authentication:
sudo nano /etc/mosquitto/mosquitto.conf
Set persistence false and add the lines:
I didn’t have to add the two lines. They were already written in de moquitto.conf file.
The command “mosquitto_sub -v -u ‘emonpi’ -P ‘emonpimqtt2016’ -t ‘test/topic’” results in multiple lines "Connection Refused: not autorised."
And had to stop this with CTRL-C.
Oh dear, have you had this issue from day 1? Has anything been changed on
the sd card image setup? Mqtt on the latest sd card image has been
extensively tested and proven to be reliable.
Yes, it is not functioning since the first day.
I do not know how I have to change the sd card image and think this how I received it.
Since more than a year I have an emontx V3.
Because the temperature sensor is not working I recently bought another one.
But the temperature sensor is also not working on this new delivery.
Very sorry to hear, I’m not sure what has gone wrong. Would you like us to send you a replacement sd card with a fresh image? Or would you be happy to download a fresh image and flash yourself? Do you have a spare SD card onto which you could flash the fresh image to test?
Ah OK, that’s good. It seems the base station part is working fine now, it’s just receiving data if cannot decode. Each RF needs needs a corresponding node decoder in emonhub.conf. The default node decoder s should work fine with all our standard units.
What are you using as the transmitter node? Has the firmware on this node been modified? When was the transmitter node purchased? Do you have your order number so I can check the unit config?
“unreliable content” is actually anything recieved via the RFM2Pi interfacer prefixed with a question mark, ie packets that the rfm2pi has “discarded” due to failing the CRC checks. It’s not related to the node decoding in emonhub.
Those “unreliable contect” messages can be suppressed by setting quiet = true in the [[RFM2Pi]] settings in emonhub.conf, it is only useful to set to false for debugging if you are experiencing missing RF packets etc
The mosquito command is complete, you need to specify the port 8883, and the connection is secure by default and you need to specify the server certificate that can be downloaded from below: