Generate radio coverage maps with SPLAT!

 Author:   Posted on:   Comments

SPLAT! is a cross-platform, open-source software that can be used to analyze a radio link between two locations and to generate coverage maps of RF transmitters. Coverage maps are calculated using Longley-Rice Irregular Terrain Model (ITM) algorithm. SPLAT! can predict RF coverage for any frequencies between 20 MHz and 20 GHz. It is thus useful for ham radio, broadcast radio, terrestrial television and wireless networks.

To use SPLAT!, you need to know some parameters of the transmitter. These are the exact location (coordinates), antenna height, transmission frequency, polarization and effective radiated power (ERP). SPLAT! can then compute coverage maps. The procedure of installing SPLAT! is described in a previous article. You can generate two kind of maps. There is the regional coverage analysis mode that will output line-of-sight coverage map assuming all waves propagate in a straight line. There is also the path loss analysis mode that uses the ITM algorithm to compute either a field strength map or a received signal strength map.

Install Sky Digital Key (AverMedia A867) on PC

 Author:   Posted on:   Comments
Sky Digital Key is an USB DVB-T tuner designed to be used with this provider's satellite receivers. There are two variants, one with green LED and the other with blue LED, the last being an AverMedia device with Maxlinear MxL5007T tuner and Afatech AF9035 USB demodulator.

The DVB-T key can be installed on PC too. However the driver installation is not quite straightforward. The device is a copy of AverMedia AverTV Volar HD Nano with two small differences: there is no remote control sensor on Sky key although the PCB has the pads for it and USB IDs are different for the two devices. This aspect makes drivers installation difficult.

This article will describe the installation procedure on Linux and Windows. The USB tuner can be used to receive DVB-T signals with BDA compatible software on Windows (such as ProgDVB) and Kaffeine on Linux.

Install Sky Digital Key (AverMedia A867) on PC
AverMedia A867 - Sky Digital Key

Show last updated date in Blogger posts

 Author:   Posted on:   Comments

Although this is not the kind of post for this blog, I decided to write about this because there are opinions saying it is impossible to show updated date in Blogger posts. Blogger offers support only for the date when a post is published. You can, of course, edit the post and change published date, but that is not what most people want.

The method that follows is completely automatic and it will print the last date when you used the post editor on the specific post. It makes use of data stored in blog feed, because, although there is no tag for updated date in Blogger (something similar to published date tag data:post.timestamp), the updated date is stored in your blog feed. I first noticed this when I registered my blog on Tapatalk and noticed that updated posts appeared on top of the list.

Show last updated date in Blogger posts

Remove non-latin fonts from Ubuntu

 Author:   Posted on:   Comments
The default Ubuntu installation comes with a lot of fonts. This is a good thing. Many of the latin have good support for Extended character sets. But no matter what locale and/or installation language you choose, Ubuntu will install by default some non-latin fonts for Japanese, Thai, Ethiopian, Myanmar, Lao, Tibetan, Korean, Punjabi, Sinhala, Arabic and Khmer languages.

I don't know whether these fonts are ever needed by the operating system (i.e. for the language choosing settings or for displaying some web pages) but as a latin alphabet user I don't need them and I didn't like the fact that they were cluttering my font selection dialog without being of any use to me. So I decided to uninstall them.

The list below is tested on Ubuntu 16.04. I managed to free about 100 MB by removing these fonts. And now, my font selection box (in LibreOffice, GIMP, Inkscape, etc.) is filled with latin only fonts that I can use. You can see in the screenshot below how it looks before and after removing the unneeded fonts.

Remove non-latin fonts from Ubuntu

Radio link analysis using SPLAT!

 Author:   Posted on:   Comments
SPLAT! is a cross-platform, open-source software that can be used to analyze a radio link between two locations and to generate coverage maps of RF transmitters. Coverage maps are calculated using Longley-Rice Irregular Terrain Model (ITM) algorithm. SPLAT! can predict RF coverage for any frequencies between 20 MHz and 20 GHz. It is thus useful for ham radio, broadcast radio, terrestrial television and wireless networks.

To use SPLAT!, you need to know some parameters of the transmitter. These are the exact location (coordinates), antenna height, transmission frequency, polarization and effective radiated power (ERP). SPLAT! can then calculate both path loss and received signal strength.

The procedure of installing SPLAT! is described in a previous article. The point-to-point analysis calculates some useful parameters like: azimuth and elevation of receiving antenna, distance to transmitter, mode of propagation, received signal strength and density. You must also supply a receiver parameters file to SPLAT!. This will contain the location, antenna height and some other terrain parameters. SPLAT! will generate a report and a graph if you have Gnuplot installed.

SPLAT! height profile graph
SPLAT! height profile graph

Compile and setup RF coverage prediction software SPLAT!

 Author:   Posted on:   Comments
SPLAT! is a cross-platform, open-source software that can be used to analyze a radio link between two locations and to generate coverage maps of RF transmitters. Coverage maps are calculated using Longley-Rice Irregular Terrain Model (ITM) algorithm. SPLAT! can predict RF coverage for any frequencies between 20 MHz and 20 GHz. It is thus useful for ham radio, broadcast radio, terrestrial television and wireless networks.

SPLAT! uses data from SRTM elevation files. Although it is cross-platform, up-to-date binaries for Windows are hard to find. On the other hand, for Linux users, it is available in the repositories of the major distributions. This post will show you how to compile SPLAT! on Windows and Linux, how to obtain and convert elevation data and at last how to generate point-to-point and coverage prediction analysis.

There are two variants of SPLAT! based on the type of elevation data they use. SRTM3 files are 90 meters resolution, 3 arc-sec files. These are the "standard definition" files suitable for SPLAT! And there are SRTM1, 30 meters resolution, 1 arc-sec files that are considered "high definition" and are suitable for SPLAT! HD. I recommend SRTM3 (SD) files because the results are very good and processing time is not too high.

SPLAT! line-of-sight coverage
SPLAT! line-of-sight coverage

A better way to power car audio in home

 Author:   Posted on:   Comments
Usually, car audio systems like CD player or cassette player have good audio amplifiers, with four channels (front L/R and rear L/R) of enough power for in home use. The radio tuner is also of high quality, with automatic best frequency selection and RDS information. Not all car audio systems have audio auxiliary inputs, although with a little tweaking, you can add audio line level inputs to a cassette player so you can use it as audio amplifier with any audio source.

There are plenty of how-to's about this subject online. Yet I couldn't find one that handles the memory loss problem. Car audios are designed to be continuously powered by the battery. Therefore, most don't have a permanent storage memory for settings. Upon disconnecting the power, the device loses all audio settings and stored radio stations.

This article will deal with the memory loss problem. Unless you will never unplug the DC adapter from the mains, you will need something similar to what follows if you want to use a car audio device in home. Let's start with the basics.

The proper way to power car audio in home - with backup battery

DC Motor Controller for PCB Drill

 Author:   Posted on:   Comments
This is a simple circuit that can be use to vary the speed of a DC motor. It is very useful for controlling a PCB drill, but it can be used for whatever applications you want. The speed can vary from full to complete stop. The circuit is versatile and can be used with motors of different currents and voltages.

This circuit is widespread on the internet. Here is an example. The PWM signal is generated by a 555 chip. The chip drives a MOS-FET transistor that will switch the motor on and off. The 555 is powered from a 7805 regulator. Therefore, the motor DC voltage can be between 8 and 35 V (the circuit can be powered by AC 7...26 V). The maximum current is limited by MOS-FET.

The circuit shown here is designed to be AC powered by a mains transformer. But you can power it from a DC adapter, battery or even a computer power supply if you remove the diode bridge and connect the power lines straight to ground and positive pads, where the output pins of the bridge would otherwise fit.

DC Motor Controller for PCB Drill 555

How to control the (BS2)S7VZ6306 tuner

 Author:   Posted on:   Comments
S7VZ6306 is a tuner I found in a Comag SL100 HD satellite receiver. A very useful thing is that the tuner is soldered onto a small board that is plugged into the main receiver board using a connector. So you can take it out easily to replace it or use it in a project. Information contained in this article applies to any satellite tuners that use IX2470 PLL circuit.

The tuner is half-NIM type (without included demodulator - the demodulator IC is on the main board). Although I could find no datasheet of the tuner, the manufacturer has written pin labels on the small PCB where the tuner is soldered. When opening it, I could find an IX2470 integrated circuit. No datasheet for this one either. Digging deeper, I found that this IC was used in some TBS PC tuner card and there are open source drivers for it. Pinout and software - that's all I needed to control the tuner outside of the original box.

How to control the (BS2)S7VZ6306 tuner

Install CadSoft EAGLE on Linux

 Author:   Posted on:   Comments
EAGLE is a complete EDA software with schematic capture and printed circuit board design. It has a free version that can be used for personal and non-commercial purposes to design circuit boards smaller than 100 x 80 mm and with no more than two copper layers. Another advantage of EAGLE is that it runs on all major operating systems.

The Linux version is supplied as an architecture dependent self extracting run archive. It can be installed on most distros by executing the downloaded file. There is however one small issue. The installer does not create a desktop entry for the main EAGLE executable. Therefore you have to navigate to the folder where it is installed each time you want to launch it.

Besides showing how to install it (on Ubuntu), this article will give you a simple desktop entry file that will bring a shortcut to EAGLE in your distro application menu. Note that you will have to change version numbers accordingly, because EAGLE is updated frequently.

Install CadSoft EAGLE on Linux

Install WinUSB on Ubuntu 16.04 LTS

 Author:   Posted on:   Comments

WinUSB is probably the only GUI tool that allows you to create bootable USB drives with Windows from Linux. It hasn't been updated for a long time and there are no packages for newer Ubuntu versions. Until the release of 16.04, WinUSB could be installed from existing DEB packages for previous Ubuntu releases. But things have changed with the update of wxWidgets to version 3.0 in the default repositories. WinUSB GUI depends on wxWidgets > 2.8.4 and all curent builds are based on 2.8 releases of the library.

Let's mention again that WinUSB can't make UEFI bootable drives! Only the old MBR type and only NTFS formatted.

This guide has also been tested on Ubuntu 16.10. If you're using an older version of Ubuntu you may get WinUSB working by following this guide. Otherwise, you need to compile it with wxWidgets 3.0. This article will describe the procedure plus the extra tweaks you must make to ensure WinUSB works as it should.

Install WinUSB in Ubuntu 16.04 LTS

How to build a simple soldering iron

 Author:   Posted on:   Comments
Although soldering irons are quite cheap, widely available and come in various shapes and sizes, here's the DIY way. This article will describe some simple to build soldering irons that can provide 15 - 30 W and are powered at low voltage (5 - 12 V, depending on heater wire you use). This means you can power it with any power supply that meets these requirements (a computer PSU will be a good choice). The project is simple: a heating resistor wounded over a copper tip is used to heat it. The main difficulty here is to find a thermoresistant insulator that can be rolled over the copper tip. I used some material found between power transistors and heatsinks.

There are two variants described. The difference between them is made by the method used to attach the copper rod to the handle.

DIY Soldering iron
DIY Soldering iron (variant 1)

Fix boot splash screen (Plymouth) on Ubuntu

 Author:   Posted on:   Comments
Plymouth is the Ubuntu application that displays the graphical splash screen when booting and shutting down the system[1]. It is long known that it has problems with proprietary Nvidia drivers. While on some computers it starts in low resolution mode, on others it works in text mode. It is claimed that this happens because Nvidia drivers load at a later point and are not available for GRUB and Plymouth[2]. Usually, Plymouth uses KMS (Kernel Mode Setting) to display graphics, but with proprietary drivers you must configure it to use framebuffer instead[3].

Fix boot splash screen (Plymouth) on Ubuntu

Debrick Huawei HG553 (BCM6358 based router)

 Author:   Posted on:   Comments

Huawei Echolife HG553 is an ADSL2+ modem with WiFi router which was used by some ISP companies in Italy and Spain. The device features a Broadcom BCM6358 dual core processor clocked at 300 MHz with 64 MB RAM. The operating system is stored in a 16 MB flash memory.

The original firmware doesn't offer too many options, but there are alternate firmwares, including OpenWrt which turns this router into a highly configurable network device. If you want to use it for ADSL line, Roleo firmware (D-Link based) is the best choice. For all the other things, OpenWrt remains the best option.

Unlocking and firmware installation procedures are described in various sites. One example is OpenWrt dedicated wiki page for HG553. This post will describe the ultimate debricking procedure: writing bootloader via JTAG. After an unsuccessful firmware update and a forced restart, my router became completely unresponsive. Neither the power LED was on when powered. Reset, Failsafe mode, Telnet for this device didn't exist anymore. In this cases, there is only one solution left: JTAG.

Debrick Huawei HG553 (BCM6358 based router)

Huawei HG553 main board

JTAG is an interface that allows direct read/write operations on flash memory. Since the router didn't even enter failsafe mode (by holding Reset button and powering up), the most probable cause is a corrupt bootloader. Here is the complete step-by-step guide to debrick this router by rewriting the CFE bootloader. After this procedure you will be able to install compatible firmwares by accessing http://192.168.1.1 after you powered up the router with Reset button pressed.

1. Prepare CFE

CFE (Common Firmware Environment) is the bootloader used by Broadcom chips, including this one. You can get an unlocked CFE from here. Download that archive and you should find a cfe.bin file inside. You must open it with a hex editor (I like HxD; can be used in Linux with Wine). The first 256 bytes (from 0x00 to 0xFF) represent a header that doesn't belong in flash memory. It contains some metadata regarding the CFE (size, CRC32). It is not needed, so go ahead and delete the first 256 bytes and save the file.

Delete 256 bytes from bootloader CFE

Delete the CFE header

The remaining section must start with 0x10000279. If you find this difficult, get here a headerless CFE, ready for burning to flash. Now you can skip to part 2.

Huawei HG553 doesn't care if the bootloader MAC and SN don't match hardware ones. If you want, however, to customize CFE with the MAC address and Serial Number from the back label of your device keep reading here. This information is stored inside NVRAM section. The NVRAM section starts at offset 0x580 (or 0x680 with header). OpenWrt Wiki has a CFE page with more information about this kind of bootloader.

NVRAM MAC address and serial number HG553

NVRAM MAC address and serial number

Go ahead and edit MAC address (red marked block) in hex mode (on the left column) and serial number on the right column. These are printed on the back label of the router. Edit also the CRC32 (yellow) in hex mode and make it 0x00000000 (put only zeroes in there).

Router MAC and SN on the back label

Router MAC and SN on the back label

Click and drag to select that marked block of data (everything in green and yellow, including also bytes you modified) - from 0x580 to 0x6CB (or 0x680 to 0x7CB with header in place), a total of 332 bytes. Save this as a new file. You must calculate CRC32 and put it at offset 0x6C8 (0x7C8).

The CRC32 routine is the exact crc32_le() function from Linux kernel. Here is the C source code:

uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len)
{ 
  int i;
        while (len--) {
                crc ^= *p++;
                for (i = 0; i < 8; i++)
                        crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
        }
        return crc;  
}

Download here a small program that calculates CRC32 of a file. You will find there a Windows 32 bit executable and source code for all platforms.

Run that program passing as argument the 332 bytes file you created earlier from NVRAM. It will print the CRC32 of that file as, for example: 0x889e0d5. Write your result (i.e. 889E0D5) into the yellow marked block in NVRAM - yes, the one that you zeroed before. Save the CFE file. Now it's ready for burning to flash.

2. JTAG Cable

You can use any JTAG adapter you want. The simplest to make is EA253 or DLC5 parallel cable. Below is the schematic and board connection information. The pads for JTAG are on the other side of the board than the one you see in the first image in this post.

EA253 / DLC5 parallel unbuffered JTAG interface HG553

EA253 / DLC5 parallel unbuffered JTAG interface

The cable length should be as short as possible. Connect it to computer and power on the router the usual way.

3. JTAG Software

I used with success the free cross-platform UrJTAG software. I could only make it work on Windows though. The procedure is simple:

  1. Set adapter type: cable EA253 parallel 0x378 or cable DLC5 parallel 0x378.
  2. Detect CPU: detect.
  3. Display system information: print.
  4. Detect Flash: detect flash <address>. HG553 uses a Spansion S29GL128N10TF101 chip.
  5. Write flash: flashmem <offset> cfe.bin.

Launch JTAG Shell or jtag executable as administrator. Here are all commands:

UrJTAG 0.10 #1502
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

WARNING: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable ea253 parallel 0x378
Initializing parallel port at 0x378
jtag> detect
IR length: 5
Chain length: 1
Device Id: 00000110001101011000000101111111 (0x000000000635817F)
  Manufacturer: Broadcom
  Part(0):         BCM6358
  Stepping:     V1
  Filename:     c:\program files\urjtag\data/broadcom/bcm6358/bcm6358
ImpCode=00000000100000011000100100000100
EJTAG version: <= 2.0
EJTAG Implementation flags: R4k MIPS16 DMA MIPS32
Clear memory protection bit in DCR
Clear Watchdog
Potential flash base address: [0x0], [0x1f00008c]
Processor successfully switched in debug mode.
jtag> print
(140) String conversion failed!
 No.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
   0 Broadcom                  BCM6358              V1       EJTAG_CONTROL        EJCONTROL

Active bus:
*0: EJTAG compatible bus driver via DMA (JTAG part No. 0)
        start: 0x00000000, length: 0x1E000000, data width: 32 bit, (USEG : User addresses)
        start: 0x1E000000, length: 0x02000000, data width: 16 bit, (FLASH : Addresses in flash (boot=0x1FC000000))
        start: 0x20000000, length: 0x60000000, data width: 32 bit, (USEG : User addresses)
        start: 0x80000000, length: 0x20000000, data width: 32 bit, (KSEG0: Kernel Unmapped Cached)
        start: 0xA0000000, length: 0x20000000, data width: 32 bit, (KSEG1: Kernel Unmapped Uncached)
        start: 0xC0000000, length: 0x20000000, data width: 32 bit, (SSEG : Supervisor Mapped)
        start: 0xE0000000, length: 0x20000000, data width: 32 bit, (KSEG3: Kernel Mapped)
jtag> detectflash 0x1e000000
Query identification string:
        Primary Algorithm Command Set and Control Interface ID Code: 0x0002 (AMD/Fujitsu Standard Command Set)
        Alternate Algorithm Command Set and Control Interface ID Code: 0x0000 (null)
Query system interface information:
        Vcc Logic Supply Minimum Write/Erase or Write voltage: 2700 mV
        Vcc Logic Supply Maximum Write/Erase or Write voltage: 3600 mV
        Vpp [Programming] Supply Minimum Write/Erase voltage: 0 mV
        Vpp [Programming] Supply Maximum Write/Erase voltage: 0 mV
        Typical timeout per single byte/word program: 128 us
        Typical timeout for maximum-size multi-byte program: 128 us
        Typical timeout per individual block erase: 1024 ms
        Typical timeout for full chip erase: 0 ms
        Maximum timeout for byte/word program: 1024 us
        Maximum timeout for multi-byte program: 4096 us
        Maximum timeout per individual block erase: 16384 ms
        Maximum timeout for chip erase: 0 ms
Device geometry definition:
        Device Size: 16777216 B (16384 KiB, 16 MiB)
        Flash Device Interface Code description: 0x0002 (x8/x16)
        Maximum number of bytes in multi-byte program: 32
        Number of Erase Block Regions within device: 1
        Erase Block Region Information:
                Region 0:
                        Erase Block Size: 131072 B (128 KiB)
                        Number of Erase Blocks: 128
Primary Vendor-Specific Extended Query:
        Major version number: 1
        Minor version number: 3
        Address Sensitive Unlock: Required
        Process Technology: Bad value
        Erase Suspend: Read/write
        Sector Protect: 1 sectors per group
        Sector Temporary Unprotect: Supported
        Sector Protect/Unprotect Scheme: Bad value
        Simultaneous Operation: Not supported
        Burst Mode Type: Supported
        Page Mode Type: 8 word Page
        ACC (Acceleration) Supply Minimum: 11500 mV
        ACC (Acceleration) Supply Maximum: 12500 mV
        Top/Bottom Sector Flag: Uniform top boot device
        Program Suspend: Not supported
jtag> flashmem 0x1e000000 c:\cfe.bin noverify
Chip: AMD Flash
        Manufacturer: AMD
        Chip: S92GLxxxN
        Protected: 0000
program:
flash_unlock_block 0x1E000000 IGNORE

block 0 unlocked
flash_erase_block 0x1E000000
flash_erase_block 0x1E000000 DONE
erasing block 0: 0
addr: 0x1E01FFFE
verify skipped

In the print command output, we can see that flash starts at 0x1E000000. We can use this address to check flash type: detectflash 0x1E000000. Before writing CFE I read some data blocks from flash to see where exactly the CFE is located. And it started directly at flash address. So, launch this command: flashmem 0x1E000000 <cfe.bin_path>. The noverify argument is optional.

If flashing fails or doesn't finish (Flash error), check cable, try a shorter one or build a higher quality supported adapter. You could also alter (lower) JTAG clock frequency (frequency <value>, where value represents frequency in Hz). I got better results with EA253 mode instead of DLC5 using the same cable.

After a successful write, quit UrJTAG and reboot the router. The power LED should be on after a few seconds. You can now access the bootloader and install a firmware.

Simple DiSEqC monitor and signal analyzer

 Author:   Posted on:   Comments
DiSEqC™ is a protocol developed by Eutelsat. It is widely used in satellite receiving equipment to control devices over the same coaxial cable that carries RF signal. DiSEqC can be used to select a local oscillator of the LNB, to operate a LNB switch or to point a motorized dish.

But when a device communication fault arises, the source of the problem may be difficult to find. The coaxial cable that goes from receiver to accessories and finally to LNB carries multiple signals: the radio frequency signal from LNB to receiver, the power voltage from receiver to connected devices and LNB and the DiSEqC signal. Faults can be caused by receiver, cable, accessories (switch, positioner, motor) or LNB.

The simple computer adapter that will be described allows you to view and analyze DiSEqC waveform using the soundcard input and Audacity software. This is possible because the protocol is modulated over a 22 kHz carrier. The same carrier (when sent continuously, at a smaller amplitude) tells the LNB to switch on the high local oscillator.

Simple DiSEqC monitor and signal analyzer

6 PDF page cropping tools for Linux

 Author:   Posted on:   Comments
If you ever needed to crop pages of a PDF document and you are using a Linux computer here are six tools that can help you. All are native Linux applications, some are opensource, but most important all are free.

I looked for the following features at these applications: the ability to select only a subset of pages from the document to crop, different crop boxes for each page and the way of selecting crop box (automatically, WYSIWYG or by measurement units).

Here are the six Linux applications that will help you when you need to crop a PDF. This is just a list, not a ranking.

6 PDF page cropping tools for Linux