arduino-libraries / SigFox

Helper library for MKRFox1200 board and ATAB8520E Sigfox module
19 stars 26 forks source link

Not Compatible on Nano 33 IoT #38

Closed dirkdewinnaarGM closed 2 years ago

dirkdewinnaarGM commented 2 years ago

https://www.arduino.cc/reference/en/libraries/arduino-sigfox-for-mkrfox1200/ say its compatible with Nano 33 IoT nd yet: this error message pop when i add: #include How do I fix this?

C:\Users\User\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\src\SigFox.cpp: In member function 'int SIGFOXClass::begin()':
C:\Users\User\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\src\SigFox.cpp:99:13: error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setDataMode'
   spi_port->setDataMode(SPI_MODE0);
             ^~~~~~~~~~~
C:\Users\User\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\src\SigFox.cpp:100:13: error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setBitOrder'
   spi_port->setBitOrder(MSBFIRST);
             ^~~~~~~~~~~
exit status 1
Error compiling for board Arduino NANO 33 IoT.
per1234 commented 2 years ago

Hi @dirkdewinnaarGM. This bug has already been fixed: https://github.com/arduino-libraries/SigFox/pull/32

Unfortunately, there has not been a release of the library since that time, so the version you get from the Arduino Library Manager still has the bug.

In order to get the fix, you will need to install the beta tester version of the library. I'll provide instructions:

  1. Download the beta test version of the library from this link: https://github.com/arduino-libraries/SigFox/archive/refs/heads/master.zip
  2. Start the Arduino IDE if it is not already running.
  3. Select Sketch > Include Library > Add .ZIP Library... from the Arduino IDE menus.
  4. Select the downloaded file (SigFox-master.zip).
  5. Click the Open button.

You should now be able to compile your sketch without getting that error.

The above instructions resulted in two copies of the library being installed on your computer. The IDE will pick the right one in this case, but if you have verbose compilation output enabled it will notify you that multiple libraries were found:

Multiple libraries were found for "SigFox.h"
 Used: C:\Users\User\Documents\Arduino\libraries\SigFox-master
 Not used: C:\Users\User\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200

This is no problem, but if it bothers you then you can remove the broken copy of the library by deleting this folder:

C:\Users\User\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200

:warning: Please be very careful when deleting things from your computer. When in doubt, back up!

dirkdewinnaarGM commented 2 years ago

Hi per1234 Did I did as you mentioned in the mail above. It's working. Thank you so much for the assistance. Regards :-)