khoih-prog / WebSockets2_Generic

A WebSocket Server and Client library for Arduino, based on RFC6455, for writing modern Websockets applications. Now support ESP8266, ESP32 (including ESP32-S2 Saola, AI-Thinker ESP-12K, WT32_ETH01, etc.), nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, Teensy, RP2040-based, etc. boards, with WiFiNINA, Teensy 4.1 NativeEthernet/QNEthernet, Ethernet W5x00 / ENC28J60 / LAN8742A / LAN8720, ESP8266 / ESP32-AT modules/shields, as well as SINRIC / Alexa / Google Home
GNU General Public License v3.0
81 stars 30 forks source link

RobotDyn SamD21 M0 Zero compatible board #4

Closed ericvb closed 3 years ago

ericvb commented 3 years ago

I was testing the example in https://github.com/khoih-prog/WebSockets2_Generic/tree/master/examples/Generic/Ethernet/SAMD/SAMD-Ethernet_AdvancedWebServer but got nothing in the serial output.

These clone boards (https://www.aliexpress.com/item/32780674095.html?spm=a2g0s.9042311.0.0.27424c4dcsNo3b) are called Zero compatible, but don't have 2 USB ports like a real Zero (serial programming and serial USB). The only port they have is the serial USB

So I had to add following code in the sketch example:

#if PLATFORM_ARCH == PLATFORM_ARCHITECTURE_SAMD21
#  define _SERIAL SerialUSB
#else
#  define _SERIAL Serial
#endif

and to use everywhere _SERIAL.println

khoih-prog commented 3 years ago

Hi @ericvb

Thanks for sharing your helpful experience to other users. As you know, there are too many boards, clones, etc. on the market, it's very difficult and time-consuming to take care of every one. The examples are just basic demonstration of the library's features, and you have to adapt it to meet your use-case demand.

Your feedback is appreciated and certainly will be used by other people.

Regards,