Close

Connectivity Progress

A project log for Basic Capabilities - IOS -> ESP32 BLE

First in a series of basic capability projects. This will be a sprint to establish IOS to ESP32 BLE control.

shanesnipeshane.snipe 12/27/2022 at 17:251 Comment

Thinking back to past projects, they often were unfinished due to incomplete software.  Software of they type I wanted was available so it seemed trivial to complete and I moved on. The truth is it was not straight forward for me to do it. I want to create some plug in tools that when I get to the part of the project  I can sprint across the finish line with a nice video instead of saying the rest is just software.

Again the functionality I want is as follows:

1) Bluetooth control of an ESP32. The Bluefruit app has directional arrows. I will start with learning how to use that.

2) Display sensor readings on the phone.

3) Display the reading with a graphical output. 

Ok, starting with the the most basic example, I will take a generic ESP32 dev board straddling 2 bread boards so the pins are accessible and set up a program that cycles through 4 lights. Actually lets use the WS2812B to represent the 4 locations for interest sake.

So the information I have to assemble to get to this place are as follows:

1) Library or code for the WS2812B

2) Make a subroutine that switches the LED based on a case switch input.

3) Make a For loop that cycles through it for confirmaion.

4) Understand and implement the code to read the arrow status of the Bluefruit app.

So starting with the WS2812B I chose to use the FastLED library. I looked at bit banging it to 

understand it better but the timing looked non-trivial. 

The documentation directs you to identify the following:

1) Type of LED - WS2812B (Neopixel)

2) Number of LEDS - Ring of 12

3) Pin to attach on the ESP32 - Use Pin 19. Confirmed I can use it freely by flashing an LED.

A few hours later...

The FastLED library is awesome. Within 15 minutes I had the LEDs running around the ring.

The coolest part is the color names are the HTML colors with can be found here.

DeepPink was my favorite.  It was not hard, but the time was spent because it was so much fun!

Now on to making the arrows light up the LEDs.

Now again, I realize this is so 2015 but it is a tool I want in my box and I am probably not alone so lets complete this.

So I tried the NRF code from Adafruit  and although it compiles without error, it does nothing and the ESP does not show up on the app.

I Googled ESP32 and Bluefruit and found this very helpful video.

And some times you get lucky! I dropped the code found in the comments and I can see the button presses from my phone in my serial monitor!  Now I just have to connect them to the LEDRing and part 1 will be done.

Wow, thanks to Wim, that was dead easy.

The code will be attached as part of the project.

Next is working on displaying sensor readings on the tablet.

Discussions

Daniel wrote 01/04/2023 at 22:47 point

Very interesting project.

  Are you sure? yes | no