RGB LED Usage
Closed this issue ยท 3 comments
The new Hardware has a RGB LED but it is currently not used. We need to implement some easy Szenarios to use the RGB LED
Szenarios:
- No Thread connection :: blinks red shortly every 3s
- Thread connected :: Green for 3s
The leds are already declared as leds and pwm leds, we can start with a simpler first blink on power on
I have an example on how to use leds with Zephyr from the HW repo with the old Zephyr platformio examples
indeed, this is a vital feature for the Tag usability, after some experimentation with Thread Stack, here how we can take advantage of the led.
- as few states as possible not to confuse users
- use different colors but also different blink frequencies (color blind friendly)
- be low power friendly, think how long will the tag las if it is left blinking for weeks, e.g. slow down blinking, make the pulse shorter
It is also important for the development to be able to identify the state:
(note, I'm using Nordic's fork of Zephyr and openthread)
The roles are defined here : https://github.com/nrfconnect/sdk-openthread/blob/edc1a3fe2325428e7ff304ea3e92dba9da652c92/include/openthread/thread.h#L74
For the sensor tag, only those two roles are relevant
- disabled : after factory reset, when no network was joined (no response obtained for "Discovery Request")
- detached : after having authenticated in a network but not yet joined, e.g. after restart out of network
- child : normal and expected operating modes
Now the led, might be needed to indicate other things like low battery, but I'll keep it out for the moment as we still don't know the range color mapping including temperature fluctuations
Normal operation
child ๐ข <- 30 sec sleep - >๐ข <- 30 sec sleep - >๐ข
Startup
in normal operation when commissioned on first startup and wake up with available credentials
๐ด ๐ข ๐ต <- 3sec -> ๐ด ๐ข ๐ต => detached ๐ต๐ต => child ๐ข <- 30 sec sleep - >๐ข <- 30 sec sleep - >๐ข
No Network
=> detached ๐ต๐ต <- sleep 40 sec - > => detached ๐ต๐ต <- sleep 40 sec - > => detached ๐ต๐ต
No Network after factory reset
=> Disabled ๐ต๐ต <- sleep 40 sec - > => Disabled ๐ด๐ด๐ด reboot
Factory reset
- press both buttons after first hello signal and before second (within 3 seconds) for a quick reboot
- repeat quick reboot x2 times
press -> reboot ๐ด๐ข๐ต quick-reboot ๐ด๐ข๐ต quick-reboot ...๐ต...๐ต...๐ต factory reset => reboot
without colors
โซโซโซ ... โซโซโซ => Startup
when running
โซ => Child - OK
โซโซ => Detached
โซโซโซ => Disabled