question

baileyscott avatar image
baileyscott asked

CCGX MQTT Azure IoT Hub

Hello all,

I've surfed around the community and found some useful stuff that has got me so far. I'm trying to hook up my Victron CCGX unit to my Azure IOT hub which natively speaks MQTT.

Most information so far has been gathered from: https://community.victronenergy.com/questions/6553/mqtt-only-see-system0serial.html?childToView=42997#answer-42997 - thankyou to all contributors.

So far I've adjusted the keepalive for dbus-mqtt in /service/dbus-mqtt/run and added a new .conf file for my azure iot hub. I've also updated /usr/sbin/start-mosquitto so that it loads my new .conf file from /data/conf/mosqitto/azure.conf

connection azure
address <myhubname>.azure-devices.net:8883
cleansession true
try_private false
notifications false
start_type automatic
bridge_protocol_version mqttv311
bridge_tls_version tlsv1.2
bridge_insecure false
remote_clientid <mydevicename>
remote_username <myhubname>.azure-devices.net/<mydevicename>?api-version=2018-06-30
remote_password SharedAccessSignature sr=<myhubname>.azure-devices.net%2Fdevices%2F<mydevicename>&sig=<mysecretSASsignature>&se=1665882355
bridge_cafile /etc/ssl/certs/azureiot.pem
topic P/<mydeviceid>/in/# in devices/<mydevicename>/messages/events/ ""
topic P/<mydeviceid>/out/# out "" devices/<mydevicename>/messages/events/

In Azure I can see that the device is "connected" but I don't seem to receive any messages/topics. This may be an Azure issue but I thought I'd try here to see if I was doing anything stupid with the topics etc.

Thanks all!

Any help appreciated!

Bailey

Venus OSCCGX Color ControlMQTT
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

baileyscott avatar image baileyscott commented ·
Interestingly it still seems to continue updating the realtime data via the console and also the Victron VRM? I assume the realtime data in the console is via some other method and not MQTT and that perhaps something isn't quite right in my config regarding VRM?
0 Likes 0 ·
baileyscott avatar image baileyscott commented ·
If anyone was wondering why I am bothering to send to Azure IoT hub it's because once the data is in Azure I can potentially use some machine learning to make some more intelligent decisions regarding when to start the generator and how long to run it for.
0 Likes 0 ·
0 Answers