This page refers to my QST article in the October 2017 issue. All updates will be posted here.
Click on the tabs below for more information.
News highlights. See the complete version history in the Download tab and more 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 you have the wrong esp8266 board version, Go back and install 2.4.0 before contining.
• How do I build the Raspberry Pi Desktop or fb0 software?
See the Desktop tab, on the right.
• 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 that 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?
It allows you to remotely control your HamClock over a network using a browser or command line tool such as curl or wget. This is possible because HamClock responds to its network IP address on port 80, the default for http web servers. 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:
You must change the example address to the IP your HamClock displays periodically just below your call sign. Note the good practice of surrounding the URL with apostrophes to insure it is not interpreted with shell metacharacters. The output will be a list of all supported commands as follows:
|get_capture.bmp||Save screen as bmp file|
|get_countdown||Report remaining seconds of count down timer|
|get_de||Report DE info|
|get_dx||Report DX info|
|get_satellite||Report current satellite position, if one is defined|
|get_sensors||Generate list of sensor values, if one is attached|
|get_stats||Report some basic HamClock operational statistics|
|get_time||Report HamClock's idea of UTC|
|help||Print list of available commands|
|updateVersion||Check for new version and update if found|
|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||Set display on and off times, DE time zone|
|set_dxclusterOnOff?on|off||Sets pane 2 to DX Cluster or XRAY|
|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&long=Y||Define a new DX location using latitude/longitude|
|set_newdxgrid?AB12||Define a new DX location using its maidenhead grid square|
|set_satname?abc|none||Select satellite from built-in list, or none|
|set_sattle?name=abc&t1=line1&t2=line2||Define any satellite with 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|
Set display to shut off at 10 PM and back on at 8 AM, DE time:
Set a new DE location:
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:
• 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, FreeBSD or any other UNIX-like system in 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:
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.
make helpfor a list of other sizes available. Then redo the
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
mkdir -p ~/Desktop/HamClock.app/Contents/MacOS cp hamclock ~/Desktop/HamClock.app/Contents/MacOSTo give it a proper icon:
• To try it on an RPi using a dedicated HDMI or DSI display, 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:
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.
make helpfor a list of other fb0 sizes available.
sudo bash -c "echo 0 > /sys/class/graphics/fbcon/cursor_blink"
~/.rpihamclock_eeprom. Removing this file and restarting HamClock will
• 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
• To start
hamclock-fb0 automatically when the system boots,
consider using crontab.
@reboot cd ESPHamClock; sudo ./hamclock-fb0 > hamclock.log 2>&1
hamclock-fb0therein. Adjust as necessary to match your configuration.
man 5 crontab