Mittwoch, 1. Mai 2013

Paint to nowhere - an approach to simulating a VGA Display

This time, a non-Ham thing.

Please keep in mind that I can take no responsibility for errors on this page or damage, the instructions on this page might cause. The information is provided without warranty - but I promise that its to my best knowledge. If you have suggestions or questions - feel free to contact me. I hope it helps.

I was challenged with the following problem some days ago at my working place: 

There is a Terminal Server System that needs to serve different sessions with different screen resolutions. That is usually not a big deal with homogeneous environments like Windows' RDP on Windows Clients or Apples ADP on Apple Clients - it can get tricky though when using an Apple Server with Linux/Windows Clients (because people are avoiding OS X here a lot and want to use Linux more often). 

Apple does to my knowledge not provide ADP Clients for Platforms other than OS X (just mentioning that Microsoft provides a pretty nice RDP Client for OS X). So if you want to work remotely with multiple persons on the same Mac, you are stuck with third party software that provides virtual desktop access with a protocol other than ADP. There are some out there and all have some flaws. The best matching solution for us was iRAPP TS (here) which shares a flaw with most other solutions: It can - as far as our experience went - not provide virtual desktops with arbitrary screen resolutions, but only with resolutions, that are supported by an attached physical screen. Thats bad.

Many Users of this solutions have wide 21" Displays, many others have 4:3 20" high resolution displays - both are quite expensive, so attaching a blind real display to the terminal server is not the preferred option: building a virtual Monitor out of what is lying around in the drawer is. 

I chose using VGA, because its very well adaptable to any current display connection and connectors are easily availble. With DVI, this is not the case, with HDMI, they are quite expensive and additionally, they are quite hard to solder. To sum it up: the same rules apply to VGA, DVI and HDMI - but NOT to DisplayPort. 

So to the shopping list we add 1 VGA connector and casing - choose a gender you like. 

In connection with this approach, 3 main questions arose. 

  1. What, from the point of view of a general VGA-Port, defines an attached display? 
  2. How to trick the VGA-Port into thinking, there was a Display attached?
  3. How to trick the VGA-Port into detecting a proper Model that supports the right resolutions?

To answer the first question, I dug deep in my memories of former similar projects. When I was fiddling with VGA. I remembered, that there was a loop somewhere in the connection, that was established when the VGA Cable was connected to the graphics card - but I found out that this memory was quite misleading:

Most VGA Ports detect a Monitor by looking at the actual signal output pins. These are usually broadband HF lines with a specific impedance (75 ohm for the three color signals, around 700 ohm for the two synchronisation signals). The logic behind the port can detect the state of the lines, wether they are floating (not connected) or properly terminated (connected) and probably some other states as well. Most ports seem to look at the state of the "green" line, to detect a connected display.
This might be, because the older monochrome displays of the earlier days often only had the green line connected. The green line was favored in some other cases, too. The most prominent one is "Sync on green", which was popular with individually connected BNC displays, although I never really understood, why the extra line was such a problem. 

Concerning question two: Although it would probably be enough just to terminate the green line with about 75ohm, I concluded the answer to this question to be proper termination of all HF lines. I don't like floating signals, especially in HF environments. Everything is an antenna - and yet again, I don't know the specific layout of the output drivers. They might dislike floating lines, too. 

So to the shopping list we add 3x 82ohm (and optionally 2x 680 ohm) medium precision resistors

If you just want an attached display to be (falsely) detected, you are done with your simulator now. Here, one of the differences between DVI/HDMI and VGA is worth noting: They do not sample the signal lines to detect an attached display, but have a seperate hot-plug pin, that has to be pulled high (to DDC VCC for example) using a resistor. If you want a display with specific properties to be detected, you have to get digital - and answer question three.

How does a VGA-Port talk to the display to find out what it is capable of? Which protocol is used? Is there a standard? The answers are EDID (Extended Display Identification Data) and DDC2 (Display Data Channel version 2). DDC2 is the protocol and method, EDID the data transfered. both are explained in the Wikipedia in detail. 

Source: Wikipedia


The most important thing about DDC2 to know is, that its actually an I2C bus on the VGA port, getting the EDID from a industry standard 1kBit I2C EEPROM at address 80 (0x50) - usually this chip is write protected - and thats a good thing in most cases. All lines necessary to read the EEPROM are present on the VGA connector. These are VCC (5v pin9), GND (pin5 or pin10, documentations vary), SDA (I2C data, pin 12) and SCL (I2C clock, pin 15). That is convenient for two things: 
  • We don't need any external wiring - everything we need is already on the connector
  • In case of a normal display, detection is possible in the moment of connecting it. No external power is required on the display side - the I2C EEPROM does not have to be connected to the displays circuits.
The most important thing about EDID to know is, that is a pretty well defined bit-mapped 128byte data structure, that does not only contain Model number, serial and manufacturing date of the display, but also supported modes and nowadays also native resolutions of TFT-displays and preferred resolutions. Its format according to version 1.3 is what we want to focus on and is also very well explained in the linked Wikipedia article. It does support everything, a virtual display will need. 

At this point, several other question arise: 
  • Where to get valid EDID to program into the display?
  • How to get the EDID onto a chip?
  • How to make modifications to that data?
The first one is easy to answer, if you have a original display that suits your needs, a newer Intel Graphics Adapter and a reasonably new Linux operating system. Since the Linux Intel Kernel Module - at least for i915 and newer - exports the I2C-buses from the connectors (VGA, DVI, HDMI) to the Linux kernel and that way is a quite available and easy-to-access multi I2C bus master. This has come in quite handy for many small projects I have built :). Other graphics boards (some ATI, probably others) do the same thing, but I will stick with the Intel explanation, because I have it in my notebook.

You need the i915 kernel module (or which ever works for you) that talks to the graphics card as well as the i2c-dev kernel module, that provides device access to the I2C buses. The I2C-tools come in handy to find the right bus, because modern graphics cards will export a terrifying number of buses to the kernel - most of them are not working or not for us to fiddle with. For my notebooks graphics adapter its 7 buses. Only 2 of them are usable - the one for the VGA Port and - what surprised me a little - the one for the internal LCD-panel.

Connect the display, you want to clone the data from to your VGA-Port or whichever port you have chosen. Use

i2cdetect -l

to list the available buses. Choose one you like, then try

i2cdetect <busid>

to scan it. If device 0x50 shows up, you might be in luck.

I hacked together a small script, that eases the steps to answer questions 1 and 2 a little. It reads all data from 0x50 on a specific bus into a file or writes data from a file into that device. It can also dump a file and analyze its contents, which might also help with question 3.

Find that tool here:


Its a python script that uses python-smbus and some pretty standard libraries to work on the chip. While I am writing this, I change the script pretty much every minute, but I promise: reading and writing a chip works. There is also some detailed EDID dumps, that you can use to find out, what information is in the EDID structure. To read data into a file, use the following command - assuming, your bus is "2":

./EDID_manager.py read 2 eeprom.bin

which will read the EEPROM contents into the file eeprom.bin

There goes question one. Question two needs your dummy plug to get detected. Then its a simple

./EDID_manager.py write 2 eeprom.bin

and you have a copy of your monitor. You can play around with the "dump" and "ranges" commands of the script a little bit. They give some insight into the data structure of the EEPROM. For that you have to have compatible I2C EEPROM that can be wired to work on address 0x50. So put for example a AT24C02 on your shopping list and wire it up.

Let's postpone question three a little while and sum up what we found out so far:

  1. Regarding VGA, we need to terminate at least the Green analogue line with a little more than 75 Ohm to get our plug detected.
  2. The detection of monitor capabilities is done using an I2C EEPROM on the VGA display side
  3. The EEPROM contains a 128-256Byte data structure we need to copy
That is only 3 steps to clone your display - and you got all the tools. So get cracking!

But to get back to question 3: How to modify the data? Basically all you need is a hex editor and some knowledge of the data structure - and the documentation in the Wikipedia helps a lot. But there are some caveats and they stink:
  1. Some Information is redundant in the EDID - for example the display size, timing information, sync types and some other things you may stumble across. Make them match each other (at least nearly).
  2. Some Information you can put in there can describe physically impossible scenarios. Try not to do that. Read some additionals about timing of analog RGB signals. Keep in Mind things like horizontal / vertical blanking, the pixel clock and their relations. This is especially the case, if you don't want a dummy plug, but for example want to build an adapter, that attaches to an actual display that has no DDC yet (I still have some of these). If you screw things up really bad, you might break a trusty CRT. 
  3. Do not mix dumps of digital displays with analog ports. It might not hurt, but it also might as well. There are some interface specific data fields that describe the interface. These have different meanings for digital or analog interfaces - for example the information about the level of the RGB-Outputs is sitting in 2 bits that are reserved on digital interfaces. Anything could happen.
  4. Try to verify the structure (you may use my tool, you may use any other - I had a lot of fun building it, you might as well have a lot of fun using it.) before using it on actual hardware. The parsers and verifiers are not perfect, but may help to determine faulty data in your file.
  5. Graphics adapters are a real pain in the b*** when it comes to verbosity. They might silently reject the information in the EDID or parts of that. It might also get overridden by software. For fixes and preventive measures: read point 4 again and think it over. :)
A favor I ask - Please, if you dump the EEPROM of your monitor, send it to me, together with make and model of the display it belongs to. It might help me to understand the data structures better and improve the tool. Thank you very much.

Drop me a message, if you have a pull request, dump from your display or a question.
You may use this blog's comment function or send me an email: sua-edid-32b37f1c at w2o.jjim.de


Montag, 4. März 2013

Earlier I mentioned the bad SRH805S Clone from China, that was no good in any kind. Yesterday I forced it open and wanted to share the pictures of the inside with you:

Device consists of a single coil aroud a PVC-stem


The coil is screwed into the SMA-f connector directly
The coil has a diameter od 9mm and a total of 7 turns. I'd really like to measure, if there is ANY resonant frequency, but I still can not afford the equipment. :/

Anyway: This antenna is no good on no VHF/UHF Ham Band in Germany ;).

Freitag, 8. April 2011

SOTA - Go tell it on the mountains

Not very long ago I noticed, that the german DM branch of the SOTA project has 2 summits very near of where I live. These exist for quite some time, but I was not paying attention to SOTA at all for many years - I was not even aware, it existed, to be honest. Last weekend, me and my girlfriend where trying to get outside and I could convince her to visit one of the summits. I was not going to activate it, but instead look, if there was a decent place to try an activation from. I have visited this summit before (DM/NW-003) and it has a beautiful look over the Rhine area.

Tiny panorama view from the DM/NW-003 summit
On the top of the so called Ölberg, there is a small restaurant and on the top of that, the antenna of DB0SG, a local 70cm repeater. Usually from there I try to work DB0FT, a 2m repeater about 120km south of the Ölberg. I always think of it as a challenge, to turn down the transmit power as low as possible and still get reasonable reports. Sadly, I reached the repeater very well with 50mW and my NA-701 whip using the Kenwood TH-F7, but my CQ calls were left unanswered. ... Still remaining: A bunch of beautiful pictures that we took and that panorama picture.

Tiny panorama view from the DM/NW-001 summit
In the summer, I will revisit and activate that summit as well as DM/NW-001 on 2m as my start in the SOTA program. I am looking forward to that!

73 de DO5GBN

How about low budget QRV? Part 1 - The Candidates

Since I own a amateur radio license, I carefully watch auctions on ebay on that topic. Usually I am very excited about portable transceivers. This way, I could already equip some friends to enter the ham world.


The last 18 months, the number of auctions listed got much bigger. Endless listings of items, originating from china appeared, prominent names being Wouxun, Puxing, Linton, NKT, JMT, Weierwel. For many of these items, descriptions and other information was very hard to find on the internet, if there was any. The price of these new items and accessories was – including handling and shipping from china – much less than those for used transceivers of well known manufacturers here.

My own first appearance in the VHF/UHF world was made using a modified C5 – an old portable mobile phone by Siemens, which gave me 15W on 70cm. This item – modified and many years old – back them would cost me much more than the current price of new chinese handheld transceivers – which are in fact much more portable and feature rich. A delightful shot on ebay later gave me a Kenwood TH-F7E, a well known portable dual band (2m/70cm) transceiver.

Some months ago, I thought about these chinese devices again and was thinking: “Its about time ti try those”. I searched the net and some portals about the Wouxun KG-UV2D, a dual-band transceiver that was available locally already. I also talked about this device to some OMs nearby. This device was just released to the market and the successor of the KG-UV1D, which some of these people I talked to owned. The retail price in the shops was about 110 Euro, 95 Euro on ebay. The fact that this transceiver should be much cheaper than my fellow companion by Kenwood rankled me somehow and I wondered if there would be a hitch.

The OMs I talked to differed about the device. Some said, there was potential in these devices and there were quite usable, some said, these devices were of very inferior quality. Some reasons many had in common were crappy modulation, instable frequencies, wrong information about the technical data by the manufacturer and out of band (and out of regulation) side transmissions. The latter I could neither verify nor disprove, because I lack the equiptment. To all the others I want to state my opinion in the next weeks.

After some QSOs with some people, who were working with the KG-UV2D (or the earlier KG-UVD1) I noticed that modulation and signal sounded both just fine. I could not receive any distorsion on the neighbouring channels either. I figured it would not hurt to try some of the devices at least, offered on ebay and test them properly. For that I decided to define a budget, equal to the price I paid for the used Kenwood-HT (which was about 150 Euros). That should – if possible – leave me with at least 3 handheld transceivers to test.

I decided for the following three devices, with either already have arrived or are on their way from china:
  • UHF/VHF fully featured Transceiver: Wouxun KG-UV2D for 80€
  • VHF minimalistic Transceiver:  Jin Ma Tong JMT-228 for 45€ (no info from the manufacturer – Unboxing and Test by G4ILO)
  • UHF minimalistic Transceiver: NKT NKT-R3 for 25€ (Thanks to M0JMO via G4ILO)
In my tests, I will focus on the functions, accessories, mechanical and electrical quality, performance and correctness of manufacturer facts (as far as possible).

SRH805S, SRH805S or even SCH-32? Part 1 - Arrival of the Candidates

When it comes to HT antennas, there are plenty of fish in the sea. For portable outdoor, I mostly stick with my Nagoya NA-701 Whip antenna. Its cheap, it performs well enough to work the repeaters I usually have to work and it performs well better to monitor Freenet/PMR466 frequencies while for example out geocaching. But where to put the HT and the antenna? I have never seen a reasonably used HT rubber whip that was not bent quite much to some direction because of keeping the HT in the jacket. This will in most cases not hurt the antenna itself, but since most HTs use rather sensitive SMA connectors, the mechanical influence, the bent antenna tells us about, ends up in the HTs antenna jack and may sooner or later lead to damage. The most common HTs all have the jack screwed tightly to the case or shielding, so damage might not be the first to happen, but well... this all leads to me not being comfortable, carrying my HT with that whip in the pocket.

Long story short, I was looking for an antenna that was short and working in the cases I needed it to work:
  • Portable near field simplex (on field days, expeditions etc., 70cm and 2m)
  • Repeater work (70cm as well as 2m)
 My search at local dealers and web shops yielded only one reasonable result: The Diamond SRH805S (SMA) (manufacturer page, scroll down a bit). This about 5cm long antenna by one of the leading mobile/portable whip antenna manufacturers is - according to the specs - designed to transmit in the 23cm/70cm/2m ham bands with an unknown gain on my 2 bands (70cm/2m), 2.15dB on 23cm (which I am not allowed to operate) and additionally receive well around 150/300/450/800/900MHz. This tiny 1/4wave antenna is in the shops for about 15€ to about 25€. Compared to the 7€ to 10€ for the NA-701, this is quite some money. Anyway I took the risk and ordered one at funkkeller-weissach.de for about 20€.

When the package arrived, I was very surprised by the actual size of the Antenna:

No lie - 4.5cm
Diamond SRH805S - Some figures:

Length/diameter: 44mm / 13mm
Connector: SMA Male
RX: 144/150/300/430/450/800/900MHz
TX: 144/430/1200MHz
Max TX Power: 10W
Type: 1/4λ
Price: 15€ to 25€

Compared to my HT, the Antenna is just tiny and looking at that, I could not imagine, how the not so well known SRH1 (2.5cm length, 2m single band tx) would look like. The also quite small TH-F7 Transceiver was  looking even more portable, with that antenna on it. I really liked the look and feel of the antenna.
The antenna was shipped with a rubber spacer for HTs with quite long SMA connectors, so that the antenna body would rest on the HTs case and dampen the pressure on the delicate connector. I didn't need to use that on the TH-F7, on the Wouxun KG-UV2D with the SMA gender changer screwed in instead, it proved really useful.
I was wondering, how they would build a 1/4 wave resonant antenna and found a nice picture on google images, explaining the matter... I am not very comfortable with posting it here, but I didn't find the original source online. It shows the original construction of the antenna:

Correct me, but it looks like a coil of about 23cm of wire, center connected capacitor
The picture explained the springy noise, the antenna produces, it you bump it. I was wondering, if an antenna of that size could perform on 2m at all. Thinking about the SRH1 - well, its 2.5cm for 2m - I thought I could give it a try later.

Hence possessing a Wouxun KG-UV2D as a second hand and secondary unit, I was looking for a similar antenna for that device. The unit bears the burden of a male SMA "sink" on the HT side, so one is olways "adapting" around. On ebay, the SRH805S is often sold with a male SMA connector, which according to the Diamond web site is not right. Item names do often not state the name of the antenna sold, but the pictures most often reveal a terrible try of a fake. Since most of the offers in ebay were shipping from Hong Kong or China, I just assumed a rip-off of the original SRH805S. I asked one of the sellers and he confirmed, that what he was selling was not the real deal (Diamond quality hardware) but a reproduction by a chinese factory. Since the price was in the range of my NA-701, I thought, I could give it a try anyway and ordered.

There is nothing to say about the real technical data of this antenna, because all was copied from different sources about the original SRH805S. Since I do not trust these values, when it comes to this copy, not much is said about technical data here, until a measuring device is acquired.


Chinese fake SRH805S - Some figures:

Length/diameter: 55mm / 13mm
Connector: SMA Female
Price: about 5€-8€

The Item arrived 17 days later from Hong Kong and was also packed in one of these yellow plastic pouches we all know. The pouch itself already was of a really poor quality compared to Diamond or Nagoya pouches... well... that does not say anything about the antenna performance, but it tells a lot, anyway.

Bigger antenna, smaller pouch
That factory in Hong Kong did not mind to fake the original diamond packaging to the letter - even if smaller and in a poor quality. The Diamond logo on the pouch is very similar to the original. When I took the antenna out of the pouch, I was somehow surprised, that the copy job of the antenna inscriptions was not that sophisticated. The manufacturer did not bother the customer noticing the scam, once beyond the quite convincing packaging.

Top: fake - Bottom: the real deal

Top: the real Diamond - Bottom: poorly faked copy
The copy was not only larger, it was also manufactured in a much less deliberate way. Not only was the copy some grams lighter, it also produced some noises while shaking and gave a much poorer haptic experience. In expectation of some measuring equipment, I was hoping to find out, how useful this one could be anyway later.

When I wanted to order another NA-701 at the Thiecom shop, I ran across another tiny multi band antenna, I until then had not heard a single word of - the Hoxin SCH-32. This antenna has a quite odd combination of transmit frequencies, it claims to be designed for: 144Mhz, 430Mhz, 900Mhz - the latter to my knowledge is not a ham band anywhere in the world. Since I was only keen on the first two bands, I was thinking about ordering one of these, too. The price was about 10€, which was only a little bit more than the SRH805S copy would cost, so I ordered and got one some days later.

even smaller than the SRH805S: the Hoxin SCH-32

Hoxin SCH-32 - Some figures:

Length/diameter: 39mm / 14mm
Connector: SMA Male
RX: 144/430/900MHz
TX: 144/430/900MHz
Max TX Power: 10W
Type: 1/4λ
Price: ~10€

To be honest, neither I had heared about Hoxin before, nor did I find some clues about the Antenna online. I doubt, SCH-32 is the only market name of this antenna. Its build quality is quite high despite the price. Its SMA connector looks a lot like the Nagoya NA-701 one and I would not be surprised, if the actual manufacturer was in fact the same.

I am right now still very excited about testing these antennas in the field and in the lab. After some quick tests with the local repeater all three have the potential of surprising me on 70cm - on 2m they all failed me until now. I will retry this from a different spot sometime. 

My hopes and cheers are right now with the Hoxin SCH-32, because it is well made, small(est of all three) and compared to other tiny antennas, its quite affordable as a stand by option, if the HT has to be as small as possible. 

ltr: Hoxin SCH-32 / Diamond SRH805S / Chinese SRH805S copy (SMA female)
Stay tuned for some hard facts from the field.