Informatic0re
04/09/2024, 3:18 PM[artemis.containers] INFO: triggered by pin {name: trigger, id: b9906bd7-9c7e-dce1-9a10-4ab91b230523, pin: 7, level: 0}
but if I check the esp32.ext1-wakeup-status and extract the pin which actually triggered this container to run I get 9 instead of 7.
9 is supposed to be the GPIO which starts a container when driven HIGH and it became LOW (thats why I assume it is not possible to have both setup).
There is an option with "any high" or "any low" and I think it can only be that any of the GPIOs are low or any of the declared once are HIGH but not both.
So - this is causing lots of chaos in my code now and I wonder if I can fix that somehow. Or if this is even fixable somehow anyway. I am using artemis right now with a container declaration like so:
containers:
trigger:
entrypoint: "../src/trigger.toit"
triggers:
- gpio:
- pin: 6
level: "low"
- pin: 7
level: "low"
- pin: 18
level: "low"
- pin: 21
level: "low"
ble:
entrypoint: "../src/ble/ble.toit"
triggers:
- gpio:
- pin: 9
level: "high"
I think the only option I have here is to always only run one container which then checks the cause and the pin numbers and also checkts the Pins and then runs the dedicated containers on there own. Is this possible?
Can I skip artemis from running the container and leave it to me, when to run them? (I assume not)Informatic0re
04/09/2024, 3:22 PMInformatic0re
04/09/2024, 3:32 PMext1-wakeup-status is missing a documentation. I don't really get why I have to pass a mask to it as well ๐ค
ext1-wakeup-status pin-mask/int -> int:
#primitive.esp32.ext1-wakeup-status
but for the case explained above I am passing a mask like ((1 << 6) | (1 << 7) | (1 << 18) | (1 << 21)) and the result is 512 which translates to GPIO 9Informatic0re
04/09/2024, 4:31 PM[artemis.scheduler] INFO: job stopped {job: synchronize}
[artemis.scheduler] INFO: runlevel decreasing {runlevel: 0}
[artemis.containers] INFO: setting up external-wakeup trigger any high: 1000000000
[artemis.containers] WARN: pin triggers for low level are ignored
this lines also tell me that it disabled the low level detection which is the case. Only the USB-C detection does work then.floitsch
04/10/2024, 7:17 PMfloitsch
04/10/2024, 7:19 PMfloitsch
04/10/2024, 7:22 PMrtc_gpio_deinit() the pad.
See the warning at the end of the linked section: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/sleep_modes.html#external-wakeup-ext0floitsch
04/10/2024, 7:25 PMInformatic0re
04/10/2024, 7:53 PMfloitsch
04/10/2024, 7:55 PMfloitsch
04/10/2024, 7:55 PMInformatic0re
04/10/2024, 7:56 PMfloitsch
04/10/2024, 7:57 PMfloitsch
04/10/2024, 7:57 PMesp_sleep_get_ext1_wakeup_status.floitsch
04/10/2024, 7:59 PMInformatic0re
04/10/2024, 7:59 PMInformatic0re
04/10/2024, 8:00 PMfloitsch
04/10/2024, 8:02 PMfloitsch
04/10/2024, 8:03 PMInformatic0re
04/11/2024, 9:11 AMfloitsch
04/11/2024, 11:40 AMInformatic0re
04/12/2024, 7:55 AMInformatic0re
04/12/2024, 8:02 AMInformatic0re
04/12/2024, 8:04 AM[artemis.containers] INFO: triggered by pin {name: trigger, id: 4c3cf1a6-f3aa-af9f-f32f-588b2b888cdf, pin: 7, level: 1}
[artemis.containers.trigger] DEBUG: starting {reason: 1930, arguments: null}
[artemis.scheduler] INFO: job started {job: container:trigger}
[trigger] DEBUG: Wakeup cause: 3
[trigger] DEBUG: Wakeup status 512
[trigger] DEBUG: extracted Pins: [9]
[trigger] DEBUG: Error: Ignored trigger
[artemis.scheduler] INFO: job stopped {job: container:trigger}
artemis sais it triggered because of pin 7 but in the exraction it says pin 9Informatic0re
04/12/2024, 8:04 AMextract_pins mask/int -> List:
pins := []
21.repeat:
if mask & (1 << it) != 0:
pins.add it
return pins
thats the function to extract the pinInformatic0re
04/12/2024, 8:04 AMfloitsch
04/12/2024, 8:11 AMtriggered-pins := esp32.ext1-wakeup-status external-mask
touch-wakeup-pin := esp32.touchpad-wakeup-status // -1 if not triggered by touch.
job-was-triggered := false
// If the high_mask isn't 0, then it wins over the low mask.
jobs.do: | job/ContainerJob |
job.do --trigger-gpio-levels: | pin level/int |
pin-mask := 1 << pin
if (triggered-pins & pin-mask) != 0:
is-triggered := false
if level == 1:
// Level 1 wins over level 0.
is-triggered = true
else if high-mask == 0:
// Level 0 is only triggered if there is no level 1.
is-triggered = true
if is-triggered:
job-was-triggered = true
job.trigger (Trigger.encode-pin pin --level=level)
tags := job.tags.copy
tags["pin"] = pin
tags["level"] = level
logger_.info "triggered by pin" --tags=tagsInformatic0re
04/12/2024, 12:10 PMgpio.Pin.out it says the default value is 0 - does it set this pin actively to be 0?
The Pin has an external pull-up and it should stay on or at least not set the level to be 0 when I initialise it.Informatic0re
04/12/2024, 12:10 PMfloitsch
04/12/2024, 12:11 PMgpio.Pin --out (equivalent to gpio.Pin.out) actively sets the pin to 0. Yes.Informatic0re
04/12/2024, 12:11 PMInformatic0re
04/12/2024, 12:11 PMfloitsch
04/12/2024, 12:11 PM--out.floitsch
04/12/2024, 12:12 PM--open-drainfloitsch
04/12/2024, 12:12 PMopen-drain and immediately go to 1, though.floitsch
04/12/2024, 12:12 PMfloitsch
04/12/2024, 12:12 PM--open-drain actually goes to 1 by default.floitsch
04/12/2024, 12:13 PMInformatic0re
04/12/2024, 12:18 PMfloitsch
04/12/2024, 12:21 PMconfigure to change it.
- make it --open-drain. Then the output is only "effective" if you go to 0.
- only allocate the pin when you need to change the value.Informatic0re
04/12/2024, 12:32 PMInformatic0re
04/12/2024, 12:34 PMInformatic0re
04/12/2024, 12:34 PMfloitsch
04/12/2024, 12:35 PMfloitsch
04/12/2024, 12:36 PMInformatic0re
04/12/2024, 12:40 PMfloitsch
04/12/2024, 1:04 PM