Alarm Module missing on IB M4

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Daft_vagabond
 
Posts: 92
Joined: Thu May 28, 2020 2:53 pm

Alarm Module missing on IB M4

Post by Daft_vagabond »

I tried importing the alarm module and got the following error

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
ImportError: no module named 'alarm'
So I checked the modules on the board and

Code: Select all

>>> help("modules")
__main__          busio             micropython       storage
_bleio            collections       msgpack           struct
adafruit_bus_device                 countio           neopixel_write    supervisor
adafruit_pixelbuf digitalio         onewireio         synthio
aesio             displayio         os                sys
analogio          errno             ps2io             terminalio
array             fontio            pulseio           time
atexit            framebufferio     pwmio             touchio
audiocore         frequencyio       rainbowio         traceback
audioio           gc                random            ulab
audiomixer        getpass           re                usb_cdc
audiomp3          i2cperipheral     rgbmatrix         usb_hid
binascii          io                rotaryio          usb_midi
bitbangio         json              rtc               vectorio
bitmaptools       keypad            samd
board             math              sdcardio
builtins          microcontroller   sharpdisplay
Plus any modules on the filesystem
Yeah, it doesn't seem to be there. Alarm is supposed to be one of the built-ins.

Here are my board details

Code: Select all

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit ItsyBitsy M4 Express with samd51g19
Board ID:itsybitsy_m4_express

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Alarm Module missing on IB M4

Post by adafruit_support_carter »

Alarm support for the SAMD boards is very new. It is being added for the 7.1.0 release which is still in testing:
https://github.com/adafruit/circuitpyth ... 1.0-beta.2
SAMD now provides watchdog, and alarm with sleep
But you can try out the beta release firmware if you want. Go here:
https://circuitpython.org/board/itsybitsy_m4_express/
and select the 7.1.0 beta UF2 firmware.

User avatar
Daft_vagabond
 
Posts: 92
Joined: Thu May 28, 2020 2:53 pm

Re: Alarm Module missing on IB M4

Post by Daft_vagabond »

Oh fantastic, thank you.

The module support matrix made me think it was ready-to-go, my mistake.

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Alarm Module missing on IB M4

Post by adafruit_support_carter »

That could be from viewing "latest" docs vs. "7.0.x" docs.

Here are the 7.0.x docs:
https://circuitpython.readthedocs.io/en ... atrix.html

User avatar
Daft_vagabond
 
Posts: 92
Joined: Thu May 28, 2020 2:53 pm

Re: Alarm Module missing on IB M4

Post by Daft_vagabond »

Yeah, there we go.

I have a question. When in sleep mode, is power to the 3v pin turned off?

I'm trying to use an spst switch as my alarm and it's tied to 3V, GND, and D2, and I've tried a few different methods and can't seem to get it to wake up.

I don't want to add anymore buttons or switches, so while the spst is my main power switch, I also want it to be what wakes the thing up. So I have the board check if the switch is False and if it is, it checks how long it's been off, then after a few seconds, right before I assign the alarm, I use deinit(self) to free up the pin so that it can be used as the alarm. I also have the opposite occur after the wake up happens, or rather, it would if I could get it to work.

I've also tried tying the switch to both D2 and D13, but still nothing. Even with one of the pins tied to the switch and then directly to the battery, I still couldn't get it to wake up. And just in case I wasn't understanding the docs as well as I thought I was, I played around with different combinations of the "value" and "pull" settings.

I can confirm that the switch functions normally outside of these tests.

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”