|
HamClock HamClock is a kiosk-style application that provides real time space weather, radio propagation models, operating events and other information particularly useful to the radio amateur. HamClock was introduced in my October 2017 QST article and continues to be maintained and expanded. For quick start on Raspberry Pi or other UNIX-like operating systems see the Desktop tab below. The User Guide tab provides detailed operating instructions. Explore the additional tabs for further supporting information.
News highlights: See the complete version history in the Download tab and
details in the User Guide.
Now available as a turn-key system from:
|
Corrections:
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-small
Makefile target for RPi's with 7" screens
See the ESP8266 Notes tab.
See the Desktop tab.
Assuming you only ever installed HamClock according to my instructions in the Desktop tab, you can remove all traces by typing the following two commands in a terminal or ssh session:
sudo sh -c 'rm -fr ~/.hamclock ~/ESPHamClock* /usr/local/bin/hamclock*' rm -fr ~/.hamclock ~/ESPHamClock* ~/.config/autostart/hamclock.desktop ~/Desktop/hamclock.desktop
This error means your system is using a version of openssl (used by curl) that is older than 1.1.1. This occurs because a prominent high level SSL certificate expired on Sept 30 2021 and openssl was updated to use the replacement certificate. You can find your version by opening a terminal command line and typing this command:
openssl version
To update openssl on an RPi you can try
sudo apt upgrade openssl
To update on macOS try these possibilities:
sudo port upgrade openssl(be sure /opt/local/bin is before /usr/bin in your PATH)
After the update, repeat the openssl command and you should see version 1.1.1 or larger. If so, repeat your HamClock version update and it should work.
It depends on the message.
permission error
Address already in use
To find the other program using the port, suppose the offending port is 8080. Then either of the following commands should provide clues to the other program:
sudo lsof -i :8080 sudo netstat -tulpn | grep :8080
sh: 0: illegal option -p
No memory for satellite
time is running backwards
Trapping this event is new starting in version 3.00 of HamClock. Before then, I had indirect evidence of this from my server logs because when it occurs, HamClock suddenly thinks all content is out of date and floods my server with retries. I had to do something to prevent this so I added the strict time check.
The root cause is because NTP uses UDP which does not guarantee packet delivery, order or absense of duplicates. Thus it's possible for a router somewhere to send an old packet resulting in stale NTP time values. Statistics I've collected here from google NTP show one backwards event about every 10^11 packets. That works out to about one bad packet every 2000 days. But since there are well over 2000 HamClocks running the world over, one of them is likely to experience this each day.
After I gather more statistics I will try to make HamClock more tolerant to this. For now, thank you for your patience and cooperation.
Copy it down exactly and email it to me.
No, you can't run it natively on Windows but you can use it if it is already running somewhere else on your network by using any desktop browser. See FAQ 14 about the hamclock web interface for details.
For another approach, see the User Contrib tab for a suggestion on how to use WSL.
Not natively but it does seem to work under UserLand. See User Contrib 16 for more information.
I do not have a Geochron 4K but from its literature I can think of the following 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:
I have nothing against Geochron. If I have misrepresented Geochron in any way, please tell me how and I will correct immediately.
host
name and port
number for your desired node.
A good list is here.
HamClock supports DX Spider, AR and CC node types.
Not all are active so if the connection fails, try another.
If no port is listed, try the usual default of 7300 for Spider and 7373 for AR-Cluster.
Also on Setup page 2:
It is important to understand that cluster commands are saved on the node and remain in effect for the given login name even if you log out and log back in. It is not enough to just not send them to get the opposite effect. For example, suppose you want to reject all spots of US amateurs, you could enter this (spider) command and set it On:
rej/spot 0 call_dxcc 226Because it is set On HamClock will send this command when it logs in. Now suppose you restart HamClock and just turn this command Off. This tells HamClock to not send this command when it logs in. That's fine, but since the cluster remembers your settings across logins, the filter will still remain in effect! To turn off this filter, you need another command to explicitly clear it, such as
clear/spot 0Thus, it's a good idea to create pairs of commands, one to engage and one to cancel each filter type.
Clusters reject multiple simultaneous logins from the same callsign. So when HamClock connects with the same call in use elsewhere, the node disconnects, HamClock retries and this repeats continuously. The limit of 10 now prevents this. The solution is to use a unique suffix for each program, such as WB0OEW-1 and WB0OEW-2.
The nodes also reject these, resulting in the same reconnect looping situation. The solution is to enter a valid call sign, perhaps with a suffix as above.
No, HamClock can only be built these sizes:
The base size of 800x480 was set when HamClock started life back in 2016 on a stand-alone ESP8266 microprocessor with an 800x480 LCD display.
It is not a simple matter to change that original aspect ratio. Each size requires its own custom fonts, graphics symbols, maps and images in order to take proper advantage of the different resolutions. Otherwise, these would be very pixelated if they were just multiples of the base images. Plus, if the 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.
xrandr is dying an agonizing death, consider using a browser instead, see FAQ 14.
Even though full screen mode uses the entire screen, HamClock still only uses the pixels specified in the make command size, filling the remaining space with black. With the GUI configuration (not fb0) you can try a command line program called xrandr to expand HamClock to fill the screen by changing the effective display resolution to match HamClock.
Xrandr works by changing how the X server maps pixels to the display hardware. It's easy to try and undo if you decide you don't like it.
For example, my display is 1920 x 1080. HamClock can be built for sizes 800x480, 1600x960, 2400xx1440 and 3200x1920. Thus, the largest I can build HamClock that will fit is 1600 x 960. If I run this size with the Full screen option in setup set to Yes, HamClock will still be that size but will fill the surrounding gaps with black. With xrandr one can expand HamClock to fill the screen and eliminate those gaps.
To try it on a Pi, log in from some other computer with ssh (or putty) so we aren't trying to adjust the same screen we are using for commands. Run the following command while HamClock is running in its full screen mode:
xrandr --output HDMI-1 --scale-from 1600x960 --display :0
That's it, the effect should be immediate but ...
scale-from
a little.
xrandr --output HDMI-1 --scale-from 1920x1080 --display :0
~/.xsessionrc
using your favorite text editor.
On RPi version bookworm
things are different because the default window system
has become Wayland.
You can either use raspi-config
to change back to X11 so the above will work,
or you can use Wayland's alternative command called wlr-randr
as follows:
export WAYLAND_DISPLAY=wayland-1
wlr-randr
with no arguments to get a list of supported sizes.
wlr-randr --output HDMI-A-1 --mode 1680x1050
~/.config/wayfire.ini
and
add two lines at the bottom; again for the same example:
[output] mode = 1680x1050
xrandr works on macOS too with XQuartz but it only allows choosing from a fixed set of sizes. So you can still reduce the border but you may not be able to eliminate it altogether. The general idea is to use the following procedure, again adjust sizes to fit your situation:
xrandr --size 1600x1200
. You'll see the hamclock size jump.In a word, no. I have two reasons.
One is the previous version provided precision far beyond what is real. The VOACAP model is based on monthly averages, so several tens of percentage point changes can easily occur due to solar flares, geomagnetic disturbances and other effects that happen very rapidly. So although the model does generate percentage values, they don't really have as much meaning as the precision implies. I think of the VOACAP model as similar to climate. As the saying goes "climate is what you expect, weather is what you get".
The second reason is I think seeing the daily trends adds greatly to the value of the display. For example, at a glance you can tell whether conditions will improve or get worse in the next few hours, or quickly pick a time of day that offers the best chances to contact a given location. These trends and planning capabilities were not possible when only the present hour values were shown.
Having said this, I will allow that it was nice to see just the current conditions at a glance. This is why I added a small marker below the new graph to show the current time. This way, you can just scan your eye up that column to see basically the same information as presented previously, with precision that represents reality just as well. Granted they are not numbers, but the color choices remain the same as before: red < 33%, yellow < 66% and green above 66%, with one change that I now make < 10% black.
Give it more time and perhaps you will come to like the new graph as much as I do.
If you are looking for the RESTful API command interface, see FAQ 42.
Yes.
Use a browser to load the page live.html
on port 8081 from the host running hamclock.
For example, if HamClock reports its local IP as 192.168.7.101, then enter this
URL to run it from your browser:
http://192.168.7.101:8081/live.html
Some notes:
Full screen web?
is supported but won't engage until the user makes at least one mouse tap.
This is not a bug in HamClock, this is because of a
web standard
requirement to prevent malicious software from taking over the
screen without explicit user action to do so.
Why would you use this?
To run multiple independent instances from the same URL see the User Contrib 12.
hamclock-web-XXX
versions and run as follows:
(type make help
for a complete list)
cd ~/ESPHamClock make -j 4 hamclock-web-1600x960 sudo make install hamclock &You won't see anything on your screen now, but browse to the host running HamClock as described above and voilà! you will find a live HamClock.
To start this automatically on each boot, run crontab -e
then
add the following as the last line:
@reboot /usr/local/bin/hamclock
Can I change the connection port number?
hamclock -w 7000
Can I connect with https?
Not directly, HamClock only supports http connections. But if you have administrative access to a web site running apache, you can set up a reverse https proxy as follows:
/etc/apache2
.
# allow specific https access to http hamclock ProxyPass /hamclock-live/live.html http://127.0.0.1:8081/live.html ProxyPass /hamclock-live/favicon.ico http://127.0.0.1:8081/favicon.ico ProxyPass /hamclock-live/live-ws ws://127.0.0.1:8081/live-wsUse port 8082 for read-only access.
a2enmod proxy proxy_wstunnel proxy_http
apachectl graceful
.
https://<your_web_site>/hamclock-live/live.html
Cheers, and thanks for using HamClock.
Probably because your time is off. If the button below and to the right of your call sign says OFF then tap it so it says UTC and try again.
The error occurs because sat elements are only good for a few days so if the clock's time has been adjusted outside the valid range you'll get an error message. Time can be adjusted away from UTC if you click any of the time fields. That can be handy to intentionally move time forward or backwards to explore gray line, VOACAP predictions etc. See page 7 of the User Guide for more details.
Because they are showing maps for two adjacent hours.
Ideally all Clocks would update at the top of the hour. But with several thousand Clocks running the world over that would overwhelm the backend server. In order to spread out server hits, Clocks intentionally randomize their VOACAP updates throughout each hour. This means the map shown by any given Clock might be up to one hour late.
So in your case, one clock is showing a map for the current hour, and the other is still showing from the previous hour. When the Clock that happens to be updating later updates, it will then show the same map until the cycle repeats next hour.
It's probably not wrong but I can think of two possibilities why you might think so:
For example, suppose you set your location to 35.1N 110.1W which is in grid DM45. HamClock will display this in the main DE pane as 35N 110W grid DM45. But taken at face value 35N 110W is in grid DM55 so the grid appears to be wrong because the location is rounded for display. When in doubt, open the lat/long dialog to review the values as they are stored internally.
Note that displaying more precision would not eliminate this issue entirely, it can only reduce the region where this occurs.
Some programs use the center of a grid for their position, others use the SW corner. HamClock uses the corner because that is the historical technique described in this paper published in January 1989 QST. My personal favorite web site that uses this technique is here. But other popular web sites use the center, such as this one on QRZ.com. So it depends which you consider correct.
If you still feel HamClock is in error, please send me the exact details.
It is additional detailed status and diagnostic information HamClock writes to the file
$HOME/.hamclock/diagnostic-log.txt
.
It is not intended for general consumption but can be helpful for troubleshooting.
The previous 3 logs are also stored in a rolling set with the following names:
diagnostic-log-0.txt
diagnostic-log-1.txt
diagnostic-log-2.txt
Sometimes it can be helpful to watch the file in real time which you can do with the following command; type Control-C to quit.
tail -f $HOME/.hamclock/diagnostic-log.txt
When asking for assistance, you may be asked to upload these files to my server for analysis.
To do so, tap the padlock icon then select Post diagnostics
.
The amount of information added to the diagnostic file can be changed while HamClock is running
using the RESTful command set_debug
.
All the current levels are included in the reply to get_sys.txt
.
Larger level values will log more diagnostic information.
For example, the following command will set the debug level for the ADIF subsystem to 1:
curl '<hamclock-ip>:8080/set_debug?name=ADIF&level=1'
Sudo stands for "super-user do". In UNIX, the super user refers to extra privileges bestowed upon the root user. Rather than actually logging out and logging back in as user root to gain these privileges, this command arranges for you to have these greater privileges just long enough to run the command that follows on the same line. After that command completes, you are again restricted back to the normal privileges of your current user login.
But using sudo comes at a price.
/etc/sudoers
it may require entering a password each time.
/root
.
HamClock creates and uses a working directory named .hamclock
(note the leading dot)
in the HOME directory. HOME for the normal pi user is /home/pi
.
Thus, if you run HamClock without sudo it uses /home/pi/.hamclock
but if you run it with sudo it uses /root/.hamclock
and files therein are not
accessible to the normal pi user.
This duality can cause much confusion.
/root
,
PATH becomes just /bin:/usr/bin
and DISPLAY is removed
entirely. These are all at odds with HamClock.
A much better way is to use set-uid.
This refers to an automatic mechanism engaged by setting the mode of a program file in
such a way that when the process runs, it has the same permissions as the owner of the file.
Normally, the process has the permissions of the user running the file.
Thus by making the program file owned by root,
it has super-user privileges no matter what user runs it.
Using this mechanism for HamClock allows it to have super-user privileges without using sudo.
Unlike sudo, using set-uid does not change anything else, so HamClock will still use your
/home/pi/.hamclock
directory for its support
files as expected.
The reason to escalate privileges with either of these methods in the first place is that HamClock requires super-user privileges to perform certain external IO and protected file system operations. It is possible in some configrations for someone with sufficient UNIX administrative knowledge to make adjustments so HamClock can run without super-user privileges, but this is beyond what most users want to deal with. So in the interest of providing the simplest and most enjoyable experience possible for the majority of users, the install instructions use set-uid root.
For those still interested in eliminating the need for root privileges, the following commands may help for RPi. They perform the following functions:
sudo usermod --append --groups video,input,gpio,i2c pi sudo chmod u-s /usr/local/bin/hamclock sudo chgrp pi /usr/local/bin sudo chmod g+w /usr/local/bin
The last two steps are required so automatic updates may write a new version of the executable file in /usr/local/bin.
After executing these commands, subsequent instances of hamclock will no longer run as root
but should be able to perform most functions.
But note if you perform sudo make install
again in the future
this will set the set-uid bit again so remember to perform command 2 again.
No. RSS feed formats are surprisingly inconsistent so I perform all the heavy lifting on my server and only send the plain titles back to HamClock. Plus, most now use https which uses too much memory for the little ESP processor.
That said, if you have a feed in mind that is of general interest to the global ham community, send me your suggestion and I will consider adding it to the server processing.
You might also consider setting your own titles locally using the set_rss web command (see FAQ 14) or run the contributed script hcrss.pl (see the User Contrib tab).
Yes. See Setup page 5 for several speed choices.
It means either my connection to Open Weather Map is overloaded or your clock is making queries too rapidly.
In order to stay within the usage limits of my OWM subscription, my backend server will deny all HamClock weather queries if they arrive faster than 200 per minute.
My server also limits the request rate from any one public IP. Note if you have more than one HamClock at your shack, they all count as one for this limit because they each report the same public IP address.
If you are asking why you can not turn off a specific choice:
If you are asking why a specific choice is not listed:
No. The list is maintained on my server which performs all the heavy lifting of discovery and updating, sending only the TLEs back to HamClock.
That said, if you have a satellite in mind that is of general interest to the global ham community feel free to send me a suggestion at ecdowney@clearskyinstitute.com.
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 size of non-volatile memory.
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 on the ESP is about 30% slower now but the added flexibility and visual results seem worth it.
The UNIX versions of HamClock store their map files in ~/.hamclock
so the number of files is limied only by available disk space.
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 day and night regions and blends them in a 12° band to simulate civil twilight.
When asked to update itself, HamClock checks the support server if there is a newer version available. If so, for the ESP systems this is a binary file that is downloaded directly into FLASH and that's all there is to it.
But for the Desktop UNIX systems, this is a zip file containing the source code that requires many more steps:
make
is run within the source tree, using the same target that was used
to build the currently running program These steps present two challenges: how to find the full path of the program file to a running program and how to update its program file while it is still running.
To find the program file full path, HamClock first checks the argv[0] path given when it was executed, digging through symlinks if necessary to find the real program file. If this is already a full path, indicated by beginning with a slash (/), we are done. If not, then a test is made whether a file with that name exists with respect to the current working directory of HamClock. If so, we are done. If it still is not found, then the argv[0] name is checked for in each of the directories named in the PATH environment variable. If still not found, the update fails.
To update the program file, we have to deal with the fact that it is not possible on UNIX to
modify the program file of a running program (even as root).
So instead, HamClock does it indirectly by first removing the program file then copying in
the new one created by make
so it has the same name.
To remove the current program file, HamClock requires write permission on
its containing directory because removing a file actually just edits it out of its
containing directory. If HamClock does not have this permission, the update fails.
Copying in the new file then edits the same name back into the same
directory, so it looks like it was overwritten when actually it was deleted and added again.
Meanwhile, HamClock can continue to run because a deleted file still actually exists in memory
until the last process with it open either closes it or exits, even if it is not named by any
directory.
You have two choices. One is to wire it to the 40 pin header as described below. The other is to use a USB-I2C bridge as described in FAQ 45.
BME label | RPi Header pin |
---|---|
Vin | 1 |
SDI | 3 |
SCK | 5 |
GND | 9 |
sudo apt-get install i2c-tools
sudo raspi-config
and 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 different numbers, not just all XX
/dev/i2c-1
but see the
User Guide page 16 for more details.
For now leave the delta values set to zero. Click Done.
/boot/msdos/config.txt
to add the following line to the
[all]
section then reboot:
gpio=2,3=a0
sudo i2c -s
which should immediately report the device
address(es).
I have used a direct connection of ten feet without any problem. I have also successfully used 100 feet of Cat 5 using a pair of these extenders from Sparkfun.
This may mean your device has become saturated. According to the data sheet page 46, you can try reconditioning the device by baking it at 120 C for 2 hours, then letting it slowly cool to 25 C over 24 hours. If this doesn't help then your device may be broken.
Click and hold the padlock for 3 seconds, then select Exit.
Nothing, it's still supported for legacy users, but now that the GUI version can display full screen it is no longer recommended for new installations.
For those new to HamClock who may not know about fb0, it was an early attempt to provide a
full screen experience by turning off the GUI and accessing the RPi video frame buffer directly.
This was accessed through the special
file /dev/fb0
, and hence the name.
This allowed HamClock to fullfill its charter purpose on RPi of being a stand-alone
appliance for ham radio information. Although successful, it required a lot of special
programming and could be a challenge for users to install. It is now replaced by using
FreeDesktop.org atoms
to accomplish the same full screen functionality with the normal X11 GUI.
If you have fb0 installed, please remove it before installing any new versions. This requires the following steps:
crontab -e
and remove the line that runs hamclock
sudo raspi-config
and
doing
Advanced Options ⇒ GL driver ⇒ OpenGL with fake KMS ⇒ Ok
don't reboot yet
System Options ⇒ Boot ⇒ Desktop Autologin ⇒ Ok ⇒ Finish ⇒ Reboot? Yes
No. To build hamclock and put it in, say, /usr/bin, use the following steps:
cd ESPHamClock make -j 4 hamclock-1600x960 sudo mv hamclock-1600x960 /usr/bin/hamclock sudo chown root /usr/bin/hamclock sudo chmod u+s /usr/bin/hamclock
Screen blanking control is a complex dance between the host and HamClock, and the music keeps changing.
Let's check the host first.
sudo raspi-config
then
sudo apt remove xscreensaver
sudo apt autoremove
/etc/X11/xorg.conf.d/10-blanking.conf
and make sure the line for
DPMS shows Enable
.
xset dpms force off
.
If the screen goes blank then HamClock should be able to blank the screen as well.
Click your mouse or type any key to get the display back on.
You may find HamClock can turn the monitor off but it comes right back on again.
If this happens edit /boot/firmware/cmdline.txt
and add vc4.force_hotplug=1
to the end of the existing line
(don't create a new line), then reboot.
If still no luck, your best bet is to turn off Wayland as follows:
sudo raspi-config
then
/etc/X11/xorg.conf.d/10-blanking.conf
and make sure the line for
DPMS shows Enable
.
xset dpms force off
.
If the screen goes blank then HamClock should be able to blank the screen as well.
Click your mouse or type any key to get the display back on.
As for HamClock itself, it will only blank the screen if:
If these criteria are not met then HamClock will not try to blank the screen, thus any blanking that does occur must be caused by the host system, not HamClock.
Follows are the HamClock settings that control when it will blank the screen:
This is a consequence of HamClock being originally written for the ESP8266 embedded processor. I wrote a porting layer that allows me to use the same application code on the Pi. This saves me a lot of effort but since the ESP8266 code is fundamentally an infinite loop, the result is the UNIX program runs all the time also.
It's not usually a big deal in practice but if it bothers you, use the hamclock -t command line argument to set the desired CPU percentage. For example, to limit cpu usage to about 50%, run hamclock as follows:
hamclock -t 50
Note that lower limits will result in more sluggish performance.
Rigctld
is
hamlib's
rig control daemon,
and
rotctld
is the
rotator control daemon.
They provide a device independent network protocol to control several brands of radios
and single and dual axis antenna rotators without having to know their individual commands.
On RPi you can install them with sudo apt install hamlib
.
HamClock can create a network connection to these programs for automatic control of
any radio or rotator* supported by hamlib.
To get a list of all supported equipment run the programs with -l
,
such as rigctld -l
.
You must get these hamlib programs working with your equipment before you can use
them with HamClock.
For practice, you can run either program in simulation mode by specifying model one, such as
rotctld -m 1
.
Then enter the program's host and port number in HamClock's Setup, page 3.
The rotator simulator is particularly fun.
Start the simulator, then select the Rotator pane and get acquainted with the
controls before connecting to your real rotator.
There is no pane dedicated to rig control, it is only used to automatically set the radio frequency
of a DX Cluster spot.
Do not confuse rigctld (or rotctld) with another hamlib program named
rigctl
(or rotctl).
This program, without the trailing d, provides direct radio (or rotator)
control using the command line, not a network connection.
Both the command line and the network program use the same control libraries under the hood,
so if one works the other will also.
It can be a good idea to use rigctl (or rotctl) for initial testing, then once that works,
change to rigctld (or rotctld) using the same -m
model selector to allow
network control from HamClock.
* Note as a special case, although the Yaesu G5500 rotator is not supported by hamlib because it has no serial or networked computer interface, there is a project that provides a drop-in replacement for rotctld for the G5500 here .
flrig is W1HKJ's program to provide network control of many ham radio transceivers. It historically provided rig control to fldigi but works very well on its own. Unlike the hamlib tools, flrig includes its own GUI so many consider it easier to use.
You can download packages for several platforms
here
or on RPi you can install it with the command sudo apt install flrig
.
Once installed, just type flrig
and go to Config → Setup → Transceiver to
prepare for your radio.
A handy tip for troubleshooting the connection between HamClock and flrig is to run
flrig in stand-alone mode without needing a radio. Install it on the same computer
running HamClock and configure Setup page 3 for flrig Yes and set host to
localhost
and port to 12345
.
Now let HamClock start and run the following command in a terminal:
flrig --test
HamClock should connect. Click the PTT button on flrig and HamClock should display the PTT message.
It will run but you won't see much.
HamClock connects to clearskyinstitute.com for all the data plots, real-time images and maps and to various NTP servers for time. That just leaves the moon, NCDXF beacons, and BME environment data that is sourced locally.
You could get time without a net connection by using a GPS antenna and running gpsd.
On the other hand if you have a slow network connection, see FAQ 46.
Because K is more timely. The K index is reported every three hours while the A index is only updated once per day. Another important advantage is the 2 day forecast provided by NOAA for K index, which is not provided for A index. Together these features provide increased resolution and a better indication of expected trends than the A index.
You can find the exact relationship between A and K in the WikiPedia article.
It could be a different source or different timing.
There are multiple primary resources for some statistics so it depends on which you are comparing with. For example, the sun spot numbers are determined and reported independently by NOAA in the US and SILSO in Belgium.
It can also be due to timing. The various primary data sources publish at different times during the day and they are not always exactly on time. The secondary data consumers also have their own schedule of picking up the values which can also vary. For example, even WWV sources are not always in sync. Typically their Sun Spot Number json feed is several hours ahead of their text feed. Another example are their Kp numbers from here and here are often out of sync by half an hour or more.
These are time scales useful in various applications other than ham radio. They are included with HamClock because of its general role as a time keeping device.
HamClock only supports the Idle timeout and On/Off timers in the following situations:
sudo raspi-config
then
sudo apt remove xscreensaver
and reboot.
Maybe, but I haven't been excited enough to try for several reasons:
But if I were to try, I'd start with this port of the Arduino ecosystem. Note this path would mimic the ESP8266 HamClock, not the RPi version. I'm not aware of any path to achieve the latter.
Yes. HamClock provides a RESTful API scripting interface, with which it can be controlled and queried over a network. These commands can be sent with command line tools such as curl or wget or with a browser. The list of commands below is followed by several examples.
By default, the RESTful API interface uses port 8080 but this can be changed with the -e command line argument. For example, to change to port 9000, run hamclock as follows:
hamclock -e 9000
Syntax | Summary |
---|---|
get_capture.bmp | Save screen as bmp file |
get_config.txt | Report current HamClock configuration settings |
get_contests.txt | Report current contests if that data pane has been shown |
get_de.txt | Report DE info |
get_dx.txt | Report DX info |
get_dxpeds.txt | Report current DXpeditions if that data pane has been shown |
get_dxspots.txt | Report current list of DX cluster spots |
get_livespots.txt | Report current Live Spots list, if active (not ESP) |
get_livestats.txt | Report current Live Spots stats, if active |
get_ontheair.txt | Report current POTA/SOTA activators, if active |
get_satellite.txt | Report current satellite position and passes, if defined |
get_satellites.txt | Show a list of all available satellites. |
get_sensors.txt | Generate list of BME280 sensor values, if attached |
get_spacewx.txt | Get last-known data pane data and age |
get_sys.txt | Report some basic HamClock system information |
get_time.txt | Report HamClock's idea of UTC |
get_voacap.txt | Report current band conditions percent reliability matrix, if active |
set_adif?pane=[0123] (POST) | Load an ADIF file using html POST in the given data pane; see example |
set_alarm?state=off|armed&time=HR:MN&utc=yes|no | Set daily alarm off or arm at the given DE time |
set_auxtime?format=[one_from_menu] | Set the auxiliary time format (beneath UTC) |
set_bmp?pane=[1,2,3,map]&fit=[resize,crop,fill][&off] | Load a BMP file in data pane or main map area; see example |
set_cluster?host=xxx&port=yyy | Set a different DX cluster node |
set_debug?name=xxx&level=n | Set the given debug subsystem level to n |
set_defmt?fmt=[one_from_menu]&atin=RSAtAt|RSInAgo | Set DE pane time format to one of its menu choices, and rise/set if All info |
set_displayOnOff?on|off | Turn display on or off |
set_displayTimes?on=HR:MN&off=HR:MN&day=[Sun..Sat]&idle=mins |
Set display on and off DE times for the specified day, or today if not specified.
DOW is Sun..Sat. Optionally set display idle time (not saved on per-day basis). |
set_livespots?spot=of|by&what=call|grid&show=maxdist|count
&data=psk|wspr|rbn&age=mins&bands=all|160,...... |
Change Live Spots configuration |
set_mapcenter?lng=X | Set a new center for the Mercator or Robinson map; not persistent across restarts. |
set_mapcolor?setup=name&color=R,G,B | Set one of the Setup map colors. Color may be 0..255 RGB or common color
names (leave blank for list). |
set_mapview?Style=S&Grid=G&Projection=P&RSS=on|off&Night=on|off | Change 1 or more map settings. S, G and P must match View menu text exactly. |
set_newde?grid=AB12&lat=X&lng=Y&call=AA0XYZ | Define a new DE call and location using grid or lat+long |
set_newdx?grid=AB12&lat=X&lng=Y | Define a new DX location using grid or lat+long |
set_once_alarm?state=off|armed&time=YYYY-MM-DDTHR:MN&tz=DE|UTC | Set the one-time alarm off or arm at the given DE or UTC time |
set_pane?Pane[123]=X,Y,Z... any set from:
VOACAP DE_Wx DX_Cluster DX_Wx Solar_Flux Planetary_K Moon
|
Set the specified data pane 1-3 content, if allowed. |
set_pane?Pane0=X,Y,Z... any set from:
DX_Cluster ADIF Contests POTA SOTA off |
Set the specified plot data pane 0 content, if allowed. |
set_panzoom?pan_x=X&pan_y=Y&pan_dx=dX&pan_dy=dY&zoom=Z | Set map zoom and/or absolute or delta pan. Pan X [-330,330] Y [-165,165]. |
set_rotator?state=[un]stop|[un]auto&az=X&el=X | Control rotator, if data pane is visible and connection is established. |
set_rss?reset|add=X|network|interval=secs|on|off|file (POST) | Control RSS including local titles; see examples below. |
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_screenlock?lock=on|off | Control screen lock |
set_senscorr?sensor=76|77&dTemp=X&dPres=Y | Set the given BME280 temperature and/or pressure correction in current units |
set_stopwatch?reset|run|stop|lap|countdown=mins | Stopwatch commands |
set_time?change=delta_seconds | Change time by the given number of +- seconds. |
set_time?ISO=YYYY-MM-DDTHH:MM:SS | Set UTC to the given time |
set_time?Now | Set UTC to current time from NTP or gpsd |
set_time?unix=secs_since_1970 | Set UTC to the given UNIX time |
set_title?call|title|onair=[text]&fg=R,G,B&bg=R,G,B|rainbow | call=& sets call sign colors (text is ignored); onair=text& sets ON AIR text
and/or colors; title=text& sets alternate text and/or colors or off if empty. Optional colors may be 1-255 RGB triple or common names (leave blank for list). |
set_touch?x=X&y=Y | Virtually touch screen coordinate X, Y; scaled to 800 x 480: must lie outside map |
set_voacap?band=X&power=W&tz=DE|UTC&mode=X&map=REL|TOA|OFF&TOA=X | Set VOACAP model parameters. X values same as VOACAP DE-DX data pane. |
exit | tells HamClock to exit (not ESP) |
postDiags | Post diagnostic logs and configuration settings |
restart | Restart HamClock |
updateVersion | Check for new version and update if found |
any command not recognized | Show this help |
In the examples below, change the IP to what HamClock reports as its L-IP.
Get the current clock UTC time:
curl 'http://192.168.7.101:8080/get_time.txt'
Set display to turn on Wednesday at 8 AM and off at 10 PM, DE time, with 10 minutes idle time:
curl 'http://192.168.7.101:8080/set_displayTimes?on=8:00&off=22:00&day=Wed&idle=10'
Set a new DE location from latitude and longitude:
curl 'http://192.168.7.101:8080/set_newde?lat=40.7&lng=-74'
Save the current display to a file named hcscreen.bmp:
curl 'http://192.168.7.101:8080/get_capture.bmp' > hcscreen.bmp
Specify an earth satellite with its TLE:
Note 1: This TLE will be out of date by the time you read this, it is shown just as an example of proper syntax.
Note 2: This elaborate curl syntax is required whenever the payload includes spaces.
See User Contrib #13 for a small script that helps with this curl syntax.
curl --get 'http://192.168.7.101:8080/set_sattle' --data-urlencode 'name=ISS&t1=1 25544U 98067A 21320.06051688 .00001570 00000+0 37172-4 0 9998&t2=2 25544 51.6441 311.7573 0004586 201.9414 260.8823 15.48581357312130'
Set satellite to ISS and report current ephemeris with respect to DE:
curl 'http://192.168.7.101:8080/set_satname?ISS'
Set Live Spots to report spots made by DE call using wspr on 40, 30 and 20m
curl 'http://192.168.7.101:8080/set_livespots?spot=by&what=call&data=wspr&bands=40,30,20
Set Pane 3 to rotate through NOAA Space weather, X-Ray flux and DRAP trend:
curl 'http://192.168.7.101:8080/set_pane?Pane3=Space_Wx,X-Ray,DRAP'
Toggle the screen lock padlock:
curl 'http://192.168.7.101:8080/set_touch?x=224&y=132'
Change call sign to say "Welcome Visitors" white on red (requires expanded curl because of embedded blank):
curl --get 'http://192.168.7.101:8080/set_title' --data-urlencode 'title=Welcome Visitors&fg=255,255,255&bg=red'
... then restore normal call sign:
curl 'http://192.168.7.101:8080/set_title?call='
Change map to Azimuthal projection with Countries style and RSS on, leaving Grid unchanged:
curl 'http://192.168.7.101:8080/set_mapview?RSS=on&Projection=Azimuthal&Style=Countries'
Turn off RSS network feed and clear the local title list:
curl 'http://192.168.7.101:8080/set_rss?reset'
Turn off RSS network feed and add one RSS title to local list:
curl --get 'http://192.168.7.101:8080/set_rss' --data-urlencode 'add=This is a new RSS title'
Turn off RSS network feed and load a file containing up to 15 lines into the RSS title list:
curl --data-binary '@mytitles.txt' 'http://192.168.7.101:8080/set_rss?file'
Restore normal network RSS operation:
curl 'http://192.168.7.101:8080/set_rss?network'
Load the ADIF file named myfile.adi and select ADIF in data pane 2 (center pane).
curl --data-binary '@myfile.adi' 'http://192.168.7.101:8080/set_adif?pane=3'
Load the BMP file named myimage.bmp in data pane 3 (right pane), cropping to center if necessary:
curl --data-binary '@myimage.bmp' 'http://192.168.7.101:8080/set_bmp?pane=3&fit=crop'
Same but in the main map area:
curl --data-binary '@myimage.bmp' 'http://192.168.7.101:8080/set_bmp?pane=map&fit=resize'
User
.
It may be combined with other styles for rotation or zoomed in the usual manner.
If you don't see it immediately, some other style is probably in rotation.
The higher the resolution of the loaded file, the better zooming will look.
set_bmp?pane=map&off
sudo apt install ffmpeg ffmpeg -i myimage.png -v error -c:a copy -pix_fmt rgb565 -y myimage.bmp sudo apt install netpbm pngtopam myimage.png | ppmtobmp -bpp 24 -windows > myimage.bmp sudo apt install imagemagick convert myimage.png bmp3:myimage.bmp
Set map grid color to yellow:
curl 'http://192.168.7.101:8080/set_mapcolor?setup=Map_grid&color=yellow'
Yes but you must arrange that they each use different ports and working directories so they do not interfere with each other. You do this using these command line switches when you start each hamclock:
-e
sets a different REST API port
-w
sets a diffrrent web port
-d
sets a different working directory
For example, to run hamclock using port 9080 for the RESTful API, 9081 for the web interface and /tmp/hamclock2 for the working directory, start hamlock as follows:
hamclock -e 9080 -w 9081 -d /tmp/hamclock2
If you don't need one or both of the networking options, specify port -1 to turn either one off completely.
Type hamclock -help
for a full list of switches and their
respective default values.
In theory, yes, but given the current internal software architecture this would be very difficult.
A key difficulty is that HamClock has no menu bar. This means there would be no way to control features that currently use the surrounding panes which, when you think about it, is almost everything. And adding a menu bar would require changing the internal structure of the program so completely it might as well become a separate program.
Another challenge would be the need for yet another set of map resolutions. This means all the various map styles (MUF, Auroras, Weather, etc etc) would all need to be generated at the new resolutions for each of the four basic build sizes. Generating the maps on demand is already the single highest load on my backend server, so adding more sizes would further increase this load.
So again, yes it's possible because HamClock is afterall "just" software, but for now it's well beyond my available resources.
Yes. HamClock supports two choices: the generic CH341T available from several places online and both the full and mini bridges from i2cdriver.com.
ls /dev/cu.usbserial*
.
Look for a new entry that appears only when the bridge is installed.
i2c-ch341-usb.c
line 660 from
ch341_dev->irq_descs[i] = irq_to_desc(ch341_dev->irq_base + i);to
ch341_dev->irq_descs[i] = irq_data_to_desc(irq_get_irq_data(ch341_dev->irq_base + i));
lsmod
and check that i2c_ch341_usb
module is installed.
ls /dev
and confirm there is a node of the form i2c-N
,
where N is some number.
sudo i2cdetect -y N
and confirm it shows the I2C address of your BME280,
either 77 or 76.
The devices function the same as if connected via the native I2C bus, although substantially slower.
Note the native RPi I2C header pins and these USB bridges can not work at the same time.
It is because HamClock is only a single thread of execution so it can only do one thing at a time. Thus, if the network connection is slow everything hangs during file downloads and it can't update the time digits. HamClock tries to reduce this effect by reading in fairly small chunks and updating the time after each chunk completes, but it can still look jerky.
Note the stalling does not affect the accuracy of the internal time keeping because that uses a hardware interrupt, so time proceeds apace regardless of the display.
The accuracy of the reports depends on several factors.
Yes, but first a little background.
Each instance of HamClock needs its own working directory for supporting files.
By default this is $HOME/.hamclock
(note the leading dot).
One file therein is called eeprom
which contains all the configuration settings.
This file is used a lot at runtime so don't change it while hamclock is running.
So, to copy a hamclock configuration from computer A to B:
You don't have to copy any of the other files in the directory, they take care of themselves automatically.
Having said that, if you have saved multiple configurations, you might also want to copy
the entire directory $HOME/.hamclock/configurations
If you would like to keep multiple independent HamClock instances on the same computer,
use the command line option -d
to specify an alternate working directory for each.
Hamclock will create the specified directory if it doesn't already exist.
So for example, to use a separate working directory for someone with a call W9ABC,
they could run hamclock like this:
hamclock -d $HOME/.hamclock-w9abc
You can even run several hamclocks at the same time on the same machine, see FAQ 43 and User Contrib item 12.
Almost on the native GUI interface, definitely not on ESP8266 or the web browser interface.
The reason for "almost" is that the HamClock window must have what's called the "focus" in order for it to receive any keyboard events, and usually the only way to do that is to click the mouse once inside the HamClock window! The only way around this catch I know of is that most window managers have options such as "focus follows mouse" or "focus on new windows" which may help if you can find them.
But once HamClock has the focus then yes indeed, it can be completely controlled from the keyboard as follows:
hjkl
or arrow keys
move the red arrow cursor
left-down-up-right (same as the vi editor)
shift
and/or control
will
multiply the step size by 2 and/or 4, respectively
space
or Enter
will do the same as a mouse click
at the current cursor location
shift
and/or control
will
function as a long hold
hjkl
or arrow keys
will navigate the items as a matrix
space
will toggle selections
Enter
will function as "Ok"
ESC
will function as "Cancel".
Historical note:
Even though keyboard cursor control has been available by default for a long time,
starting with version 3.01 it will require that you start hamclock with the ‑y
command line option.
I decided to disable it by default because too many people are laying things on their keyboard
causing it to repeat endlessly, which sends zillions of commands to my server for hours on end
without their realizing it.
Note that ‑y only applies to cursor control;
the Setup pages and menus continue to work the same as always with or without ‑y.
You can not connect an actual photocell directly to an RPi because it has no ADC input.
But you can connect an LTR-329 light sensor via I2C. I use this breakout from Adafruit. HamClock supports connecting it directly to the I2C pins 3 and 5 on the RPi 40 pin header, or using the USB-I2C bridge from i2cdriver.com. The bridge has the advantage that it will work on any UNIX system with a USB port, such as linux or macOS desktops. It even works on the RPi too, if you find USB to be more convenient than using the 40 pin header.
Once connected, the I2C light sensor supports the same HamClock functions as the photocell. See page 8 of the User Guide.
Note you can use the BME280 environment sensor in this manner also, see FAQ 45.
Unfortunately, I have not managed to get the native RPi I2C pins and the i2cdriver to work at the same time. So you must use one or the other for both BME280 and the LTR-392 light sensor.
HamClock needs a good internet connection so check that first.
For example check that ping clearskyinstitute.com
reports no dropped packets and round-trip times of about 50 ms or better.
On WiFi, check that your RSSI is at least -60 or above
(HamClock reports the RSSI just below your call sign).
Even with a good signal, you might have local RF interference being created by other devices
or appliances.
If in doubt, consider moving your HamClock closer to your WiFi router with a clear line-of-site.
If the network looks good, it might be my server has blocked your public IP address. As HamClock becomes more popular, it seems to be inevitable it will also attract a few who want to ruin it for the many and that is indeed the case.
To combat this, I have implemented a monitor on my server that temporarily blocks any IP that makes rapid repeated connections. I can tune the parameters but as of Jan 2024 the rate threshold is faster than one contact every four seconds sustained for a period of five minutes. Once blocked the IP will remain blocked, regardless of its contact rate, for three hours.
There is no legitimate HamClock usage that will cause a block but a few times I have found someone has a stuck keyboard or mouse button which causes HamClock to repeatedly make queries over and over.
If you feel you have been unfairly caught in my trap, feel free to make your case in an email to me at ecdowney@clearskyinstitute.com.
Yes, but first an important warning:
I MAKE NO CLAIMS AS TO THE EFFECTIVENESS OF THIS FEATURE AND I ACCEPT NO RESPONSIBILITY IF IT IS BREACHED AND YOUR SYSTEMS ARE COMPROMISED. USE AT YOUR OWN RISK.
To assign a password to certain potentially sensitive operations within HamClock
run it with the -p
option,
followed by the name of a text file containing pairs of categories and passwords.
The file must be formatted according to the following rules:
changeUTC exit newde newdx reboot restart setup shutdown unlock upgrade
For example, if a text file named
hamclock_passwords.txt
contains the following:
# my hamclock passwords shutdown ^&%@JJH78 unlock my unlock password
then enable the two passwords by running hamclock as:
hamclock -p hamclock_passwords.txt
Implementation notes:
-p
.
Because it has been added to, and is rotating with, other map styles that are already selected.
As stated in the release notes, version 4.04 allows multiple background maps to be selected at the same time which then cycle, much the same as the data panes. So when you click VOACAP DE-DX for a REL or TOA map, it gets added to the current style list. Since they cycle, this causes the new map to appear to come and go.
The solution is just to turn off the map styles you don't want.
Now you might ask why HamClock doesn't just turn off all the other styles. The reason is that doing so creates the opposite problem of styles that had been manually selected mysteriously turning off, which is considered to be worse.
Either the band you are showing really is pretty much shut down for some reason or because you have set HamClock to compute the long path.
You can toggle between long and short path by clicking LP/SP in the lower right corner of the DX panel or in the VOACAP DE-DX data pane.
It depends on your configuration; take a look through these ideas:
xdg-open
on most systems (all but macOS),
so this helper program must be installed.
See the Desktop tab for package name suggestions.
Yes, HamClock will run on any of the Pi Zero models, although somewhat more slowly of course.
The challenge is not running HamClock, it's building it, especially if using a 64 bit system, because the compiler uses so much memory. One way to address this is to add a swap file. Do that by running the following commands first, then proceed with the installation:
sudo fallocate -l 2G /var/swapfile sudo chmod 600 /var/swapfile sudo mkswap --label myswap /var/swapfile sudo swapon /var/swapfile
When HamClock is built for 800x480 each map is roughly 5 KB (kilobytes); the exact size varies because the maps are compressed but this is a good average. The maps scale by build area so maps for 1600x960 are 4x this size and so on.
Countries and Terrain are only downloaded one time; DRAP is downloaded every 5 minutes; MUF_RT every 15; Aurora and Weather every 30; all VOACAP maps every 45.
Selecting multiple map styles for rotation does not effect these numbers because the maps are cached locally until they need updating.
Maps that depend on DE or DX will require an immediate update if these locations change. The MUF-VCAP map is updated immediately whenever DE is changed. The VOACAP DE-DX TOA maps are updated immediately when first selected for each band and then again whenver DE is changed; the REL map is also updated for each band and whenever either DE or DX are changed.
The SDO images are 10 KB each when built for 800x480; again these scale by area for larger builds. The SDO image is refreshed every 30 minutes.
On a very busy contest weekend the DX Cluster pane my download 100 KB/hr, otherwise much less. The other panes may require roughly 10 KB/hr.
So, for example, if you build 1600x960, select DRAP and Aurora maps and the SDO pane then you will download 4* (5*(12 + 2) + 2*10) = 360 KB every hour, plus a little more for other data panes. These particular maps are not dependent on DE or DX so changing them will not require map updating. Or if you just select the Countries map alone, it is never updated so the only downloads are for the data panes.
The HamClock program began back in 2015 on the ESP8266 microprocessor in C++ with an 800x480 LCD touch screen. I used the Adafruit drawing libraries for all graphics. Since the ESP has only 80k RAM, all image processing was relegated to a backend server and image pixels were painted immediately as they arrived; there was no room for any kind of local backing store. Being a monolithic environment, the program was just an infinite loop of checking for touch screen events and drawing. All coordinates were native to the LCD.
Later as a first attempt to move HamClock to the Raspberry Pi, I wrote a drop-in replacement for the Adafruit library that maintained the same API methods but instead of writing pixels to the LCD the pixels were written to the raw frame buffer accessed as /dev/fb0. Raw keyboard events were collected from /dev/tty1 and raw mouse events from /dev/input. All drawing methods had to be reimplemented from scratch, for example using the famous Bresenham algorithm for drawing lines. Even the cursor has to be home-made, which is why HamClock to this day uses its own red arrow cursor. A new collection of fonts were also created and hidden within the Adafruit methods. This all worked out very well and is still the most efficient of all HamClock implementations for the RPi.
Later still I wrote another drop-in replacement for the Adafruit library that implemented display with X11 Windows and reading its mouse and keyboard events. Again, no X11 drawing functions were used, HamClock just continued to render the "LCD" as always but the porting layer was actually updating a memory array that was sent to the X client as a full screen bitmap once every 50 ms. For efficiency, only pixels that changed were sent over the wire. This worked surprisingly well with still no changes needed at all to the main program.
Later still I decided to try for higher screen resolutions. Drawing coordinates were still 800x480 but I built higher res images for the earth maps, VOACAP models, data panes etc. Since all images are created on my backend server, I could not afford to generate arbitrary sizes on the fly so I decided to support only three more sizes of 2x 3x and 4x the sizes needs for 800x480. These higher res images were still positioned to 800x480 precision but drawn to high resolution.
This worked well for the images but at larger screen sizes the 800x480 graphics drawing and fonts started to look pretty jagged. So for the first time I broke the Adafruit API by adding "raw" drawing methods such as drawLineRaw that worked in native coordinates. This fixed the drawing jaggies but the fonts were still just getting integer expanded. So following the same idea as the image sizes, I designed four new fonts, one for each of the four integer sizes. The font names are exactly the same regardless of size in order to hide from the main program that it is actually loading different font resolutions depending on the make build size. The fonts ended up looking pretty nice, although they are still always positioned to 800x480 accuracy.
Later still I added a web server that reads the same backing array already maintained for X11 but instead sends it to the web server as one large pixmap image, again only sending changed pixels. Browser events are sent back to hamclock, still using 800x480 coordinates. The client html is just a small page of javascript.
Not to a separate file, but they are saved in the HamClock diagnostics file exactly as received from the cluster server except they are prefixed with a time stamp and module ID. For example, the following terminal command will list all spots from the currently running HamClock program:
grep 'DXC: < DX de' ~/.hamclock/diagnostic-log.txt | cut -c 20-
Because modes are determined by subband frequency ranges which are only loose conventions. And even if they were perfectly adhered to by all parties, they differ by region and country.
The way it should work is if the spotting networks had originally required mode to be explicitly specified by the spotter, but it's too late for that now.
By my invitation and your accepting responsibility to run relatively untested software. If we agree then I will send you a link to download a zip file with a name something like ESPHamClock-V4.14b10.zip. From there you install much like any hamclock:
cd rm -fr ESPHamClock unzip ESPHamClock-V4.14b10.zip cd ESPHamClock make -j 4 hamclock-1600x960 (or as desired) sudo make install hamclock &
Once installed, HamClock will offer to update to all subsequent beta versions; you must decide whether you want to take the risk. Once a full release is issued and you update to it, you will be out of the beta program and must apply again.
Send me a note at ecdowney@clearskyinstitute.com but beware:
If you are submitting a bug report, always include:
If using any UNIX system, also include the following as you feel might be helpful:
make
target you built Thank you. Your coorperation will help us both find a resolution to your issue more quickly.
All contributed scripts referred to below are available in this zip file
Contributed by Joeri van Dooren, ON3URE
sudo apt-get update sudo apt-get upgrade sudo apt install curl make g++ xorg-dev libx11-dev zip cd rm -fr ESPHamClock curl -O https://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip unzip ESPHamClock.zip cd ESPHamClock
make
to get a list of the resolutions and options available.
The following targets are available (choose as appropriate for your system)
hamclock-800x480 X11 GUI desktop version, AKA hamclock hamclock-1600x60 X11 GUI desktop version, larger, AKA hamclock-big hamclock-2400x1440 X11 GUI desktop version, larger yet hamclock-3200x1920 X11 GUI desktop version, huge hamclock-web-800x480 web server only (no display) hamclock-web-1600x960 web server only (no display), larger hamclock-web-2400x1440 web server only (no display), larger yet hamclock-web-3200x1920 web server only (no display), huge
make -j 4 hamclock-web-2400x1440 sudo make install
hamclock &
and press enter.
Contributed by Hans Klausmann, DL5RAZ
see dl5raz.py.
Script by Barry, N0NZ
Documentation here.
Contributed by Elwood Downey, wb0oew@arrl.net
Someone asked if they could edit the eeprom
config file.
Normally no, but since I enjoy writing perl,
I couldn't resist writing hceeprom.pl
to do exactly that.
You can download it within the contrib collection
here.
Save the script anywhere in your PATH and make it executable as usual.
The script needs to know the directory containing the source files
and the path to the eeprom file.
By default these are assumed to be the current directory and
~/.hamclock/eeprom
, respectively,
but these can be changed with the -s
and -e
options.
Run the script with no args or --help
for a complete usage summary.
Note well: you are hacking a file not intended for human consumption, so you can easily mess things up. There's no validation checking whatsoever, so you could go right ahead and set preposperous values such as a longitude of 10000 or inconsistent values such as a lat/long that doesn't match the grid square sending HamClock into unexplored territory. Save a copy of eeprom before starting, or remove it then run HamClock so it will build a new one containing all defaults. Never edit the file while HamClock is running because HamClock often updates it, but only reads it once when starting up. You have been warned.
What ever, let's try it! Here are some examples:
Read the call sign:
hceeprom.pl NV_CALLSIGN NV_CALLSIGN = WB0OEW
Set a new call sign:
hceeprom.pl NV_CALLSIGN AB1XYZ NV_CALLSIGN = AB1XYZ
Set the DX cluster host:
hceeprom.pl NV_DXHOST usdx.w1nr.net NV_DXHOST = usdx.w1nr.net
Set DX spots to show as full call sign
hceeprom.pl NV_MAPSPOTS 2 NV_MAPSPOTS = 2
Set the BME280 at I2C address 77 temperature correction:
hceeprom.pl NV_TEMPCORR2 -0.23 NV_TEMPCORR2 = -0.23
Contributed by Elwood Downey, wb0oew@arrl.net
This script hcgetsw.sh
queries HamClock for the most recent value of any space weather
data it provides.
Run the script with -help for a complete list.
Contributed by Elwood Downey, wb0oew@arrl.net
HamClock does not allow setting individual RSS feeds, see FAQ 20 for the reason why.
But this script uses the web-based RSS title loading facility set_rss
to read any
RSS feed and load its titles into HamClock.
To use the script, just give it the host name (or IP) of your HamClock followed by the full URL of the RSS to load. For example:
hcrss.pl 192.168.7.117 https://www.arrl.org/news/rss
Contributed by AL7CR.
These settings allow a full screen Hamclock with no menu or borders on one display and a fully useable Mac desktop on the other. Tested on XQuartx 2.7.11 under High Sierra 10.13.6. The steps are:
Contributed by KJ7RRV.
HamClock is available in the Arch User Repository here. The package names are:
Contributed by NI2O.
This pdf shows how to configure HamClock to operate in an LXC container on a ProxMox server.
Contributed by M1JKL.
TrueNAS allows you to run Docker containers and VMs of all sorts; in my case, all I wanted to do was to run Hamclock as a service and hence it seemed a massive overkill to go down the VM/Docker route - hundreds of MB of installed space used up for a simple executable.
So this is what I did:
make -j 4 hamclock-web-1600x960
$ ./hamclock
$ tmux ./hamclockallows you to close the truenas login session whilst detaching from the still-running hamclock.
I did this a few weeks ago so the description above is from memory. Anyone with a bit of linux knowledge (I have almost none!) will work out a more elegant approach to establish it as a true service by using things like init.d or /etc/rc.local.
Contributed by WB0OEW.
Suppose you wanted to provide one URL for club members to access HamClock from anywhere they could access a browser. You could start one HamClock and publish its live web connection directly but as soon as more than one person connected they would interfere and things will get confusing and frustrating pretty quickly.
This little program solves that by functioning as a multiplexing proxy. It listens to the same port 8081 as a real HamClock, but runs a separate instance of hamclock for each IP reported by connecting browsers.
To give it a try, extract the program from the
contrib collection mentioned at the top of this tab.
The entire program is self-contained in a single file named hcwebproxy.cpp
.
Also, since the hamclocks that the proxy will run are only useful on the web,
it is recommended to build a web-only hamclock just for use by the hcwebproxy.
If this is how you normally build hamclock anyway then you can continue to use that one.
Putting it all together, assuming you want to use a different hamclock just for hcwebproxy, the procedure might go something like this:
cd ~ curl -O 'https://clearskyinstitute.com/ham/HamClock/hamclock-contrib.zip' unzip hamclock-contrib.zip cd hamclock-contrib make hcwebproxy sudo make install cd ~/ESPHamClock make hamclock-web-1600x960 sudo mv hamclock-web-1600x960 /usr/local/bin sudo chown root /usr/local/bin/hamclock-web-1600x960 sudo chmod u+s /usr/local/bin/hamclock-web-1600x960 hcwebproxy -d ./hcwebproxy-hamclocks -h hamclock-web-1600x960 -i 240 -m 3 -v -- -t 50 > x.hcwp &
The main reason for escalating to root privilege is to allow remote updates. See FAQ 19 for more information.
Now surf to the usual URL such as http://your-host:8081/live.html
and you should get a new HamClock.
Try these additional tests to understand different use cases:
Futher notes:
-m
option to limit the maximum number accordingly.
The default is 10 processes.
Attempts to connect when this maximum has been reached will result in
a brief informative message.
Also see -i, next.
-i
hours are eligible for reassignment to handle
the new connection. The default is 24 hours.
-t
option which you can set
using hcwebproxy's --
option.
Note well that this will reduce the responsiveness of each hamclock so use wisely.
For example, to limit each hamclock to no more than 20% CPU:
hcwebproxy -h hamclock-web-1600x960 -- -t 20 &
-v
for debug info
and try to reproduce the problem. Send me the log if it seems like a bug.
-d
option, the default is
$HOME/hcwebproxy-hamclocks
.
-a
option to assign each hamclock its own RESTful API port.
The port numbers are assigned sequentially starting with the value given with -a.
No attempt is made to avoid ports already in use by other applications so choose wisely.
The problem remains how to know which hamclock is using which port; this is
left as an exercise for the reader.
ps ax | egrep 'hamclock|hcwebproxy' | grep -v egrepThe processes with status T are sTopped.
Contributed by WB0OEW.
Copy/paste the following into a file named hccurl
and use
it to send commands to hamclock that require embedded spaces.
#!/bin/bash # run curl with spaces if [ $# -lt 3 ] || [ $# -gt 4 ] ; then echo Purpose: curl wrapper for sending hamclock commands with or without embedded spaces echo Usage: hccurl host port command '[value]' echo Example set: hccurl 192.168.7.101 8080 set_title "'"'msg=Welcome Visitors&fg=255,255,255&bg=red'"'" echo Example get: hccurl 192.168.7.101 8080 get_config.txt else HOST="$1" PORT="$2" CMD="$3" if [ $# -eq 3 ] ; then curl --get "http://$HOST:$PORT/$CMD" else VALU="$4" curl --get "http://$HOST:$PORT/$CMD" --data-urlencode "$VALU" fi fi
I've got no Pi but servers and Linux machines. So I thought, I'd create an easy way to run HamClock using Docker, exposing it as a website. The code and instructions can be found at https://github.com/zeidlos/hamclock-docker.
I have not tested it on Windows, but potentially it'll run in WSL2. Works fine on my MacBook as well as my Linux-Server. I'm pretty sure it's an easy way to install/run on Raspberry Pi, or NAS Systems that support Docker/Docker-Compose as well.
73
A complete docker implementation with supporting information is at https://github.com/ChrisRomp/hamclock-docker.
Contributed by Chris, NZ6F
N3FJP2HamClock is a Windows application to synchronize HamClock with the call sign entry field in N3FJP logger applications. This application connects to the N3FJP API server, and when you tab out of the call sign field, it will update your HamClock(s) with the DX of the entered call.
Contributed by Todd, N9MWB
Install UserLAnd on your android device from the play store.
Start UserLAnd and create a new Debian App. Select:
Desktop environment: Minimal Connection Type: Graphical Orientation: either
You can also choose Ubuntu or probably another app, but the instruction will be slightly different. These instructions have worked fine for me with Debian.
I recommend using a vnc viewer such as RealVNC from my laptop/desktop once you have your UserLAnd session started. On the device, when the UserLAnd session comes up, click outside the terminal window and select the keyboard icon. Click on the terminal window and run vncpasswd and set the vnc password to something you'll remember. Then from a regular computer where you have a vnc viewer installed (I used RealVNC's viewer), vnc into the UserLAnd session. You might have to install net-tools and get your UserLAnd session's IP address, although it should be the same as the devices IP address. Then connect to ip-address:5951. At this point, you should be ready to install hamclock into your UserLAnd session.
For Debian
sudo apt update -y sudo apt upgrade -y sudo apt-get -y install curl make g++ libx11-dev libgpiod-dev zip cd rm -fr ESPHamClock curl -O http://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip unzip ESPHamClock.zip cd ESPHamClock make -j 4 hamclock-800x480 (or 1600x960 or 2400x1440 or 3200x1920 depending upon the screen resolution of your device. sudo make install hamclock
You can now either use hamclock via vnc or connect with a browser to ip-address:8081/live.html
Contributed by Mark, G7LTT/NI2O
The ESP8266 HamClock has reached end of life. The last release was version 3.10. Thanks to everyone for participating.
Version 3.10 source code and User Guide are still available here and here.
Consider using the UNIX/Linux model for all new builds.
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Set the port to match the USB connection of your Huzzah.
EP = https://www.adafruit.com/products/2821 ESP HUZZAH feather RA = https://www.adafruit.com/products/1590 RA8875 Display controller BM = https://www.adafruit.com/products/2652 BME280 Temperature, Humidity Pressure sensor PC = https://www.adafruit.com/product/161 CdS Photocell other hardware: https://www.adafruit.com/products/2354 7" Color TFT with touch screen https://www.adafruit.com/products/2098 FPC cable extension Wiring summary: EP_SCK RA_SCK EP_MO RA_MOSI EP_MI RA_MISO EP_2 RA_CS EP_15 KX3 RX EP_16 RA_RST EP_USB RA_VIN Optional sensor pack: EP_SCL BM_SCK EP_SDA BM_SDI EP_3V BM_VIN Optional photocell: EP_ADC PC_1, 330k EP_GND PC_2 EP_3V 330k Connect all GNDs together
To use Adafruit ESP Huzzah breakout: https://www.adafruit.com/products/2471 Breakout 9" TFT 7" TFT 16 11 = Reset RA_RST 2 = Blu LED 5 = CS RA_CS 12 = MI 6 = SDO RA_MISO 13 = MO 7 = SDI RA_MOSI 14 = SCK 8 = SCLK RA_SCK 15 14 = Backlight N/C Vbat 3, 4, 37, 38 RA_VIN 5 V supply GND 1, 2, 13, 31, 39, 40 RA_GND supply ground Sensor: 5 BM_SCK 4 BM_SDI 3V BM_VIN Photocell: A0 PC_1, 330k GND PC_2 Vbat 330k Note: To program the Huzzah breakout: 1. Attach the 6 pin programming cable 2. Enable programming mode: Hold GPIO0, click Reset, release GPIO0 then red LED should be on dim 3. Proceed with programming (blue LED flickers while loading) 4. After programming is complete, click Reset 5. Unplug the programming cable if not needed for Serial
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
Pros:
Cons:
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 when 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 would not be possible without the following resources:
And special Shoutouts to Adafruit and Raspberry Pi Foundation for great products and support.
HamClock may be built for Raspberry Pi, macOS, Ubuntu, FreeBSD, NetBSD, Windows WSL or most any other UNIX-like system supporting the X11 Windows system.
cd curl -O https://www.clearskyinstitute.com/ham/HamClock/install-hc-rpi chmod u+x install-hc-rpi ./install-hc-rpi
y
or n
followed by Enter
.
hamclock &
cd rm -fr ESPHamClock curl -O https://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip unzip ESPHamClock.zip cd ESPHamClock make -j 4 hamclock-800x480 sudo make install
sudo apt-get update sudo apt-get -y install curl make g++ libx11-dev libgpiod-dev xdg-utils
sudo apt install curl make g++ xorg-dev xdg-utils
Then open More developer tools
and install the command line tools.
On macOS Sequoia, you may need to run the following command line in Terminal:
xcode-select --install
.
sudo pkg install gcc xorg gmake curlthen use gmake instead of make.
sudo pkgin install gmake curlthen use gmake instead of make.
sudo yum install gcc-c++ libX11-devel xdg-utils
setup-desktop apk add g++ libx11-dev curl linux-headers
hamclock &
Exit hamclock
.
make
command above will build HamClock with 800x480 pixels.
You can also make these sizes:
hamclock-1600x960
hamclock-2400xx1440
hamclock-3200x1920
make clean
and redo the commands again, for example:
cd ~/ESPHamClock make clean make -j 4 hamclock-2400x1440 sudo make install
cd ~/ESPHamClock mkdir -p ~/.hamclock cp hamclock.png ~/.hamclock cp -p hamclock.desktop ~/Desktop
Similarly, if you would like HamClock to start automatically when you boot your system, try these commands:
cd ~/ESPHamClock mkdir -p ~/.config/autostart cp hamclock.desktop ~/.config/autostart
cd ~/ESPHamClock HCDIR=~/Desktop/HamClock.app mkdir -p $HCDIR echo '#!/bin/bash' > $HCDIR/HamClock echo '/usr/local/bin/hamclock &' >> $HCDIR/HamClock chmod u+x $HCDIR/HamClock
To give it a proper icon:
hamclock.png
with PreviewGet Info
To put it in the Dock:
For a little more decorum, create a bona fide app using Platypus. I tried it briefly on Big Sur and found it easy to use and worked well. Use the same 2-line script as above but without the & so Platypus can properly inform the OS when you exit HamClock.
This site does not use cookies.