SOLVED: Write data to InfluxDB with ESP / ESP8266 over Internet & HTTPS using letsencrypt / certbot

I struggled for a while on this and found various hints across the Internet but nothing complete - hope this helps.

Modify the Influx configuration file to use the letsencrypt certificates

Determines whether HTTPS is enabled.

https-enabled = true

The TLS or SSL certificate to use when HTTPS is enabled.

https-certificate = "/etc/letsencrypt/archive/domain.com/fullchain2.pem"

Use a separate private key location.

https-private-key = "/etc/letsencrypt/archive/domain.com/privkey2.pem"

Permissions need updating to allow influx user to access certs
addgroup certusers
usermod -G certusers influxdb
chown root:certusers /etc/letsencrypt/archive/
chmod 750 /etc/letsencrypt/archive/
chown root:certusers /etc/letsencrypt/archive/domain.com/privkey2.pem
chmod 640 /etc/letsencrypt/archive/domain.com/privkey2.pem

ESP sketch can be found here → Tobias Schürg ESP8266 sketch
Thank you for this example!

1 Like

Hello @jasonj,
Thank you so much for this contribution! What data are you writing with esp8266?