• Connectivity Progress

    shane.snipe12/27/2022 at 17:25 1 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.

  • Search for the optimum app.

    shane.snipe12/26/2022 at 23:57 0 comments

    Previously I would have used Thunkables and made my own app. However, being a reluctant iphone user, I do not think the development landscape is a maker friendly. So lets see what can be done with a off the shelf app. Why spend weeks learning a new platform if a $10 app can achieve the same thing.

    App Requirements

    - No ongoing subscriptions needed.

    - No need to be connected to wifi.

    - Support BLE or Bluetooth.

    Step 1   Control LED's on the ESP through the app.

    Step 2  Receive a 600 item list and plot it on the phone.

    And the search begins:

    Background info on BLE and ESP32 - Android

    Same with BT Classic and ESP32 - Android

    BLE Terminal

    Sending capability seems good. No graphing capability immediately available.

    In any case, I followed the following tutorial.

    Getting Started with ESP32 Bluetooth Low Energy (BLE) on Arduino IDE

     Bingo! I got the hello world from the ESP32 program to show up on my phone.

    I used the Server example program referenced in the tutorial.

     It was under the examples for ESP32 BLE Arduino/BLE Server

    It has 5 buttons and ASCII input that I can send to my program.

    However, I would like to send data from my sensor to my phone. I do not 

    see a way to do that with this app

    Bluefruit Connect

    I disconnected and loaded up the Bluefruit Connect and was able to 

    connect with the same program. This program has the ability to receive 

    data and graph it so that is definitely a goal here.

    I tried the BLE_UART program and was able to get the ASCII characters to display in the Bluefruit app.

    So that is it for today. Tomorrow I would like to the app to control my program and 

    allow it make a case switch decision.

    Secondly I would like to display a sine wave on the app which was generated on 

    the ESP32.

    Lastly, I would like to reproduce these actions with a Spark Fun Artemis Nano.