arduino-libraries / Arduino_ConnectionHandler

GNU General Public License v3.0
97 stars 36 forks source link

Ethernet with WIZnet w5500 #132

Open mirek23 opened 1 week ago

mirek23 commented 1 week ago

Is it possible to use Arduino_ConnectionHandler with WIZnet w5500 based modules + arduino boards?

pennam commented 1 week ago

There is not builtin support, but it is possible. Take a look to:

mirek23 commented 1 day ago

Hi Mattia,

Thank you for your hints:

  1. Uncomment this line: https://github.com/arduino-libraries/Arduino_ConnectionHandler/blob/1bff3e3663419ee2c87376f86ee4ebf03034ee71/src/Arduino_ConnectionHandler.h#L116
  2. Instantiate Ethernet_ConnectionHandler in thing_properties.h:
    byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
    EthernetConnectionHandler ArduinoIoTPreferredConnection(mac);
  3. Pass to ArduinoIoTCloud (as usual):
    ArduinoCloud.begin(ArduinoIoTPreferredConnection, "mqtts-sa.iot.oniudra.cc");

I have introduced changes to the code you suggested. I use arduino nano + WIZnet W5500 Ethernet module and I get the following error which refers to ArduinoIoTCloud.h (CBORDecoder.h):

In file included from /home/mirek/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:35:0,
                 from /home/mirek/Arduino/Nano_LAN/thingProperties.h:7,
                 from /home/mirek/Arduino/Nano_LAN/Nano_LAN.ino:30:
/home/mirek/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.h:29:10: fatal error: list: No such file or directory
 #include <list>
          ^~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1
pennam commented 1 day ago

for which board are you trying to build the sketch?

mirek23 commented 14 hours ago

I am trying to compile the sketch for Arduino Nano + WIZnet W5500. I have tested Arduino Nano + WIZnet W5500 with Ethernet and SPI libraries using Arduino IDE and developed the telnet, HTTP servers, MQTT client so this combination works but I can not integrate it with Arduino cloud.

pennam commented 1 hour ago

The Arduino Nano and all AVR boards are not supported by ArduinoIoTCloud. The Nano in particular does not have enough RAM to complete a TLS handshake. You can find the list of supported boards here: https://github.com/arduino-libraries/ArduinoIoTCloud?tab=readme-ov-file#what