Self serving/rendering Tidbyt?

I’ve had my tidbyt setup for a week now with a custom app that displays the time and either 5 day weather, spotify playback, or flights outside my apartment window all based on which is actively occurring (the clock remains in the top third of the display no matter what is happening below). This is being served by a raspberry pi, which pings flight/music data once a second, and updates the tidbyt at least once a minute in order to update the time/weather. This setup is working great, and the display looks super cool, however will there be a point where we won’t need a “back-end” like a raspberry pi to serve data? This could be a wrong assumption, but it seems the display is internet-capable so why not grant it the ability to make requests locally and render itself? How do the tidbyt supported community apps work in terms of getting realtime data? Having this ability would make the display a lot more portable, since it is a little weird to send a request to the tidbyt just to update the time once a minute, plus those requests aren’t always super fast to update

2 Likes

Just wanted to say an app showing flights outside my window would be great to have since I live near a common flight path.

This would require a substantial amount of coding for custom firmware. All image generation, scheduling, app configuration and network operation would need to be handled by the firmware running on the esp32. If you are familiar with the arduino framework then you are one step closer to making your tidbyt do all this heavy lifting for you. It’s all very possible but would require a lot of work to get it going. I have a repo that will allow your tidbyt to display images over mqtt instead of through the tidbyt servers if you want to take a look GitHub - tavdog/tidbyt-mqtt: ESP32 firmware to control a tidbyt matrix panel via MQTT.

I don’t know if it helps, but I forked the panel-led-mqtt repo and added support for static and animated WebP images. I also wrote and published the server code that I made.

1 Like

Awesome work. Does anything need to be done to assign the pins for the tidbyt ? Actually it doesn’t seem to work. Just a bunch of dots on the screen after flashing. No serial output either.

Thanks for trying it out and sorry it didn’t seem to work.

It’s probably waiting to locate the attached TSL2561 light sensor as its currently programmed to just stop if it can’t find it. Make sure all that’s commented out and that you’ve edited secrets.h.

The pins are currently not the same but I’ll add in a build flag to change them to the Tidbyt ones and to disable the light sensor. I completely forgot about that haha.

Edit I added a define flag in the latest commit that disables the light sensor and switches the pin map to the Tidbyt one.

Ok, it’s at least displaying the boot screen now ( needed to add adafruit/Adafruit Unified Sensor to ini to get it to compile ). I have it connecting to mqtt over 1884 non ssl and it’s barfing here with some sort of start_ssl problem.

*WM: [1] STA IP Address: 192.168.1.21
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():216]: (-80) UNKNOWN ERROR CODE (0050)
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -80
*WM: [3] unloading 
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee

Latest commit should fix this. I added another compile flag at the top that can turn on and off SSL.

A little more progress. It now boots, connects wifi, connects mqtt. I’m trying to test it by manually publishing a webp to the tidbyts topic. I’m remembering now that it might need some json with the base64 webp inside of it somehow ? If I send a raw base64 of a webp it does nothing, if I send the raw webp it crashes the pixlet with this :

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4000c350  PS      : 0x00060e30  A0      : 0x800d1ced  A1      : 0x3ffb1ed0  
A2      : 0x00000000  A3      : 0x3ffc9024  A4      : 0x0000007d  A5      : 0x00000000  
A6      : 0xb0cba59a  A7      : 0x5958b0cb  A8      : 0x5b300553  A9      : 0x3ffb1ea0  
A10     : 0x00014d1b  A11     : 0x00000002  A12     : 0x00004d1b  A13     : 0x00001d00  
A14     : 0x02ffffff  A15     : 0x00000000  SAR     : 0x00000010  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000006  

ELF file SHA256: 0000000000000000

Backtrace: 0x4000c350:0x3ffb1ed0 0x400d1cea:0x3ffb1ee0 0x401692ab:0x3ffb1f00 0x400d318a:0x3ffb1f20 0x400d2646:0x3ffb1f60 0x400ed991:0x3ffb1fb0 0x40089b7a:0x3ffb1fd0
  #0  0x4000c350:0x3ffb1ed0 in ?? ??:0
  #1  0x400d1cea:0x3ffb1ee0 in mqttCallback(char*, unsigned char*, unsigned int) at src/main.cpp:177
  #2  0x401692ab:0x3ffb1f00 in std::_Function_handler<void (char*, unsigned char*, unsigned int), void (*)(char*, unsigned char*, unsigned int)>::_M_invoke(std::_Any_data const&, char*&&, unsigned char*&&, unsigned int&&) at /Users/tavis/.platformio/packages/[email protected]/xtensa-esp32-elf/include/c++/5.2.0/functional:1871
  #3  0x400d318a:0x3ffb1f20 in std::function<void (char*, unsigned char*, unsigned int)>::operator()(char*, unsigned char*, unsigned int) const at .pio/libdeps/dev/PubSubClient/src/PubSubClient.cpp:713
      (inlined by) PubSubClient::loop() at .pio/libdeps/dev/PubSubClient/src/PubSubClient.cpp:416
  #4  0x400d2646:0x3ffb1f60 in loop() at src/main.cpp:280
  #5  0x400ed991:0x3ffb1fb0 in loopTask(void*) at /Users/tavis/.platformio/packages/[email protected]/cores/esp32/main.cpp:23
  #6  0x40089b7a:0x3ffb1fd0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Send START to intopic
wait for OK on outtopic
send binary WebP length to intopic
wait for OK
start sending binary chunks of WebP to intopic (max size 19950 bytes) send the next after OK and loop until done.
send FINISH to intopic

This is all pre written in the SmartMatrixServer code so feel free to check that out.

Ah ok. Well since i’m def. not going to go to all the trouble getting docker up maybe I’ll just write a little python script to do all that just for testing. Thanks.

It’s working ! I opened a PR for some improvements and the test python script.