Skip to content

A small application that was intended to help me learn more of the inner workings of the ESP-32 platform, WS2812B LED controllers, FreeRTOS, and the CoAP protocol.

License

Notifications You must be signed in to change notification settings

oneam/esp32_led_ring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP-32 LED Ring App

This is a small application that was intended to help me learn more of the inner workings of the ESP-32 platform, WS2812B LED controllers, FreeRTOS, and the CoAP protocol.

The led controller is influenced by this one on Insentricity. Unfortunately I couldn't understand the code, so I chose to rewrite it instead. By default, the application runs a 24 LED ring in strobing rainbow mode. The LEDs can be controlled using the CoAP Protocol There is an associated iOS application that allows you to control the device.

To Build the App

  • Download and install ESP-IDF
  • Run make menuconfig to ensure that your USB device is configured correctly
  • Open main.c and configure your GPIO port, WiFi SSID, and password
  • Run make flash

If all goes well, you should see the LED ring cycling through all of the colors of the rainbow.

If you want to further control the lights, you can communicate with the device via the CoAP Protocol

If you have libcoap installed on your computer, you can use the coap-client command to control the device

  • coap-client coap://your_device/led_ring gets the current mode
  • coap-client -m put -e '["solid_rainbow"]' coap://your_device/led_ring for a solid rainbow
  • coap-client -m put -e '["spinning_rainbow"]' coap://your_device/led_ring for a spinning rainbow
  • coap-client -m put -e '["strobing_rainbow"]' coap://your_device/led_ring for a strobing rainbow
  • coap-client -m put -e '["solid_dots"]' coap://your_device/led_ring for a dots
  • coap-client -m put -e '["spinning_dots"]' coap://your_device/led_ring for a spinning dots
  • coap-client -m put -e '["strobing_dots"]' coap://your_device/led_ring for a strobing dots (like a strobe light)
  • coap-client -m put -e '["solid_color",64,0,0]' coap://your_device/led_ring for solid red
  • coap-client -m put -e '["solid_color",0,0,64]' coap://your_device/led_ring for solid blue
  • coap-client -m put -e '["solid_color",0,0,0]' coap://your_device/led_ring to turn the LEDs off

The CoAP server is also configured to response to multicast requests, which allows multiple devices to be controlled simultaneously. This is how the associated iOS app finds devices on the network.

About

A small application that was intended to help me learn more of the inner workings of the ESP-32 platform, WS2812B LED controllers, FreeRTOS, and the CoAP protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published