Arduino Leonardo connected using WebSocket through ethernet and wifi

Hi all

I'm new to this forum and, basically, to the Arduino world than I hope to post in the right section. I need to create a virtual USB keyboard and, after read a lot of post here, I selected the Leonardo model because it have a native HID USB interface and library for emulate an USB keyboard is provided. However I need this board to receive keyboard commands through network in both (alternative) solutions ethernet and wifi with WebSocket protocol. At first I bought an ethernet shield with W5500 chip but now that I started to develop I discovered that there is no big support for Leonardo model in the available WebSocket libraries in the site. At least the only library I found that seem able to support W550 chip and some other wifi chip (still to buy) is "WebSockets2_Generic" but using Visual Studio Code with platformio I can't compile it because AVR compiler miss STL used by this library. I tried to add library for "import" STL but nothing work.

Now, the use of Leonardo model is mandatory for the USB emulation as explained, but for the ethernet and wifi I can choose alternative shield if someone of you can suggest a working models supporting WebSocket.

Or maybe I'm doing something wrong, someone can point me to the right direction?

Thank you

falsinsoft:
I need this board to receive keyboard commands through network in both (alternative) solutions ethernet and wifi

Why do you need both Ethernet and WiFi?

falsinsoft:
Now, the use of Leonardo model is mandatory for the USB emulation as explained

There are quite a few other options for boards that provide USB emulation. All the Arduino SAMD boards (MKR boards, Nano 33 IoT, Zero) have this capability, and some have on-board WiFi as well, and there is also a MKR Eth Shield to add Ethernet to the MKR boards. Some of the third party boards like the Teensy also have this capability.

Hi

pert:
Why do you need both Ethernet and WiFi?

Because it will be possible this board can be used in some place where wifi is not available than, by changing the shield, ethernet will be the alternative.

pert:
There are quite a few other options for boards that provide USB emulation. All the Arduino SAMD boards (MKR boards, Nano 33 IoT, Zero) have this capability, and some have on-board WiFi as well, and there is also a MKR Eth Shield to add Ethernet to the MKR boards. Some of the third party boards like the Teensy also have this capability.

Thank you I'll check the alternatives but, after a quick look, I can already exclude something of that cause the more expensive cost (like Zero model). In any case you can confirm Leonardo model doesn't have WebSocket library support for common network shields?

Thank you

The Nano 33 IoT is actually cheaper than an official Leonardo alone. Especially so when you consider the cost of the WiFi shield you would need to add to the Leonardo to give it equivalent connectivity.

For a SAMD board with Ethernet, an easy solution is the MKR Zero with MKR Eth shield.pability as well.

falsinsoft:
In any case you can confirm Leonardo model doesn't have WebSocket library support for common network shields?

No. Sorry, I don't have any experience with WebSocket libraries. Maybe someone else here on the forum will be able to answer that.

pert:
The Nano 33 IoT is actually cheaper than an official Leonardo alone. Especially so when you consider the cost of the WiFi shield you would need to add to the Leonardo to give it equivalent connectivity.

However, reading the documentation of Nano 33, doesn't seem to have the USB HID interface like Leonardo. Referring to this documentation only 32u4 based board, a Due and a Zero can support keyboard and mouse emulation (but I can be wrong).

That documentation is outdated. At the time it was written, the only official SAMD board was the Zero and nobody bothered to update it in the years since additional official SAMD boards have been created. The Nano 33 IoT and MKR boards have exactly the same level of HID support as the Zero.