#3D RGB Cube Painting

92 messages Β· Page 1 of 1 (latest)

jaunty basin
#

I saw some of these 8x8 RGB boards on sale, so I decided to buy 6 and make a cube with them.

To experiment with different designs on it, I built a little 3D cube that I can rotate and paint on, hosted and running on the ESP itself.

(And yes, I know my cube edges are not very clean. It's currently literally taped together while I come up with a more permanent mounting method. πŸ˜…)

proven falcon
#

very cool , nice work.. πŸ‘

scarlet umbra
#

Awesome!

#

If we can play 3d tetris I can make one for my mom πŸ˜‚

jaunty basin
#

haha certainly possible to build someting like that πŸ˜…

nocturne falcon
#

add an accelerometer/gyroscope and the unit becomes the controller too

#

super cool

vernal copper
#

This is really cool - good idea, good job πŸ™‚

bitter citrus
#

hi,

#

few years ago i made a paint program with an adressable 2d led matrix using esphome,

#

at that time i struggled a lot with the webserver component that i forked,

#

having crashes and many issues. i discontinued this project.

#

is the code available anywhere so i can look at how you have done it ?

#

are you using esphome api or http requests or web sockets?

#

@jaunty basin> thanks in advance for your response and congrats for you project. will try to find screenshot back of my project

#

(is this even an esphome project?)

jaunty basin
#

So for right now, it's using the web_server: component with custom js and css, and to actually do the painting I'm using a light: control to set the color, and a number: control to specify which pixel will be set. e.g. I send a POST to /light/some_light/turn_on?r=${r}&g=${g}&b=${b} when the color input changes, and a POST to /number/index/set?value=${i} to say "paint/set the color of the specified index with the current color of some_light", which I fire off as the mouse passes over the squares.

I would recommend ABSOLUTELY NOT building it this way but it was the fastest way to get it off the ground as a test. My plan is to switch it over to using web sockets but I haven't dug into that part yet.

bitter citrus
#

I send a POST to /light/some_light/turn_on?r=${r}&g=${g}&b=${b} when the color input changes, => exactly what i did !

#

at that time it crashed the esp sometimes :/

#

it seem so smooth on your video !

#

i need to test again then

jaunty basin
#

Oh really? were you passing values outside of the allowed range? I've never had an issue with it, although occassionally the http requests would seemingly get backed up and it'd take a few seconds for it to show up

bitter citrus
#

no, i can share you the code it's on github

#

also,

#

i had a 'send' method that send all the buffer

#

that one was failing many time

#

but sometimes not x)

jaunty basin
#

Ah yeah over some data size the ESP can kinda choke up depending on the implementation

bitter citrus
#

and here is the webserver component fork:

#

WebServer::handle_setpixel_request()

#

for individual pixels

#

and WebServer::handle_buffer_request() for a buffer send

#

(then as backend i used AddressableLightDisplay Component over a custom component)

bitter citrus
#

should works :/

#

anyway,

#

your project make me want to try again to check if webserver had bugs that may have been fixed

#

it seems way more reactive on your video than i remember by doing the same pixel updates

jaunty basin
#

yeah you should! and the web_server component has web socket support (at least for the "arduino" variant) so it wouldn't be too hard to send things that way instead

bitter citrus
#

i thought about,

#

but esphome guys encouraged me to use esphome api instead. and i never did...

jaunty basin
#

were you sending individual pixel updates as well, or just the whole buffer every time? that might be why it was slower

bitter citrus
#

when clicking on send. the whole buffer (one request)

#

(in my particular case , with a 35x25 and a 16x16 led matrix)

bitter citrus
jaunty basin
#

Ah yeah that could slow things down depending on how it's implemented. my plan is to move to web sockets so I can still send each one immediately but it doesn't have the overhead of opening a new HTTP request each time

bitter citrus
#

yes handling new connection seems bad for the webserver

jaunty basin
#

Yeah and there are a limited number it can handle concurrently

bitter citrus
#

please send updates :p

jaunty basin
#

I'm about to leave on a trip so won't be touching it for the next ~2 weeks, but send updates if you play with it more!

bitter citrus
#

same to me. trip next week x)

#

seems i have made a pixel queue, client side*

#

_sendPixelQueue

#

yes lately i was buffering every update...

#

wasn t the case initially

#

(i tried lot of things at that time)

jolly zephyr
#

Wow - this is amazing

smoky frost
#

fantastic, can you share the codebase of it?

jaunty basin
#

The code as-is is pretty horrifying and I would not recommend implementing it that way 🫣 but it was enough to get it off the ground to test this. If you really want it though I can pop it up on pastebin or gist or something.

bitter citrus
#

so i can do pull request x)

jaunty basin
#

haha noo can't have the evidence of the current version living forever πŸ˜…

bitter citrus
#

πŸ‘‹ any update since ?

#

want to get back on my code

#

i will try same code with current esphome

#

then trying to implement websocket in the web_server_base component

bitter citrus
#

(and a test device as my matrix is in the living room and too big to move)

bitter citrus
#

damn. already a bug in my webapp x)

#

why does it draw 3 pixel instead of one ^^'

#

thats why we should never go back on old codebase

#

oh. i remember there was a bug in filledCircle i took from esphome πŸ˜„

#

this was a quick fix

jaunty basin
#

Well your UI has definitely leapfrogged mine quite far now πŸ˜… did you get websocket stuff figured out or just using normal requests? I think I have an experimental websocket branch…somewhere… πŸ˜΅β€πŸ’«

#

It was arduino-only though, not sure if that's a no-go for you

bitter citrus
#

that's maybe the problem πŸ˜„

bitter citrus
#

i proxy the requests to the device if present, else i have a dev mode sending requests to null

#

havent implemented websockets yet. need to have a free brain to do so

#
  • had problems yesterday having my esphome dev env working