kivancsikert / ugly-duckling

Firmware for FarmHub devices
0 stars 0 forks source link

Allow devices to configure a secure MQTT connection #104

Closed lptr closed 6 months ago

lptr commented 6 months ago

Moved MQTT configuration to mqtt-config.json where the server and client certs can be specified, like so:

{
  "host": "motherhen.kertkaland.com",
  "port": 8883,
  "serverCert": [
    "-----BEGIN CERTIFICATE-----",
    // ...
    "-----END CERTIFICATE-----"
  ],
  "clientCert": [
    "-----BEGIN CERTIFICATE-----",
    // ...
    "-----END CERTIFICATE-----"
  ],
  "clientKey": [
    "-----BEGIN RSA PRIVATE KEY-----",
    // ...
    "-----END RSA PRIVATE KEY-----"
  ]
}

There is now also a location property in device-config.json, as devices connecting directly to the server need to specify where they are:

{
  "instance": "test-mk6-2",
  "location": "test-zone",
  "peripherals": [
    // ...
  ]
}