0

Those cheap USB case screens: how to tell the picture data apart from the commands in a USB capture

DEV Community Telling a video stream to a case LCD apart from the commands: JPEG and raw RGB565 in USB captures dev.to
preview

The little 3.5" and 5" USB screens people put in PC cases (and on desks as stat displays) are fun to hack on, but most of them only ship a Windows app. If you capture what that app sends, 99% of the bytes are picture data, and the handful of real commands (brightness, orientation, “start frame”) are easy to miss in between.

I wrote up what helped me separate them: JPEG frames give themselves away with FF D8 at the start and FF D9 at the end, raw RGB565 frames are exactly width x height x 2 bytes and look like slowly changing 16-bit values, and the commands are the short transfers that sit right before each frame or show up when you move a slider. Once you know the frame size, the short header in front of it (size, coordinates, a counter) usually falls out quickly.

The write-up uses examples from usb-rea, an open-source tool I made that does this split on a capture automatically and drafts a small Python driver, but the checks work just as well by hand in Wireshark.

If you have one of these screens that nothing on Linux supports yet, I am curious which ones, there are a lot of rebadged variants out there.

The little 3.5" and 5" USB screens people put in PC cases (and on desks as stat displays) are fun to hack on, but most of them only ship a Windows app. If you capture what that app sends, 99% of the bytes are picture data, and the handful of real commands (brightness, orientation, “start frame”) are easy to miss in between.

I wrote up what helped me separate them: JPEG frames give themselves away with FF D8 at the start and FF D9 at the end, raw RGB565 frames are exactly width x height x 2 bytes and look like slowly changing 16-bit values, and the commands are the short transfers that sit right before each frame or show up when you move a slider. Once you know the frame size, the short header in front of it (size, coordinates, a counter) usually falls out quickly.

The write-up uses examples from usb-rea, an open-source tool I made that does this split on a capture automatically and drafts a small Python driver, but the checks work just as well by hand in Wireshark.

If you have one of these screens that nothing on Linux supports yet, I am curious which ones, there are a lot of rebadged variants out there.

51

Black Friday tip: EU law already tells you if a discount is real, I made a small open-source add-on that reads it

truediscount: is that Black Friday discount real? emirmrkaljevic.github.io
preview

Since 2022 the Omnibus rule says that when a shop in the EU advertises a price reduction, it has to show the lowest price of the last 30 days. Many shops still put a big crossed-out RRP next to the price and hide the 30-day low in small print, so a -50% badge can be closer to -5% in reality.

I got tired of scrolling for that line, so I wrote truediscount. On a product page it finds the 30-day lowest price label (German, French, Italian, Spanish, Dutch, Polish and a few more languages), compares it with the claimed discount and shows a small badge: real discount, inflated, or it was cheaper recently. It also keeps a local price graph for pages you visit.

It is made in Europe, free and MIT licensed. No account, no server, no tracking, all data stays in your browser. It works out of the box on Zalando, MediaMarkt/Saturn, Lidl, Alternate, Notino, About You, Komputronik and others, and you can enable it for any other shop with one click.

Firefox: addons.mozilla.org/en-US/firefox/…/truediscount/ Source and userscript: github.com/emirmrkaljevic/truediscount

Disclaimer: I am the developer of this add-on.

Since 2022 the Omnibus rule says that when a shop in the EU advertises a price reduction, it has to show the lowest price of the last 30 days. Many shops still put a big crossed-out RRP next to the price and hide the 30-day low in small print, so a -50% badge can be closer to -5% in reality.

I got tired of scrolling for that line, so I wrote truediscount. On a product page it finds the 30-day lowest price label (German, French, Italian, Spanish, Dutch, Polish and a few more languages), compares it with the claimed discount and shows a small badge: real discount, inflated, or it was cheaper recently. It also keeps a local price graph for pages you visit.

It is made in Europe, free and MIT licensed. No account, no server, no tracking, all data stays in your browser. It works out of the box on Zalando, MediaMarkt/Saturn, Lidl, Alternate, Notino, About You, Komputronik and others, and you can enable it for any other shop with one click.

Firefox: addons.mozilla.org/en-US/firefox/…/truediscount/ Source and userscript: github.com/emirmrkaljevic/truediscount

Disclaimer: I am the developer of this add-on.