skaarj1989/mWebSockets

Arduino SAMD unsupported

Closed this issue · 1 comments

I was looking for a websockets server library and I found this which said it supports SAMD, however when trying to compile my code for the MKR1000, it errors with "Unsupported platform".

Since it's a SAMD21 Cortex-M0+ MCU, shouldn't it be supported just like the MKR zero?

The macro is called ARDUINO_ARCH_SAMD (https://github.com/arduino/ArduinoCore-samd/blob/020b419fc1dbca49b23b7c0b5e47d50fb2a04485/cores/arduino/Arduino.h#L129).

In file included from C:\Users\GG\Documents\Arduino\libraries\mWebSockets\src\utility.h:3:0,
                 from C:\Users\GG\Documents\Arduino\libraries\mWebSockets\src\utility.cpp:1:
C:\Users\GG\Documents\Arduino\libraries\mWebSockets\src\platform.h:20:4: error: #error "Unsupported platform"
 #  error "Unsupported platform"
    ^~~~~
C:\Users\GG\Documents\Arduino\libraries\mWebSockets\src\utility.cpp:3:10: fatal error: SHA1.h: No such file or directory
 #include "SHA1.h"
          ^~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino MKR1000.

(The second error seems to complain about a missing "SHA1.h" file, which also comes for the MKR Zero, does that mean this library has a dependency on a hashing library? Please add this library to the library.properties, so the dependency can be automatically downloaded).

Hi,
Thanks for reporting.
Just change #elif defined(ARDUINO_SAMD_ZERO) to #elif defined(ARDUINO_ARCH_SAMD) in platform.h and it shall compile fine.
And since I don't have MKR1000 could you also send feedback if it works correctly?