I am using EMQX broker with connection information as follows:-
MQTT Connection Information
Address:xxxxxxxxxxxxxxxx.emqxsl.com
MQTT over TLS/SSL Port:8883
WebSocket over TLS/SSL Port:8084
CA Certificate:CA Certificate Expiration: 2031.11.10
This is working correctly on Windows:-
When moving to raspberry pi 5 I cannot get the connection to the broker to work.
I have downloaded the ca certificate emqxsl-ca to the raspberry pi and located it in /usr/local/share/ca-certificates/. I have then run sudo update-ca-certificates. As far as I am aware this is the correct procedure for installing the certificate that the EMQX service requires.
When I ran the procedure 1st time the return messages included 1 added but I did not make an exact note of what happened.
I have tried to run it a second time to see if this helps and get the responses:-
Updating certificates in /etc/ssl/certs
0 added, 0 removed done
Running hooks in /etc/ca-certificates/update.d
done
In terms of visible files:-
emqxsl-ca.crt exists in /usr/local/share/ca-certificates/
emqxsl-ca.pem exists in /etc/ssl/certs
When I run node-red (same code as works in windows) the system cannot connect to the broker.
Any help would be much appreciated.
The exact message is
6 Mar 14:07:19 - [info] [mqtt-broker:EMQX Broker] Connection failed to broker: mqtts://xxxxxxxx.ala.eu-central-1.emqxsl.com:8883
6 Mar 14:07:20 - [info] [mqtt-broker:Test MQTT] Connected to broker: mqtt://test.mosquitto.org:1883
I also connect to mosquitto which works
I am pretty sure its the ca certificate thats not being recognised
The node red project using the built in mqtt nodes.
Versions being used are:-
Welcome to Node-RED
6 Mar 14:07:18 - [info] Node-RED version: v4.0.9
6 Mar 14:07:18 - [info] Node.js version: v20.18.3
6 Mar 14:07:18 - [info] Linux 6.6.74+rpt-rpi-2712 arm64 LE
6 Mar 14:07:18 - [info] Loading palette nodes
6 Mar 14:07:19 - [info] Dashboard version 3.6.5 started at /ui
6 Mar 14:07:19 - [info] Settings file : /home/nodered/.node-red/settings.js
6 Mar 14:07:19 - [info] Context store : 'default' [module=memory]
6 Mar 14:07:19 - [info] User directory : /home/nodered/.node-red
6 Mar 14:07:19 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Mar 14:07:19 - [info] Flows file : /home/nodered/.node-red/flows.json
6 Mar 14:07:19 - [warn] Using unencrypted credentials
6 Mar 14:07:19 - [info] Server now running at http://127.0.0.1:1880/
6 Mar 14:07:19 - [info] Starting flows
did you export flows from windows / import flows into rpi?
you might need to re-enter any values in the broker that are credentials fields. I dont remember which of them are credential fields but you can just overtype them to be sure.
also, double check the location specified for files matches the locations on your pi device.
Addition:
Can you ping xxxxxxxx.ala.eu-central-1.emqxsl.com from the PI? (might not respond, so try on working windows box too to cross check) (should rule out dns issue)
Thank you very much. I completely forgot that, quite rightly, export and import loses any credentials that are set in the project. EMQX does require credentials but mosquitto test does not. Hence mosquitto survives an export / import but EMQX does not. Thanks again for your help.