0

I have an Arduino Uno Rev 3 with an Ethernet Shield. Can I use this to connect to a secure MQTT broker (using port 8883)?

What library do I use?

user3459805
  • 141
  • 1
  • 12

1 Answers1

4

The Arduino Uno only has 2kB of RAM and 32kB of program memory - this is a very constrained device and I do not believe is enough to implement any kind of SSL/TLS.

For example WolfSSL is designed for embedded devices but it states that it uses between 20-100kB kB of program memory and 1-36kB of RAM:

https://www.wolfssl.com/wolfSSL/benchmarks-wolfssl.html

So I suspect that the only option would be to off-load the encryption to another device.

  1. You could have an MQTT broker on your local network (Raspberry Pi?) that your Arduino(s) connect to over port 1883, and then connects them securely over port 8883 over the internet.
  2. You could use an ESP8266 to perform both the network connection and encryption. For example a ESP8266 Arduino shield is available.
  3. There may be some other kind of IC that you could off-load the TLS encryption to, but still have the Arduino Uno doing the networking - but I am not sure if anything like this actually exists.
njh
  • 783
  • 3
  • 15
  • Also relevant: [Performance of MQTT over TLS vs. MQTT](https://iot.stackexchange.com/questions/1509/performance-of-mqtt-over-tls-vs-mqtt). – Aurora0001 Jun 01 '17 at 15:32
  • Thanks! That's what I've been fearing :) I might try to connect a NodeMCU to a Mini ENC28J60. – user3459805 Jun 01 '17 at 18:39