This page refers to my QST article in the October 2017 issue. All updates will be posted here.
News highlights: See the complete version history in the Download tab and details in the User Guide.
http://Your-HamClock-IP/set_sattle?name=abc&t1=line1&t2=line2Like all the server commands, you can send this with most browsers or with curl or wget from the command line.
hamclock-fb0-smallMakefile target for RPi's with 7" screens
• How do I build the ESP8266 software?
Do not use newer versions, these are the versions I have tested extensively.
If you need help with libraries in general try
If the options you see do not look exactly like mine (except possibly Port) then you have the wrong esp8266 board version, go back and install 2.7.4 before continuing!
• How do I build the Raspberry Pi Desktop or fb0 software?
See the Desktop tab, on the right.
• Can HamClock run on Windows?
No, it can not run natively on Windows but it can display on Windows by using an X Server. The idea is to run the HamClock program on a UNIX-like system, such as RPi or WSL (Windows Subsystem for Linux) or Cygwin, then run HamClock in such a way that it displays on the X Server running on Windows.
make -j 4 hamclock-800x480 export DISPLAY="192.168.7.129:1" ./hamclock-800x480
Note in the example above, 192.168.7.129 is the IP of the Windows machine, so change that to match your system configuration. Also note the ":1" of the DISPLAY environment variable says to use X Server display 1, which corresponds to the selection I made while running XLaunch. If you find it won't connect, it might be due to your Windows firewall. X Window servers listen on port 6000 + display_number, so in this case be sure Windows is allowing incoming connections on port 6001.
• Can HamClock run on iPhone or iPad?
Similar answer as previous FAQ but you'll need an X server app for iPad. I find Mocha X11 works well.
• How does HamClock compare to Geochron 4k?
I do not have a Geochron 4K but from its literature I can think of the following display functions related to ham radio that HamClock offers but Geochron does not:
Conversely, Geochron can do things HamClock can not. These items are certainly interesting but to me they do not seem specifically useful to the typical amateur radio operator:
If I have misrepresented Geochron in any way, please let me know and I will correct immediately.
• How does the DX Cluster feature work?
filter1 reject not by_zone 3,4,5 filter2 reject not on hf/cw filter3 reject on hf/rtty filter4 reject on hf/ssb filter5 reject info ft8
• Can I make different sizes beyond those in the Makefile?
No. Each size requires its own custom fonts, symbols, maps and solar images in order to take full advantage of the higher resolutions. Otherwise, these would be very pixelated if they were just multiples of the base images. Plus, if the aspect ratio changes, the layout would need to be rebalanced. This is why all sizes are multiples of 2 of the base size in order to maintain the same layout proportions.
• Why can I click on the DE or DX grid square and sometimes get a second value?
Because displaying location only to a whole degree, or any finite precision, can be ambiguous. Suppose you use the Setup screen to enter location 40N and 100.1W. This is in grid square DN90. But this location will be rounded to 40N 100W for display and this location is in grid square EN00. Just looking at the rounded HamClock display values you can't tell what the original location is, so HamClock gives you the choice of selecting the grid according to your intended usage.
The reason this happens is because grid squares increase from west to east, starting at 180W, and the major longitude grid boundaries are on even integral values. Thus 100W is in one grid and 100.1W is in a different grid. This becomes easier to see when using signed notation. You might expect moving from -100 to -100.1 would stay in the same grid but it doesn't because it is more westward and crosses the boundary at -100. But there is no ambiguity going from -101 to -101.1 because these are both near the center of the same grid, DN90. There is also no grid change going from the eastern longitude of positive 100 to 100.1 because the numeric increase is eastward and both locations are in the same grid, ON00.
The exact same thing happens with latitudes except they grow northwards from 90S and grid boundaries are on every integral line.
In addition to being set from the Setup screen, fractional coordinates can also result when setting location with other methods as well, such as IP Geolocation, gpsd or the remote web socket interface -- in all cases the full precision is maintained internally but only displayed to whole degrees. However, if you set a location by tapping the map or tapping the coordinate values to increment or decrement them then HamClock discards any fractional coordinate values so these methods never lead to a grid square ambiguity.
• Occasionally you mention web interface to the HamClock, what is this?
Among its other features, the HamClock is also a web server. This allows you to remotely control your HamClock over a network using a browser or command line tool such as curl or wget.
To try the following examples, you will need a computer on the same network as your HamClock. Here we will use curl but the same URLs will work in your browser as well (although some browsers are getting more paranoid about accessing a web site with http and you may be asked to trust the site). Note that these commands only function while HamClock is displaying its main page, not auxiliary pages such as Setup, Stopwatch etc.
Start by querying HamClock for a list of all its commands as follows: (actually any unrecognized command will produce this help text)
The output will be a list of all supported commands as follows:
|get_capture.bmp||Save screen as bmp file|
|get_config.txt||Report current HamClock configuration settings|
|get_countdown.txt||Report remaining seconds of count down timer|
|get_de.txt||Report DE info|
|get_dx.txt||Report DX info|
|get_dxspots.txt||Report current list of DX cluster spots|
|get_satellite.txt||Report current satellite position, if one is defined|
|get_sensors.txt||Generate list of sensor values, if one is attached|
|get_sys.txt||Report some basic HamClock system information|
|get_time.txt||Report HamClock's idea of UTC|
|set_countdown?minutes||Set count down timer minutes and start|
|set_displayOnOff?on|off||Turn display on or off|
|set_displayTimes?on=HR:MN&off=HR:MN&idle=mins||Set DE display on and off times and idle duration|
|set_newde?lat=X&lng=Y||Define a new DE location using latitude/longitude|
|set_newdegrid?AB12||Define a new DE location using its maidenhead grid square|
|set_newdx?lat=X&lng=Y||Define a new DX location using latitude/longitude|
|set_newdxgrid?AB12||Define a new DX location using its maidenhead grid square|
|Set what is displayed in a given plot pane; no dups allowed|
|set_satname?abc|none||Select satellite from built-in list, or none|
|set_sattle?name=abc&t1=line1&t2=line2||Define a satellite using TLE values|
|set_time?ISO=YYYY-MM-DDTHH:MM:SS||Set UTC to the given time|
|set_time?Now||Set UTC to current time from network|
|set_time?unix=secs_since_1970||Set UTC to the given UNIX time|
|set_touch?x=X&y=Y||Act as if touched at the given screen coordinates, scaled to 800 x 480|
|updateVersion||Check for new version and update if found|
|any command not recognized||Show this help|
Get the current clock UTC time:
Set display to shut off at 10 PM and back on at 8 AM, DE time, with 10 minutes idle time:
Set a new DE location from latitude and longitude:
Save the current display to a file named hcscreen.bmp:
curl 'http://192.168.7.101/get_capture.bmp' > hcscreen.bmp
Set and start the count down timer to 10 minutes:
Set satellite to ISS and report current ephemeris with respect to DE:
Set Pane 3 to show NOAA Space weather:
• How are the background maps managed?
As of Version 2.52, the background map images are downloaded and stored as local files as needed. In previous versions they were embedded within the executable image and were thus immutable and limited by memory size.
This meant the ESP HamClocks could only ever support one map style, and even that was only at half the available screen resolution. ESP HamClocks now use the extended FLASH file system to store the map images at full resolution. The improved resolution is especially apparent in the night portion of the Terrain style map. Unfortunately, more pixels and slower FLASH access means the display update rate is about 30% slower but the added flexibility and visual results seem worth it.
The UNIX versions of HamClock store their map files in
Note if you run with sudo, this refers to root's home directory, not your login home.
If you run HamClock without a network connection, you will be limited to map styles already downloaded.
The maps are stored in .bmp format, version 4, using 16 bit RG565 pixels. There are separate files for day and night for each map style. HamClock uses these to render the two sunlit regions and blends them in a 12° band to match civil twilight.
• Holding the padlock does not restart ESP, what's going on?
For some unknown reason, this feature does not work the first time you try it after flashing the ESP Huzzah via USB from your computer. Use the reset button on Huzzah once then the padlock will work from then on. This issue does not occur if the Huzzah was reflashed remotely.
• How do I shut off HamClock on the RPi fb0?
Log in and kill the process with the following command:
sudo pkill 'hamclock.*'
• How do I safely power off my RPi?
• My question is not here and I can not find the answer after studying everything on this site, where I get help?
Send a polite note to me at firstname.lastname@example.org.
To use a 9" ER-TFTM090-2 from buydisplay.com:
Select these options during purchase:
This is the wiring list:
EP = ESP Huzzah BM = BME280 sensor PC = photo cell DP = display EP_SCL BM_SCK EP_SDA BM_SDI EP_3V BM_VIN EP_GND BM_GND EP_ADC PC_1, 330k EP_GND PC_2 EP_3V 330k EP_SCK DP_8 EP_MO DP_7 EP_MI DP_6 EP_2 DP_5 EP_16 DP_11 EP_USB DP_3, 4, 37, 38 EP_GND DP_1, 2, 13, 31, 39, 40
The display stand from Adafruit can be made to work with a little ingenuity but is not perfect for the LCD. Send suggestions for better ideas and I will post here.
If you find your display idea works better if the cable exits from the top, there is an option in the Setup screen that allows you to flip the display upside down.
Here is how I built my first two prototypes:
HamClock may also be built for Raspberry Pi, macOS, linux, Ubuntu, FreeBSD or any other UNIX-like system in either of two ways:
HamClock may be built in the following sizes. If the display is larger, HamClock will center itself within a black background.
Operation of HamClock on these platforms is exactly the same as the ESP8266 version with the following exceptions:
Using a Pi Zero is not recommended as it will lead to erratic behavior. HamClock requires the multiple cores only available on any Pi model 3 or 4.
• To give it a try on your GUI desktop, follow these steps:
cd curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip unzip ESPHamClock.zip cd ESPHamClock make -j 4 hamclock-800x480 sudo ./hamclock-800x480
makecommand above will build HamClock at 800x480 pixels for X11. Type
make helpfor a list of other sizes available. Then redo the
sudocommands again substituting the preferred size.
hamclock.desktopto your Desktop folder with this command:
cp hamclock.desktop ~/Desktop
Or if you would like HamClock to start automatically when you log in,
make sure you have an autostart directory then
hamclock.desktop into there with these commands:
mkdir -p ~/.config/autostart cp hamclock.desktop ~/.config/autostart
hamclock.desktop file assumes you made hamclock-800x480 so edit the Exec
line if you have chosen a different size program name.
xrandr --output HDMI-1 --scale 0.833x0.92I computed 0.833 from 1600/1920 but 0.92 was found experimentally to account for the extra menu bar height. With care, this technique can come quite close but don't expect perfection.
mkdir -p ~/Desktop/HamClock.app/Contents/MacOS cp hamclock-800x480 ~/Desktop/HamClock.app/Contents/MacOS/hamclockTo give it a proper icon:
• To try it on an RPi using a dedicated HDMI or DSI display, which I call the fb0 version, follow these steps:
Note: you must use ssh as instructed, do not try to use the RPi display for these commands. The HamClock must have the fb0 display all to itself.
sudo raspi-configone time and set the following options:
cd curl -o ESPHamClock.zip http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip unzip ESPHamClock.zip cd ESPHamClock make -j 3 hamclock-fb0-1600x960 sudo ./hamclock-fb0-1600x960
makecommand above will build HamClock at 1600x960 pixels for fb0. If you want the smaller size 800x480 for the 7" display, redo the
make helpfor a list of other fb0 sizes available.
sudo fbset -depth 32
sudo bash -c "echo 0 > /sys/class/graphics/fbcon/cursor_blink"
~/.hamclock/eeprom. Removing this file and restarting HamClock will reset it back to all default values. Note if you run with sudo, this refers to root's home directory, not your login home.
@reboot cd ESPHamClock; sudo ./hamclock-fb0 > hamclock.log 2>&1
hamclock-fb0therein. Adjust as necessary to match the configuration you specified in your
makecommand. This example also saves the log output but if you would rather just discard it, change the log file name to
@reboot cd ESPHamClock; sudo ./hamclock-fb0 > /dev/null 2>&1
man 5 crontab
• To use the Bosch BME280 environment sensor on RPi, follow these steps:
|RPi Header pin||BME label|
sudo apt-get install i2c-tools
sudo raspi-configand set the following options:
Interface Options: I2C: enabled
sudo i2cdetect -y 1you should see 77 in lower right corner of matrix; then
sudo i2cdump -y 1 0x77 byou should see a matrix of numbers, NOT XX