Dear Constumer,
You may warned by this thread potentially strengthen your thinking ability.
I love chinglish!
The screen control system to be 'tamed' is manufactured by a company called 'Linsn'. 'Linsn' produces the de facto standard hardware for chinese big-a*s LED screens (really big ones). I dug up some information about the system for you guys, so that you know what we're dealing with:
'The eighth generation [of the Linsn control system] is developed based on the seventh. Compared with the seventh, the eighth has all the functions of the seventh.'
So, yes... Essentially, it's all the same. Just different! 'Linsn -- think different, do the same'. Or whatever their slogan is.
As much as I love their ability to present new products, I desperatly need to find a solution to the following problem. Linsn kind of developed some software to control their LED system. It's Linsn, it's Windows, it's great! No. So I thought... Maybe I could reverse engineer the serial protocol to control our screens with my own software (or anything that won't crash every 2 hours giving you lots of '
?' with a frustrating 'OK' button).
HOWEVER, I never reverse engineered such a piece of kit, and I probably will never do it again. Anyway... I managed to capture some serial data to lear how the software controls the brightness. To get a better picture of how such a system works, take a look at this information I kindly provide for your enlightenment (or kindly skip this section if you're only interested in the serial data stuff... NERD!):
FUNFACT: What you are looking at is - you guessed right - a PCI card. Thing is... it's not PCI. It only draws power from the slot, you have to wire it up using loop cables!
Oh, and yes, you can power it with a 4-pin molex, which actually came in very handy by the time I discovered that the PC i bought for our next project had it's PCI port covered by the graphics card. Well done, chinese friends! The actual reason behind this weirdness is that Linsn sells a 'sending box' that contains exactly this card screwed into a metal box for customers that want to use a laptop, or no PC at all. Compared to the PCI card, the box has all the features of the PCI card. Only costs a lot more.
Anyway, this so called 'sending card' works as follows.... Get a device that provides DVI/HDMI digital video output (preferrably mirrored output) and hook it up to the board using a DVI connector on the Linsn side of things (dvi - hdmi - it's the same, just different). The card then grabs a piece of the input in the size of your LED screen like this:
Most big-ass screens have a very limited resolution, so most of the time it's a tiny window of like 240x180 up to 800x600. Fortunately (or maybe unfortunately) you can/have to specify the position of this windows using the Linsn software, ugh, and you can't resize/stretch/skew or something. The card then converts the DVI signal into some kind of unknown chinese noodle bit stream format and sends it through 1 or 2 of the 2 RJ45 connectors to your actual screen(s). You can send 2 different screen areas over those 2 connectors, or combine them for a higher resolution, but only configure the screens over the one labled 'D'. The other one is labled 'U', which most probably stands for 'useless'.
The screen itself typically consists of several elements (thats what we call them in germany, might be bad english), which are daisy-chained by standard cat5 network cables, each one containing a so called 'receiving card'. They grab a 'chunk' of the signal ('their' chunk of the screen area'), passively pass the full video signal to their own output and slap on a 'stamp', saying... 'FIRST!!!', kind of like in other forums. The second one then recognizes it and says 'SECOND!!!', and so on. So they actually 'know' what position in the singal line they're in, but only in a 1-dimensional sense. That's why you need the 'D' connector -- It is able to program the receiving cards with stuff like 'If you are first, display 64x64 px at 1x1, if you are second, show the chunk at 1x65', and so on.
The good thing is, once the data is pushed into the non-volatile memory (you have to 'save' manually after 'sending' the config data), you won't need the Linsn software again... Well, most the time. Because if you want to install those screens fixed on.. say a building, you want to control the brightness, contrast, etc.. to avoid astronomical eletrical bills. To give you a better idea of the costs: 1 'element' of a 1x1m P16 screen (16 mm pixel pitch) draws up to 1kw full white. That doesn't sound like much, but a rather small screen of 4x3 meters consists of 12 of those, and running for 16 hours a day, this adds up to typically 4kWh a month, which will cost you about EUR 1.000 (in germany). There are sensors available, but I really don't like those. They tend to over-dim or over-brighten the screen. So... I need to control the brightness with some custom software (or maybe even hardware) that runs on linux (or android, whatever). The 'sending card' connects to a PC via the USB connector, which is actually just a SL CP2102 UART-Bridge.
Besides the bad software, the Linsn
hardware proved to be pretty realiable and easy to repair. The solder jobs are decent (for a chinese product), they use generic chips you can get everywhere for cheap, and best of all... The nice Mrs. Sarah that kindly provides phone support to all international customers.
To my surprise, Mrs. Sarah is actually a guy that doen't speak english. The first time I called her I was so confused, I accidently ordered some fried noodles to go.
Alright, now that I wasted several hours of my valuable time, let's start with the 'fun' stuff!START 60%
W d8 58 80 ff 00 55 aa 55 aa 55 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 fa
R c5
R c3
W d8 58 80 ff 00 1e 00 22 00 02 00 00 00 00 00 00 00 99 99 99 ff 00 00 00 00 0b
d8 58 80 ff 00 1f 00 22 10 05 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59
d8 58 80 ff 00 18 00 22 20 00 00 00
W d8 58 80 ff 00 1e 00 22 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bf
d8 58 80 ff 00 1f 00 22 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d0
d8 58 80 ff 00 18 00 22 a0 00 00 00
R c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3
W d8 58 80 ff 00 56 aa 55 aa 00 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 a6
R c5
R c3
W d8 58 80 ff 00 57 aa 55 aa 55 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 fc
R c5
R c3
W d8 58 80 ff 00 18 00 22 00 02 00 00 00 00 00 00 00 99 99 99 ff 00 00 00 00 05
d8 58 80 ff 00 19 00 22 10 05 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53
d8 58 80 ff 00 1a 00 22 20 00 00 00
W d8 58 80 ff 00 18 00 22 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b9
d8 58 80 ff 00 19 00 22 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca
d8 58 80 ff 00 1a 00 22 a0 00 00 00
R c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3
W d8 58 80 ff 00 50 aa 55 aa 00 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 a0
R c5
R c3
W d8 58 80 ff 00 1a 00 22 00 02 00 00 00 00 00 00 00 99 99 99 ff 00 00 00 00 07
d8 58 80 ff 00 1b 00 22 10 05 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55
d8 58 80 ff 00 1c 00 22 20 00 00 00
W d8 58 80 ff 00 1a 00 22 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bb
d8 58 80 ff 00 1b 00 22 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 cc
d8 58 80 ff 00 1c 00 22 a0 00 00 00
R c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3 c5
R c3 c5
R c3
R c5
R c3 c5
R c3 c5
R c3
W d8 58 80 ff 00 52 aa 55 aa 00 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 a2
R c5
R c3
STOP
What you can see up there is the communication that takes place after setting the brightness to 60%. 'W' means that the software 'writes' to the card, 'R' that it receives/reads stuff. Every 'W' or 'R' indicates a new package. Appearently, the 'sending card' and PC don't do fancy hand-shaking stuff for this, you can just open the software, go to the brightness slider, plug it in, no comm taking place, and this pops up after setting it.
Let's go into some detail. As soon as you click and release the slider, the card always first sends data in the following flavour:
d8
58 80 ff 00 55 aa 55 aa
55 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8
faNow I don't know for sure - as I have zero exp with this stuff - but this it what I came up with as a newbie:
Green bytes: Those are some sort of instruction to write to a certain type of memory (there are several: DDRs, NVRAMs, EPROMs), and these exact ones are always sent when adjusting brightness, in every package.
Orange byte: Seems to indicate wether it wants to actually write data to this location or skip it.
Blue byte: Probably checksum/parity stuff.
Red bytes: Seems to be the location in the memory the instuction points to. Every time you adjust the brightness, no matter what percentage, it points to 6 different locations. I first thought... Well, this must be some simple shift register, converting the serial data into parallel output for the control circuit. BUT - maybe I just lack the needed experience - I don't really understand how this system works. There seems to be a pattern that doesn't make sense to me:
There are 8 different 'locations'. Every time you start the program, it always points to 57 first. Now the orange bytes tell me if the program will write more data at this point. It always writes to the first location. The card then replies with c5, then c3. After that, the actual data that contains the brightness level is sent (more on that later).
Take a look at the example above again. The orange bytes say '55', indicating that more data specific to this instruction will follow. If the orange bytes are set to '00', it skips to the next instruction after the generic reply from the sending card.
W d8 58 80 ff 00 56 aa 55 aa 00 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 a6
R c5
R c3
W d8 58 80 ff 00 57 aa 55 aa 55 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 d8 fc
R c5
R c3
W d8 58 80 ff 00 18 00 22 00 02 00 00 00 00 00 00 00 99 99 99 ff 00 00 00 00 05
d8 58 80 ff 00 19 00 22 10 05 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53
d8 58 80 ff 00 1a 00 22 20 00 00 00
W d8 58 80 ff 00 18 00 22 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b9
d8 58 80 ff 00 19 00 22 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca
d8 58 80 ff 00 1a 00 22 a0 00 00 00
In the first package sent, the orange bytes are 00, so the card replies as usual, program skips, then the next instruction in the same flavour follows. Only this time, the red bytes are increased by 1, and the orange is set to '55', and after the reply, data containing brightness follows.
Change brightness for the first time:
Red 57 + Orange 55 -> data follows
Red 50 + Orange 00 -> skip
Red 51 + Orange 55 -> data follows
Red 52 + Orange 00 -> skip
Red 53 + Orange 55 -> data follows
Red 54 + Orange 00 -> skip
Stop. Then if I change it again (or re-set to the same values once more):
Red 55 + Orange 55 -> data follows
Red 56 + Orange 00 -> skip
Red 57 + Orange 55 -> data follows
Red 50 + Orange 00 -> skip
Red 51 + Orange 55 -> data follows
Red 52 + Orange 00 -> skip
It cycles thru the total of 8 'locations', over and over again, and almost always only writes to the odd ones. In rare cases, it seems to mess up and start with even bytes, and only writes to those. I suspect that it may write to 1 location per LED color, and 1 extra per extra screen. So... Red, green, blue, 1 screen -> 3 of 6 writes. Red, green, blue, 2 screens (remember the 2 connectors) -> 6 of 6 writes, BUT i can't confirm this.
As I said, this doesn't make sense at all to me, because why whould it write the SAME value is just wrote seconds ago to a different location? Are these even locations? Why am I doing this stuff?!?!!!!
At this point, you probably know if you even want to continue reading this sort of crap.
There are more patterns and things I recognized.... But I'm really tired right know, and need a break. I will add more information as soon as I'm replenished with chineses crap energy. If you are interested in more of this stuff, or already know what I'm dealing with, need more information/logs, etc. -- Feel free to reply!
Also, if you got (kind of off-topic) questions regarding those big-ass screens or Linsn, or if you're just lonely... whatever... Please don't hesitate to ask/reply here too!
Cheers.