Comparison of Logic Analyzers

Logic Analyzers

Posted in Miscellaneous

Folders consuming most disk space using du

du is available natively on almost all Linux distributions, and on Mac OS X. If you are in need of reclaiming disk space, and want to quickly find which folders to focus your attention on, run the following command

du -h -d 1

That will quickly list all the folders under the current folder and their disk space usage. Use the following command to check space left on each disk

df -h
Posted in Linux, OS X

Physical serial port redirection

I have previously posted about Virtual serial port redirection on Windows, to test applications that use serial ports. I’ve found the available drivers increasingly buggy on Windows 8.1. This post shows how you can wire two USB-Serial cables to achieve the same objective.

Serial Port Redirection

You’ll need two USB-Serial cables such as USB to TTL Serial Cable for Raspberry Pi from Adafruit or several similar ones from Amazon. Wire the cables so that the ground wires are connected, and receive wire of one cable is connected to the transmit of another and vice-versa. Plug the cables in and install the appropriate drivers. Windows usually works with FTDI chipset based cables without requiring installation of drivers.

Now, you should see two serial ports, which redirect data to each other.

Posted in Hardware

Virtual serial port redirection using socat

Here’s how socat can be used to redirect one serial port to another on Ubuntu

sudo socat -d -d pty,link=/dev/ttyS0,raw,echo=0 pty,link=/dev/ttyS1,raw,echo=0

Assuming both serial devices above are not assigned to a real device. If the above command is successful, you can send data from on serial port to another using a terminal emulator such as screen

screen /dev/ttyS0 115200

Install screen using sudo apt-get screen if not already installed. Repeat the above command on another prompt for the other serial device, and you’re good to go. Quit screen using Ctrl-A \.

socat can also be used to perform serial to TCP redirection

sudo socat -d -d pty,link=/dev/ttyS0,raw,echo=0 tcp-listen:8000

Now, you should be able to use screen to send and receive data on the serial port, while you use something like netcat to receive and send data to the serial port

netcat 8000
Posted in Linux

Enable Ubuntu Unity

I have been having problems using Ubuntu Unity on my Parallels VM, that I was finally able to resolve with help from the Ubuntu forums. It turns out Ubuntu Unity Plugins was disabled for some reason. Use the following sequence of commands to run CompizConfig Settings Manager.

sudo apt-get install compizconfig-settings-manager
export DISPLAY=:0

Select Ubuntu Unity Plugin. Check Enable Ubuntu Unity Plugin if it is disabled. Enable other required plugins if you are prompted to do so.

Posted in Miscellaneous

Lumia 630

A couple of years back I never thought I’d be buying a Windows phone. At R$ 320 (approximately US$ 104) I found a Lumia 630 to be a really good upgrade for my wife, after a LG L40 she’d been using.

Nokia Lumia 630

Here’s what I like about it:

  • 4.5 inch screen with good viewing angles and blacks.
  • Nice sturdy plastic body.
  • Replaceable 1830 mAh battery. The phone lasts almost two days on a charge without heavy use.
  • Dual Sim.
  • Quad-core Snapdragon 430 with sensor core technology for activity tracking.
  • 5 megapixel back camera with autofocus.
  • Digital TV.
  • It’ll get a free update to Windows 10 for phones.

Here’s what could be better:

  • It has 512 MB of RAM. The kinds of apps my wife uses hardly demand any more.
  • No camera flash. The situations where that would help are very few. It does make a handy flashlight though.
  • No screen brightness adjustment based on ambient light.
  • Mail app does not support push notification, and GMail specific features. My wife ended up trading the phone for my daughter’s Moto E.
  • Poor app ecosystem means you end up having to use the browser a lot more often.
Posted in Review, Windows

Listening to FM radio using RTL-SDR

I am tinkering with an RTL-SDR dongle to listen to FM radio, on a MacBook Pro with OS X Yosemite, and a Windows 8.1 VM running on Parallels Desktop 10. There are several software options available. I’ll go into those that I tried, others that I didn’t, and one that is surprisingly good.


This is a multi-platform library available as open source. On Mac OS X, you can obtain it using homebrew

brew install librtlsdr

Here’s how you can use the rtl_fm sample available with the library, to record wide-band FM

rtl_fm -f 88700000 -M wbfm - | ffmpeg -f s16le -ar 17000 -ac 2 -i - wbfm.wav

I pipe the output of rtl_fm, which is in signed 16-bit little-endian PCM format, to ffmpeg to produce a WAV file. The WAV file can then be played using Audacity, or any music player of your choice.


SDR# is a Windows freeware that used to be open source in the past. It is fairly easy to listen to FM radio by following the SDR# FM radio tutorial from Adafruit. The quality of audio is not so good on a Windows VM.

I attempted to build an older open source version of SDR# using Xamarin Studio for Mac OS X. It fails to run because run-time dependencies such as libsndfile and portaudio, installed through homebrew, are 64-bit binaries. 64-bit build of mono 3.12.0 and libgdiplus (the latter depends on cairo installed through homebrew) from source also does not work due to crash in native code invoked by System.Windows.Forms.XplatUICarbon.CGDisplayBounds. Windows Forms on 64-bit Mono on Mac OS X is currently a no-go.

There’s HDSDR, another Windows freeware, that I haven’t tried. A Mac OS X port of gnuradio is something else I want to try, but it is only available through MacPorts. I don’t use MacPorts, and building gnuradio from source looks daunting due to the number of dependencies.

Radio Receiver Chrome App

Radio Receiver

The open source Radio Receiver App from a developer at Google, is probably the best way to listen to FM radio using RTL-SDR. The sound quality is awesome, and it’s mostly implemented in JavaScript! How cool is that!?

Posted in .NET, HTML, JavaScript, SDR

Get every new post delivered to your Inbox.

Join 78 other followers

%d bloggers like this: