Hi,
I have a Sodaq autonomo board (based on samd21 processor - https://support.sodaq.com/sodaqone/autonomо/) and i am trying to use the ArduinoLowPower library with it and the timedWakeup example sketch however compilation fails with the error:
Arduino: 1.8.5 (Linux), Board: "SODAQ Autonomo with Serial2"
/home/richard/Dev/ArdSketches/libraries/Arduino_Low_Power/src/samd/ArduinoLowPower.cpp: In member function 'void ArduinoLowPowerClass::sleep()':
/home/richard/Dev/ArdSketches/libraries/Arduino_Low_Power/src/samd/ArduinoLowPower.cpp:21:13: error: 'class USBDeviceClass' has no member named 'standby'
USBDevice.standby();
However it compiles fine if i compile using the MKRZero board which has the same processor.
All libraries and board information is up to date for the arduino IDE.
The problem is that the newest version of SODAQ SAMD Boards (1.6.19) has the core library code equivalent to Arduino SAMD Boards 1.6.19. The standby function was added in Arduino SAMD Boards 1.6.20 last November but SODAQ still hasn't bothered to update their code.
Here is the change that was made to the Arduino SAMD Boards core library:
You might try applying that patch to your SODAQ SAMD Boards core files to see what happens.
Hi Pert,
And thanks for the reply. The link you supplied shows 4 changed files however i dont have one of those files in my Arduino IDE at all (samd21_usbdevice.h). I have checked the latest version (1.8.9) and that also does not have it - would there be any reason why that file is missing or is it for use with other arduino IDE's like Arduino Studio.
That file wouldn't be in the Arduino IDE because Arduino SAMD Boards is not part of the Arduino IDE. Arduino SAMD Boards (and Sodaq SAMD Boards) are installed to a completely separate location. In the case of Arduino SAMD Boards, it's at ~/.arduino15/packages/arduino/hardware/samd. The only hardware package bundled with your Arduino IDE 1.8.9 is Arduino AVR Boards.
I made the changes to the relevant files and it now compiles - so thanks for you help with that. However i have noted some odd behavior;
when using the LowPower.idle() method with the TimdewakeUp example, it does not work. I thought that this may have been due to missing "PM->SLEEP.bit.IDLE = PM_SLEEP_IDLE(0);" from the *.cpp file however adding this had no effect.
when using the LowPOwer.Sleep() method with the TimdewakeUp example it works fine and the following script also worked but only if i changed "RTCZero rtc;" to "RTCZero _RTC;" i think that this is because ArduinoLowPower uses RTCZero.h and i think there is a conflict of data types, i also have to disconnect from serial monitor;
However if i increase the complexity of the code in the main loop it hangs on entering sleep whereas the code runs fine without the call to sleep and i am not sure why this should be. The extra code is just more time checking calls to RTCZero time library) and if a certain time is reached it runs off does some logging to a file but it is actually hanging before it gets to this point although it still does suggest a library conflict somewhere.
If you have any ideas on this they would be much appreciated.
katesfb:
the following script also worked but only if i changed "RTCZero rtc;" to "RTCZero _RTC;"
Did the code not compile before you made that change?
katesfb:
i also have to disconnect from serial monitor
What happens if you're connected to Serial Monitor?
katesfb:
However if i increase the complexity of the code in the main loop it hangs on entering sleep whereas the code runs fine without the call to sleep and i am not sure why this should be. The extra code is just more time checking calls to RTCZero time library) and if a certain time is reached it runs off does some logging to a file but it is actually hanging before it gets to this point although it still does suggest a library conflict somewhere.
Please post the shortest code that still causes the problem.
Disclaimer: There is a good chance I still won't be able to answer your questions even after you provide the requested information, but I think anyone else here who does has the necessary knowledge to help will first need this information so I'm at least doing the groundwork for them.