lubeda / EsphoMaTrix

A simple DIY status display with an 8x32 RGB LED panel implemented with esphome.io and Home Assistant
MIT License
217 stars 23 forks source link

RTTTL ulanzi_tuneplay not working #86

Closed scarolan closed 1 year ago

scarolan commented 1 year ago

I have a simple automation where I press the right button and call the esphome.ulanzi_tuneplay service but no sound comes out.

Could this error about GPIO15 be related?

GPIO15 is a Strapping PIN and should be avoided.

If it's any help here is my config and what I see in the logs on the device:

service: esphome.ulanzi_tuneplay
data:
  tune: 'Beethoven:o=5,d=4,b=160,b=160:c,e,c,g,c,c6,8b,8a,8g,8a,8g,8f,8e,8f,8e,8d,c,e,g,e,c6,g.'
11:47:03 | [E] | [rtttl:054] | Missing 'o=
scarolan commented 1 year ago

Found the problem, the RTTTL library only accepts it in the order of d, o, b.

This won't work because it expects the d to be first:

Back to the Future:o=5,d=16,b=200,b=200:4g.,p,4c.,p,2f#.,p,g.,p,a.,p,8g,p,8e,p,8c,p,4f#,p,g.,p,a.,p,8g.,p,8d.,p,8g.,p,8d6.,p,4d6.,p,4c#6,p,b.,p,c#6.,p,2d6.

This works:

Back to the Future:d=16,o=5,b=200,b=200:4g.,p,4c.,p,2f#.,p,g.,p,a.,p,8g,p,8e,p,8c,p,4f#,p,g.,p,a.,p,8g.,p,8d.,p,8g.,p,8d6.,p,4d6.,p,4c#6,p,b.,p,c#6.,p,2d6.
lubeda commented 1 year ago

GPIO15 is a Strapping PIN and should be avoided. this is the strange hardware design from ulanzi! If you like my work please give me a star on github- Thanx