LED Clock, Part III: Alexa?

Whilst I await delivery of more WS2812 LEDs, I wanted to start investigating how I can leverage the Alexa Gadget Toolkit integration, so that when I set a timer using Alexa, my LED clock can show the countdown.

Amazon make an Echo Wall Clock which does just that.

I found an open source project called nixie-timer, which had an Alexa Integration and was written for the ESP32

After a few hours of digging around, I had a very basic idea of what the code was doing. I started by trying to replicate the flow using the OOB ESP-IDF.

After many, many, many hours, I realised that I really didn’t know what I was doing, so I went back to the nixie-timer code and added the btstack ESP32 port into my code. This meant I could at least follow the samples provided.

I began trying to run some code myself, but the Bluetooth radio wouldn’t even start. I then took one of the BTStack examples and used that as a starting point. At least they worked.

After more hours, I got the code running, with the occasional kernel panic as I figured stuff out..

Eventually, I got it responding to the Alexa queries and receiving the messages for wakeword, timeinfo and timer.

Exactly what I wanted to achieve. I’m not 100% sure I know what’s going on, but I’ll get more understanding over time.

For starters, I want to use timeinfo to set the internal clock and then I want to use the timer command to display the countdown of an alexa timer.

Now that I’ve moved back to ESP-IDF, I’m going to have to bin my existing Arduino code which powers the LED strip and look at how to make that work.

Happy with progress.

My other WS2812 strip arrived the other day, so I’ve got to look at cutting and connecting the two strips to form one long 180 LED strip. Then I get get a feel of the overall diameter and cut some MDF to house the damn thing.

7 thoughts on “LED Clock, Part III: Alexa?

  1. Hey I am working on using Alexa Gadget Toolkits as well for one of my projects. I had couple of questions, that i was hoping you could respond to.

    1. I see you are using ESP IDF, have you tried using Arduino for your ESP32? Will that work?

    2. Were you able to figure out how to make the Alexa Gadget toolkit with the ESP IDF?

    1. Hello, mDot,

      1. I tried with Arduino initially, but I didn’t really understand what I was trying to do. Once I found a working sample using ESP-IDF, I switched to ESP-IDF. I also tried to use the BlueDroid Bluetooth library, but in the end, I switched to BTStack. My Echo devices are 1st generation, so they only support the Bluetooth Classic mode. Perhaps it would be possible using Arduino and Bluetooth LE?
      2. Yeah, I got it to work with the help of the sample code. I’ve some work left, like saving the ID of the connected Echo device, but the connections, clock settings and timer control all work!

      If I can help anymore, don’t hesitate to reach out!


      1. Hey Tomas!

        Thanks for the reply. Really appreciate it, its been very hard to talk to someone who has working knowledge of the Alexa Gadgets Toolkits.

        1. I didnt realize you were using Bluetooth classic. I have a 3rd gen echo dot, so my preference would be to use BLE. Furthermore, since my application code is already written in Arduino i would prefer to use the two (BLE + Arduino). However, i dont have much knowledge of BLE so i have been struggling to make any progress. I dont know if you could give me some points on how to move forward in setting this up, that would be really really helpful.

        2. Ok thats good to know, as mentioned above my preference is to use Arduino. If not then yeah, i would have to resort to looking into the ESP IDF approach.

        Again, thankyou for taking out the time to respond back 🙂

      2. I know the feeling!! It’s hard to find anything about this.

        When I started with my work, I added basic advertisement support and managed to get that to work with BLE. It showed up in the Alexa app when I was adding devices. That was as far as I got before I realised my Echo’s didn’t support BLE.

        I would start there. The details of what to include in the advertisement package are outlined and I was able to implement that in my code.

      3. Yeah i was a bit surprised, i honestly thought this would take off but it never did.

        Do you by any chance have that could for BLE available? Maybe i can use that as a starter point. I have gone through the Amazon documentation for this over a hundred times but have always found it a bit too overwhelming.

        Again, really appreciate the quick responses 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.