You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry to hear that, FYI the display you should expect is this one: https://www.youtube.com/watch?v=Y1m4KK881Aw
I had greater success in decompiling the chinese binary than the english one, it was not obfuscated. You will find the link of it in the README
I've had a look at all three, and yes, the one you mention is MUCH easier to work with.
It's a shame there's no way to get hold of the creators and have a look at their firmware source.
I'm considering knocking something up in golang, to see if it's just the serial port drivers are broken on the M1 or if it's just pyserial that's not working.
Im also getting this issue on my Mac, dont get it on windows. the port shows up as "/dev/tty.usbmodemUSB35INCHIPSV21" @opless did you find a workaround ?
It's very much to do with the USB serial implementation, as far as I can tell.
I had some better luck sending data to it via golang, as the serial port initialisation is different.
I pretty much put the project aside after things getting busy with the day job and having less brain in the evening. It's certainly something weird with the M1 serial usb drivers though!
Hi, i'm reopening this issue for people with Mac that have the same problem. Feel free to discuss here. What you can also try is changing the COM port settings here:
I think I've fixed it by serializing the updates to the screen (using a queue, so it'll run through each one cleanly before executing the next).
With the default code base I could get it to step on itself, once I started adding a bunch more things to update it just got worse and worse. You could help by increasing the delay after an update was done, but slowing down the updates isn't really a solution as it makes everything slow.
With this PR it runs at a very high rate and has no issues with keeping up, not getting serial errors anymore.
In my testing in my own library, I found that the delay between the bitmap data being output and the next command being issued needs to be quite long - about 0.02 seconds. Shorter than this and you get corruption on the display. The current delay in the code on the master branch is about 0.01 seconds, which means that the other slack is being taken up by the code sitting between the time.sleep(0.01) and the next SendReg writing a command. On faster machines that code will be executed faster, and result in the corruption (I believe).
In my library I changed the behaviour so that instead of explicitly sleeping at the end of the update of a bitmap, we remember when the last output happened and if we try to write a command before the required inter-bitmap-delay has expired, we sleep there instead. This means that we get useful work done between the two operations, and if you did enough work you'd never need to sleep at all before the next command was written.
My library changes that did this were here, if they're useful to you:
It looks like the changes in PR #15, mentioned above, move the logic for the delay out of the communications library. I cannot tell how this keeps the bitmap transfers and the subsequent command updates apart enough to avoid the corruption.
I may have fixed the issue with this simple change on the serial communication: ac169f3
By manually flushing the serial buffer regularly, it has solved the corruption problem on my setup:
MacBook Air (13-inch, 2017)
macOS Monterrey 12.7.6
A pull request has been opened with this fix here: #721
Before merging, I would like to have your feedback, especially for people with Apple M1 CPU.
You can use the branch fix/7-screen-displays-corrupted-images-on-mac or just apply the one-line fix manually.
I captured the Windows USB traffic with USBPcap. The payload is standard RGB565 little-endian and matches the Rev A framebuffer format. The key difference is transport:
Windows sends data directly to USB bulk OUT endpoint 0x03
macOS serial path goes through /dev/cu.usbmodem...
When I bypassed the macOS serial device and wrote directly to USB bulk endpoint 0x03 using PyUSB/libusb, the image rendered correctly.
Conclusion
For this device, the framebuffer/protocol is not the issue. The corruption seems to come from the macOS USB CDC serial path. Writing directly to the bulk endpoint fixes it.
Working approach
Use PyUSB/libusb and write to:
VID/PID: 1a86:5722
interface: CDC data interface 1
OUT endpoint: 0x03
framebuffer: RGB565 little-endian
resolution: 320x480
Minimal flow:
Claim interface 1
Send Rev A SET_ORIENTATION
Send Rev A DISPLAY_BITMAP
Send full RGB565 framebuffer to endpoint 0x03
This works on macOS for the USB35INCHIPSV2 device where /dev/cu.usbmodem... corrupts images.
This suggests the project may need a macOS-specific backend for Rev A UsbMonitor devices that uses raw USB bulk instead of pyserial.
The important finding is that the framebuffer/protocol itself was correct. The corruption happened when using the macOS serial device (/dev/cu.usbmodemUSB35INCHIPSV21). Sending the same RGB565 little-endian framebuffer directly to USB bulk endpoint 0x03 fixed the corrupted image for me.
Root cause found + verified working fix on macOS (Mac mini M4, macOS 26.5.2, Turing/UsbMonitor 3.5" rev A — 1a86:5722, serial USB35INCHIPSV2).
After a systematic reverse-engineering session (solid fills, gradients, per-packet rainbow maps, barcode-tagged bands, full USB descriptor probing), the corruption mechanism is now clear:
The panel firmware is USB-transfer-oriented, not byte-stream-oriented.
It reads a command from the start of a USB transfer and ignores the rest of that transfer.
After a DISPLAY_BITMAP header, it counts exactly w*h pixel bytes (RGB565 LE). Any byte arriving before the rectangle is complete — including what we believe are commands — is swallowed as pixel data.
Once the byte stream loses sync (a single lost/mis-framed byte), the panel's pixel counter is off, and every subsequent command is eaten as pixels → permanent corruption until power cycle. This explains why RESET/CLEAR "don't work" once the image is corrupted, and why every run produces different garbage.
The macOS CDC ACM serial path (/dev/cu.usbmodemUSB35INCHIPSV21) repackages/fragments USB transfers arbitrarily, so commands end up glued to pixel data or split mid-command → instant desync. This matches @gregsadetsky's 64-byte packet reordering observations and why Linux/Windows/ESP32 are unaffected.
These exact semantics are documented in @tanakamasayuki's EspUsbHost TuringDevice.hpp (ESP32 USB-host driver for this same panel): "The panel takes a command from the start of a transfer and ignores the rest of it" / "The panel counts the pixels itself".
Working fix (verified end-to-end): bypass the serial device entirely — write directly to bulk OUT endpoint 0x03 via PyUSB/libusb with strict transfer discipline:
every command in its own transfer (one endpoint.write() per command; a header never shares a transfer with pixel data),
SET_ORIENTATION is 11 bytes (6-byte command + orientation+100 + width/height BE), not 16,
pixel data in 64-byte-aligned chunks totalling exactlyw*h*2 bytes,
nothing else is written while a bitmap is in progress,
if the panel ever desyncs, unplug/replug the USB-C cable — RESET only reaches the panel when the stream is in sync.
With this, the panel renders solid full-screen frames back-to-back with zero desync, and the full system monitor (themes + live stats) runs correctly on macOS.
Note: @marcelors27's one-shot bulk write worked on their unit but not on ours (identical VID/PID/serial), there seem to be firmware batch differences; the strict transfer discipline above is what made it reliable here. Hope this helps finally close this one .
Update: PR #1138 adds the USB bulk fix below as an opt-in USB_BULK option.
Another rev A unit (1a86:5722, serial USB35INCHIPSV2, TURZX-branded) working on macOS. I'm on an M4 Max, macOS 27, with the screen behind a USB-C dock. A few findings that might help this get merged.
1. Raw USB works without root. I used the bulk endpoint approach from marcelors27 and amarok30. On my machine detach_kernel_driver() fails with Access denied, but claim_interface(1) succeeds anyway with the CDC driver still attached, and writes to endpoint 0x03 draw perfectly. So a macOS backend doesn't need sudo or a special entitlement.
2. Why the serial path corrupts, as seen on this unit. Before finding this thread I worked it out from photos of test patterns. The firmware draws every USB packet as 64 bytes (32 px), whatever its real length:
a short packet is drawn padded with stale bytes, which makes slanted or staircase images;
when a write's length is an exact multiple of 64, macOS ends the transfer with a zero-length packet, and that is drawn as a duplicate 64 bytes. With large writes this shows up as about 20% extra data: bands too tall, and leftover pixels that become the "second pass" / desync people describe here.
This fits amarok30's "transfer-oriented" description. It also explains why flushing and delays never fully fixed it: they change where the packet boundaries fall, not what the firmware does with them.
3. Partial updates. I keep a framebuffer copy of the screen and widen every DisplayPILImage call horizontally to the 32-px grid. Each bitmap is then exactly w*h*2 bytes in whole 64-byte packets, so text, clock and progress-bar updates are packet-aligned too, not only full frames. A full 320×480 frame takes about 1.9 s. The stock 3.5inchTheme2 theme runs at about 1% of one core.
4. Fallback for people who can't use libusb. Through /dev/cu.usbmodem* it also works if each write is several full 64-byte packets plus one 62-byte packet (no write is ever a multiple of 64), with flush() after each write and 160 px per write. The firmware's junk pixel then always lands on the same column, which leaves 2 faint hairlines (x = 159 and 319). Writes over ~512 bytes got split by macOS and broke it.
Two smaller things:
Reset() on startup left my unit ignoring draw commands until it was replugged. RESET_ON_STARTUP: false avoids that.
The same unit draws correctly on Raspberry Pi OS through the stock serial path, with no workarounds. That confirms this is specific to macOS's serial driver.
Unrelated to the display, but needed for a usable Mac theme: on Apple Silicon psutil.cpu_freq() returns placeholders (the theme shows 0.00 GHz), and disk_usage("/") reads the sealed system volume. I read live per-cluster frequency from IOReport (no root, residency-weighted over the pmgr DVFS tables) and use /System/Volumes/Data for disk. I've since added GPU load, memory, frequency and temperature, plus CPU temperature, from IOAccelerator, IOReport and the SMC. SMC sensor keys are found from the SMC's own key table, because the M1–M3 names don't all exist on M4, and parked cores read a 40.0 °C placeholder. That overlaps Add Apple Silicon sensor support (SMC, IOReport, AGX GPU) #977, so I've kept it out of Rev A: optional USB bulk transport to fix corrupted images on macOS #1138 and sent it separately as Python sensors: Apple Silicon CPU/GPU frequency, temperatures and macOS disk #1139.
PR #1138 adds the USB bulk transport as USB_BULK under REVISION: A (default false; configure.py's revision map untouched), falling back to the serial port if the device can't be opened over USB. The serial 62-byte workaround from point 4 is left out to keep it small.
Activity
opless commentedon Feb 3, 2022
Looks like it's something weird with the serial comms or the operating system.
Closing because it's not fixable here.
mathoudebine commentedon Feb 3, 2022
Sorry to hear that, FYI the display you should expect is this one: https://www.youtube.com/watch?v=Y1m4KK881Aw
I had greater success in decompiling the chinese binary than the english one, it was not obfuscated. You will find the link of it in the README
opless commentedon Feb 3, 2022
I've had a look at all three, and yes, the one you mention is MUCH easier to work with.
It's a shame there's no way to get hold of the creators and have a look at their firmware source.
I'm considering knocking something up in golang, to see if it's just the serial port drivers are broken on the M1 or if it's just pyserial that's not working.
alanrenouf commentedon May 13, 2022
Im also getting this issue on my Mac, dont get it on windows. the port shows up as "/dev/tty.usbmodemUSB35INCHIPSV21" @opless did you find a workaround ?
opless commentedon May 13, 2022
It's very much to do with the USB serial implementation, as far as I can tell.
I had some better luck sending data to it via golang, as the serial port initialisation is different.
I pretty much put the project aside after things getting busy with the day job and having less brain in the evening. It's certainly something weird with the M1 serial usb drivers though!
[-]Screen displays images but is corrupted and weird.[/-][+]Screen displays corrupted images on Mac[/+]mathoudebine commentedon May 16, 2022
Hi, i'm reopening this issue for people with Mac that have the same problem. Feel free to discuss here. What you can also try is changing the COM port settings here:
turing-smart-screen-python/main.py
Line 184 in deb0a60
If i remember correctly, the display also works with baudrates slower than 115200
alanrenouf commentedon May 16, 2022
Tried slower baudrates and not getting any luck
Ebag333 commentedon Jun 6, 2022
#15
I think I've fixed it by serializing the updates to the screen (using a queue, so it'll run through each one cleanly before executing the next).
With the default code base I could get it to step on itself, once I started adding a bunch more things to update it just got worse and worse. You could help by increasing the delay after an update was done, but slowing down the updates isn't really a solution as it makes everything slow.
With this PR it runs at a very high rate and has no issues with keeping up, not getting serial errors anymore.
alanrenouf commentedon Jun 6, 2022
I still get the corrupt image using the overhaul branch on my mac, I like the other changes to make the code more modular. Nice!
gerph commentedon Aug 29, 2022
From my own investigation:
In my testing in my own library, I found that the delay between the bitmap data being output and the next command being issued needs to be quite long - about 0.02 seconds. Shorter than this and you get corruption on the display. The current delay in the code on the master branch is about 0.01 seconds, which means that the other slack is being taken up by the code sitting between the
time.sleep(0.01)and the nextSendRegwriting a command. On faster machines that code will be executed faster, and result in the corruption (I believe).In my library I changed the behaviour so that instead of explicitly sleeping at the end of the update of a bitmap, we remember when the last output happened and if we try to write a command before the required inter-bitmap-delay has expired, we sleep there instead. This means that we get useful work done between the two operations, and if you did enough work you'd never need to sleep at all before the next command was written.
My library changes that did this were here, if they're useful to you:
gerph/turing-smart-screen-python-mit@8ba5901
It looks like the changes in PR #15, mentioned above, move the logic for the delay out of the communications library. I cannot tell how this keeps the bitmap transfers and the subsequent command updates apart enough to avoid the corruption.
27 remaining items
mathoudebine commentedon Mar 20, 2025
Hi everyone!
I may have fixed the issue with this simple change on the serial communication:
ac169f3
By manually flushing the serial buffer regularly, it has solved the corruption problem on my setup:
A pull request has been opened with this fix here: #721
Before merging, I would like to have your feedback, especially for people with Apple M1 CPU.
You can use the branch
fix/7-screen-displays-corrupted-images-on-macor just apply the one-line fix manually.Thanks!
mathoudebine commentedon Apr 1, 2025
Reopened because some corruptions still occur
mathoudebine commentedon Apr 1, 2025
@gregsadetsky @oldirtdog what display do you have? Is it a Turing rev. A?
Can you try with some portrait content if possible? Thanks
gregsadetsky commentedon Apr 2, 2025
It's a Rev A yeah. I've been using simple-program.py for all of my tests, should I have been using some other sample code? thanks!
tapsu01 commentedon Apr 5, 2025
I get this on MacOS Ventura 13.7.5:

oldirtdog commentedon May 13, 2025
@mathoudebine Tried in portrait mode... same garbage showing up on screen.
aptonline commentedon Apr 27, 2026
Can I confirm if it's just revision A displays that have this issues or is it all displays?
oldirtdog commentedon Apr 27, 2026
I'll be honest, I got tired of messing around with this thing and threw it in the trash. I only had the Revision A display.
marcelors27 commentedon May 10, 2026
I investigated image corruption on macOS with a TURZX/Turing/UsbMonitor 3.5" device and found a likely root cause/workaround.
Device
/dev/cu.usbmodemUSB35INCHIPSV21TuringUsbMonitorUSB35INCHIPSV21a86:5722Symptom
Using the current Rev A serial backend, the display receives data but complex images are corrupted/glitched:
Simple solid color band patterns can appear mostly correct, which initially makes the serial path look valid, but real theme images are corrupted.
What I tested
/dev/cu.usbmodem...: corruptedI captured the Windows USB traffic with USBPcap. The payload is standard RGB565 little-endian and matches the Rev A framebuffer format. The key difference is transport:
0x03/dev/cu.usbmodem...When I bypassed the macOS serial device and wrote directly to USB bulk endpoint
0x03using PyUSB/libusb, the image rendered correctly.Conclusion
For this device, the framebuffer/protocol is not the issue. The corruption seems to come from the macOS USB CDC serial path. Writing directly to the bulk endpoint fixes it.
Working approach
Use PyUSB/libusb and write to:
1a86:572210x03320x480Minimal flow:
SET_ORIENTATIONDISPLAY_BITMAP0x03This works on macOS for the
USB35INCHIPSV2device where/dev/cu.usbmodem...corrupts images.This suggests the project may need a macOS-specific backend for Rev A UsbMonitor devices that uses raw USB bulk instead of pyserial.
gregsadetsky commentedon May 10, 2026
@marcelors27 amazing work! Would you be able to share what code worked for you on macos?
marcelors27 commentedon May 10, 2026
Sure. What worked for me on macOS was bypassing
/dev/cu.usbmodem...entirely and writing directly to the USB bulk OUT endpoint with PyUSB/libusb.My device is:
1a86:5722TuringUsbMonitorUSB35INCHIPSV20x03320x480Minimal example:
On macOS I also needed libusb:
The important finding is that the framebuffer/protocol itself was correct. The corruption happened when using the macOS serial device (/dev/cu.usbmodemUSB35INCHIPSV21). Sending the same RGB565 little-endian framebuffer directly to USB bulk endpoint 0x03 fixed the corrupted image for me.
amarok30 commentedon Aug 21, 2026
Root cause found + verified working fix on macOS (Mac mini M4, macOS 26.5.2, Turing/UsbMonitor 3.5" rev A —
1a86:5722, serialUSB35INCHIPSV2).After a systematic reverse-engineering session (solid fills, gradients, per-packet rainbow maps, barcode-tagged bands, full USB descriptor probing), the corruption mechanism is now clear:
The panel firmware is USB-transfer-oriented, not byte-stream-oriented.
DISPLAY_BITMAPheader, it counts exactlyw*hpixel bytes (RGB565 LE). Any byte arriving before the rectangle is complete — including what we believe are commands — is swallowed as pixel data./dev/cu.usbmodemUSB35INCHIPSV21) repackages/fragments USB transfers arbitrarily, so commands end up glued to pixel data or split mid-command → instant desync. This matches @gregsadetsky's 64-byte packet reordering observations and why Linux/Windows/ESP32 are unaffected.These exact semantics are documented in @tanakamasayuki's EspUsbHost
TuringDevice.hpp(ESP32 USB-host driver for this same panel): "The panel takes a command from the start of a transfer and ignores the rest of it" / "The panel counts the pixels itself".Working fix (verified end-to-end): bypass the serial device entirely — write directly to bulk OUT endpoint
0x03via PyUSB/libusb with strict transfer discipline:endpoint.write()per command; a header never shares a transfer with pixel data),SET_ORIENTATIONis 11 bytes (6-byte command + orientation+100 + width/height BE), not 16,w*h*2bytes,With this, the panel renders solid full-screen frames back-to-back with zero desync, and the full system monitor (themes + live stats) runs correctly on macOS.
A ready-to-use backend (subclass of
LcdCommRevA, registered asREVISION: A_USBMAC) is here: https://gist.github.com/amarok30/cddaa9a9818d6830a74d9332f501047eNote: @marcelors27's one-shot bulk write worked on their unit but not on ours (identical VID/PID/serial), there seem to be firmware batch differences; the strict transfer discipline above is what made it reliable here. Hope this helps finally close this one .
eaglstun commentedon Nov 19, 2026
Update: PR #1138 adds the USB bulk fix below as an opt-in
USB_BULKoption.Another rev A unit (
1a86:5722, serialUSB35INCHIPSV2, TURZX-branded) working on macOS. I'm on an M4 Max, macOS 27, with the screen behind a USB-C dock. A few findings that might help this get merged.1. Raw USB works without root. I used the bulk endpoint approach from marcelors27 and amarok30. On my machine
detach_kernel_driver()fails withAccess denied, butclaim_interface(1)succeeds anyway with the CDC driver still attached, and writes to endpoint0x03draw perfectly. So a macOS backend doesn't need sudo or a special entitlement.2. Why the serial path corrupts, as seen on this unit. Before finding this thread I worked it out from photos of test patterns. The firmware draws every USB packet as 64 bytes (32 px), whatever its real length:
This fits amarok30's "transfer-oriented" description. It also explains why flushing and delays never fully fixed it: they change where the packet boundaries fall, not what the firmware does with them.
3. Partial updates. I keep a framebuffer copy of the screen and widen every
DisplayPILImagecall horizontally to the 32-px grid. Each bitmap is then exactlyw*h*2bytes in whole 64-byte packets, so text, clock and progress-bar updates are packet-aligned too, not only full frames. A full 320×480 frame takes about 1.9 s. The stock3.5inchTheme2theme runs at about 1% of one core.4. Fallback for people who can't use libusb. Through
/dev/cu.usbmodem*it also works if each write is several full 64-byte packets plus one 62-byte packet (no write is ever a multiple of 64), withflush()after each write and 160 px per write. The firmware's junk pixel then always lands on the same column, which leaves 2 faint hairlines (x = 159 and 319). Writes over ~512 bytes got split by macOS and broke it.Two smaller things:
Reset()on startup left my unit ignoring draw commands until it was replugged.RESET_ON_STARTUP: falseavoids that.psutil.cpu_freq()returns placeholders (the theme shows 0.00 GHz), anddisk_usage("/")reads the sealed system volume. I read live per-cluster frequency from IOReport (no root, residency-weighted over thepmgrDVFS tables) and use/System/Volumes/Datafor disk. I've since added GPU load, memory, frequency and temperature, plus CPU temperature, from IOAccelerator, IOReport and the SMC. SMC sensor keys are found from the SMC's own key table, because the M1–M3 names don't all exist on M4, and parked cores read a 40.0 °C placeholder. That overlaps Add Apple Silicon sensor support (SMC, IOReport, AGX GPU) #977, so I've kept it out of Rev A: optional USB bulk transport to fix corrupted images on macOS #1138 and sent it separately as Python sensors: Apple Silicon CPU/GPU frequency, temperatures and macOS disk #1139.PR #1138 adds the USB bulk transport as
USB_BULKunderREVISION: A(defaultfalse;configure.py's revision map untouched), falling back to the serial port if the device can't be opened over USB. The serial 62-byte workaround from point 4 is left out to keep it small.