gawk Networking: UDP Examples (working version)

Gawk provides built-in networking support. The gawk manual has some examples, for basic UDP-communication at [1]. The classical sender/receiver code snippets are as follows:

# Server
     BEGIN {
       print strftime() |& "/inet/udp/8888/0/0"
       close("/inet/udp/8888/0/0")
     }
# Client
     BEGIN {
       "/inet/udp/0/localhost/8888" |& getline
       print $0
       close("/inet/udp/0/localhost/8888")
     }

Unfortunately these examples did not work on my test system under Ubuntu 13.10 Desktop 64bit and gawk v. xxxxx. Ref. [2] provided the correct description of the fields of the network strings. Using that, my working versions are:

 #! /usr/bin/gawk -f

BEGIN {
    print strftime() |& "/inet/udp/0/localhost/8888"
    close("/inet/udp/0/localhost/8888")
}

and

#! /usr/bin/gawk -f

BEGIN {
    "/inet/udp/8888/0/0" |& getline
    print $0
    close("/inet/udp/8888/0/0")
}

According to [2], the full syntax of the special file name is:

    /net-type/protocol/local-port/remote-host/remote-port

Replace “localhost” with the IP address of a remote machine, if receiver and server are not running on the same machine.

[1] http://www.gnu.org/software/gawk/manual/gawkinet/html_node/File-_002finet_002fudp.html#File-_002finet_002fudp
[2] https://www.gnu.org/software/gawk/manual/html_node/TCP_002fIP-Networking.html

HOWTO: VirtualBox Guest Additions

From the official documentation it is not very clear, how to install the guest additions necessary to use shared folders. Here’s how it works:

VirtualBox Guest Additions is a .iso file, that can be downloaded from here (for version 4.6.3): http://download.virtualbox.org/virtualbox/4.3.6/ The file in question is  “VBoxGuestAdditions_4.6.3.iso”. Download it and burn it onto a CD. Boot your guest OS in VirtualBox and then insert the burned CD. The installer should start after the CD is recognized.

Tested with: Windows 7, Windows XP

 

Notes for setting up the CC2530 Mini Kit

The PDF-file for the “CC2530ZNP Mini Kit quick start guide rev. A”  is located at http://www.ti.com/litv/pdf/swru268a It mentions some software examples and drivers, which are not easily to find …

The CC2530ZNP start page is at http://www.ti.com/tool/cc2530zdk-znp-mini which points to the
CC2530ZDK-ZNP-MINI at http://processors.wiki.ti.com/index.php/CC2530ZDK-ZNP-MINI
which in turn (link just above “More Informations”) points to the “Tutorial on the Examples” at http://processors.wiki.ti.com/index.php/Tutorial_on_the_Examples

The example software mentioned in the Quick start Guide is downloadable from the “here” link, which points to http://www.ti.com/lit/zip/swrc211

Arduino ATmegaxx8 Target Board

When testing an Arduino board, I encountered some strange problems. I decided to build such a board from scratch to find out what the problem was. I had some ATmegaxx8 target boards from Evil Mad Scientists (see [1]) available, so I decided to convert one of them into an Arduino compatible board for testing.

Arduino Board based on Evil Mad Scientists

ATMEGA168P on the Evil Mad Scientists Board

Continue reading