Skip to content

Commit 6ef4096

Browse files
authored
Wind speed, planet track night sky indication, better forecast failover.
Wind speed, planet track night sky indication, better forecast failover.
1 parent 92c2d19 commit 6ef4096

28 files changed

Lines changed: 1139 additions & 354 deletions

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
}
6060
],
6161
"no-control-regex": "off",
62+
"no-multi-spaces": [
63+
"error",
64+
{
65+
"ignoreEOLComments": true
66+
}
67+
],
6268
"no-new": "off",
6369
"no-return-assign": "off",
6470
"no-unused-expressions": "off",

README.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Astronomy/Weather Clock
22

3-
![raspberry pi logo](https://shetline.com/readme/aw-clock/2.4.0/rpi_logo.svg)
3+
![raspberry pi logo](https://shetline.com/readme/aw-clock/2.8.0/rpi_logo.svg)
44

55
This project is designed to create a desktop clock which provides weather and astronomical information. While primarily designed to run on a Raspberry Pi, the code generates a Node.js server and client web app which can be run on other computers and operating systems, albeit without the Raspberry Pi’s hardware-level support for wired and wireless temperature/humidity sensors. GPS support is also primarily aimed at the Raspberry Pi, but might work on other Linux variants if similarly configured.
66

@@ -12,9 +12,10 @@ On a display which is narrower than a 16-by-9 aspect ratio, four forecast days c
1212

1313
**A touchscreen or mouse is required to display the last two or three days of the seven-day forecast, to switch the display from sunrise/sunset to moonrise/moonset, or to switch from hourly temperatures to hourly probability-of-precipitation.*
1414

15-
![finished project](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-12.jpg)
15+
![finished project](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-12.jpg)
16+
17+
![app screenshot](https://shetline.com/readme/aw-clock/2.8.0/awc_screenshot.png)
1618

17-
![app screenshot](https://shetline.com/readme/aw-clock/2.4.0/awc_screenshot.png)
1819
<br/><br/>
1920

2021
### Getting started
@@ -28,9 +29,9 @@ In my own case, I needed to use an active GPS antenna to get a good signal, but
2829
The next step (or the first, if you’re skipping GPS) is to clone the repository and perform the initial set-up:
2930

3031
```shell script
31-
git clone https://github.com/kshetline/aw-clock.git
32-
cd aw-clock
33-
sudo ./build.sh -i
32+
$ git clone https://github.com/kshetline/aw-clock.git
33+
$ cd aw-clock
34+
$ sudo ./build.sh -i
3435
```
3536

3637
There will possibly be a long delay the first time you run this script while Node.js (if necessary) and various npm packages are installed as a prerequisite to running the rest of the installation procedure.
@@ -55,7 +56,7 @@ Having a back-up weather data source is still, therefore, a good idea. For that
5556

5657
By default, this application uses GPS-synced system time, if available, or `pool.ntp.org` as an NTP time server (keeping its own time via NTP, rather than using the system clock). You can configure the use of a different time server, however, you should not choose a Google or Facebook time server, or any other NTP server that implements “leap second smearing”, if you want the Astronomy/Weather Clock to be able to accurately display leap seconds as shown below:
5758

58-
![Hypothetical leap second](https://shetline.com/readme/aw-clock/2.4.0/moment_of_leap_second.jpg)
59+
![Hypothetical leap second](https://shetline.com/readme/aw-clock/2.8.0/moment_of_leap_second.jpg)
5960

6061
_This image is hypothetical — the pictured moment in time is not guaranteed to be an actual leap second. Video here: <https://shetline.com/video/leap_second_display.mp4>_
6162

@@ -65,7 +66,7 @@ As soon as you’ve got the Astronomy/Weather Clock up and running the first tim
6566

6667
Your city might be filled in automatically by using your IP address &mdash; but then again, it might not. If you’re using this clock in a bedroom you might find the **Dimming** options very useful, as they establish a schedule during which the display will be reduced in brightness.
6768

68-
![app screenshot](https://shetline.com/readme/aw-clock/2.4.0/awc_dlog.png)
69+
![app screenshot](https://shetline.com/readme/aw-clock/2.8.0/awc_dlog.png)
6970

7071
To close the web browser while it’s running in full-screen kiosk mode, press `Alt-F4`, or use the Settings/Quit button if available. To get out of full screen mode, but leave the browser running, press `Alt-F11`.
7172

@@ -77,7 +78,7 @@ With your Raspberry Pi shut down and disconnected from power, connect the DHT22/
7778

7879
*&#42;This default was GPIO 4 (physical pin 7) before version 2.4.0, but the Adafruit GPS HAT is pre-wired to use that pin, hence the new default.*
7980

80-
![Picture of wiring to GPS HAT](https://shetline.com/readme/aw-clock/2.4.0/rpi_with_gps_hat.jpg)
81+
![Picture of wiring to GPS HAT](https://shetline.com/readme/aw-clock/2.8.0/rpi_with_gps_hat.jpg)
8182

8283
Also for the Raspberry Pi you have the option to provide wireless indoor conditions and outdoor weather data using [433 MHz Acu Rite 06002M wireless temperature and humidity sensors](https://www.amazon.com/gp/product/B00T0K8NXC/) paired with a [433 MHz receiver module](https://www.amazon.com/gp/product/B00HEDRHG6/).
8384

@@ -96,17 +97,33 @@ When connecting the 433 MHz receiver module follow the same precautions as speci
9697
* Swipe left or right on the daily forecast to view the full seven-day forecast. You can also tap/click on the left/right arrows on either side of the forecast. *After one minute, the display reverts to the first four (or five) days.*
9798
* Tap/click on a forecast day, and a textual summary (if available) of that day’s weather will appear.
9899
* Tap/click on the rise/set icon, or the rise/set times, to switch between sun and moon rise and set times. *After one minute, the display reverts to sunrise/sunset.*
99-
* Tap/click on the hourly weather icons, or the hourly temperatures, to see hourly probabilities of precipitation. Tap/click again to toggle back to temperatures. *After one minute, the display reverts to hourly temperatures.*
100+
* Tap/click on the hourly weather icons, or the hourly temperatures, to see hourly probabilities of precipitation and wind speed. Tap/click again to toggle back to weather icons and temperatures. *After one minute, the display reverts to weather icons and hourly temperatures.*
100101
* Tap/click on the (sometimes) scrolling banner at the bottom of the screen to see the full text of alert messages without having to wait for them to scroll by.
101102
* Tap/click on the gear icon in the lower right corner of the display to bring up the Settings dialog. An onscreen keyboard option is available. If you answered “Yes” to the set-up question “Allow user to reboot, shutdown, update, etc.?”, extra options for managing your Raspberry Pi will be available.
102103

104+
### Wind speed
105+
106+
<img src="https://shetline.com/readme/aw-clock/2.8.0/wind_barbs.png" width=820 height=55>
107+
108+
Wind speed is displayed using *wind barbs*. When using imperial units, the wind barbs represent wind speed in knots, rounded to the nearest multiple of 5 knots, up to a maximum of 100 knots. In metric mode the wind barbs represent wind speed in meters per second, in increments of 2.5 m/s (in the diagram above, divide the captions by 2 for m/s).
109+
110+
| &nbsp; | Imperial | Metric |
111+
|--------|----------|--------|
112+
| Half barb | 5 knots | 2.5 m/s |
113+
| Full barb | 10 knots | 5 m/s |
114+
| Pennant | 50 knots | 25 m/s |
115+
116+
The barbed ends of the wind barbs point in the direction from which the wind is blowing, with north being upward. Wind gust speed is represented by a red wind barb drawn underneath the non-gust wind barb, such that only the excess gust speed is seen, peeking out from behind.
117+
118+
Current wind speed is also shown as an arc along the edge of the clock face, changing in size and color (from cyan to green, to yellow, to orange, and to red) as wind speed increases. If there is a gust speed, that will show as a second thinner but wider arc. These arcs are centered on the direction from which the wind is coming, with an inward pointer pointing in the direction toward which the wind is blowing. There are no arcs drawn for wind below 2.5 knots (or 1.25 m/s).
119+
103120
### How the planet display works
104121

105-
The circular tracks around the center of the clock face display the ecliptic longitude of the Sun, the Moon, Mercury, Venus, Mars, Jupiter, and Saturn (in that order from the innermost track outward), starting with 0° (the First Point of Aries) at three o’clock, and increasing *counterclockwise* from there. Over time the planets will slowly move around the clock face, mostly moving counterclockwise, but occasionally clockwise when retrograde.
122+
The circular tracks around the center of the clock face display the ecliptic longitude of the Sun, the Moon, Mercury, Venus, Mars, Jupiter, and Saturn (in that order, from the innermost track outward), starting with 0° (the First Point of Aries) at three o’clock, and increasing *counterclockwise* from there. Over time the planets will slowly move around the clock face, mostly moving counterclockwise, but occasionally clockwise when retrograde.
106123

107-
When the symbol for a planet is drawn larger, and it appears on top of one of the green arcs along the planet tracks, this indicates the planet is above the local horizon. Otherwise, it is below the horizon. The clockwise end of each green track represents when the planet rises, and the counter-clockwise end represents when the planet sets.
124+
When the symbol for a planet is drawn larger, and it appears on top of one of the green or purple arcs along the planet tracks, this indicates the planet is above the local horizon. Otherwise, it is below the horizon. The clockwise end of each colored arc represents when the planet rises, and the counter-clockwise end represents when the planet sets. When a planet is on top of the purple portion of an arc, that indicates that the sun is below the horizon at that time &mdash; the planet is therefore in the night sky, and likely visible if twilight doesn’t overpower it.
108125

109-
If a green arc becomes a full circle, that means the corresponding planet on that track is above the horizon all day. If there is no arc at all, the planet is below the horizon all day. (These two situations only occur at extreme northern or southern latitudes.)
126+
If an arc becomes a full circle, that means the corresponding planet on that track is above the horizon all day. If there is no arc at all, the planet is below the horizon all day. (These two situations only occur at extreme northern or southern latitudes.)
110127
<br><br>
111128

112129
### Construction with 3D-Printed Stand
@@ -115,7 +132,7 @@ If a green arc becomes a full circle, that means the corresponding planet on tha
115132

116133
The 3D model for this stand is provided by the project file `raspberry_pi_setup/monitor_stand.stl`. Below is how that model came out when printed using black ABS, 20% infill, at a cost of about $33 USD.
117134

118-
![3D stand rear view](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-01.jpg)
135+
![3D stand rear view](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-01.jpg)
119136

120137
I’m reasonably happy with the results using this stand, but if I did it over again, I’d:
121138

@@ -129,59 +146,59 @@ I’m reasonably happy with the results using this stand, but if I did it over a
129146

130147
For some reason there was a glossy texture on the front of the stand when it was printed, something that looked like a thin film of plastic, the kind you often see as shipping protection, meant to be peeled off. It wouldn’t peel off, however, and it had some unattractive dimples and bubbles that made me want to remove it. I settled for sanding it off on the bottom of the stand.
131148

132-
![3D stand front view](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-02.jpg)
149+
![3D stand front view](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-02.jpg)
133150

134151
<br>
135152

136153
#### Side mounting panel
137154

138155
The side panel has a place to attach a quarter-wave 433 MHz antenna, a clip to hold a 433 MHz receiving module, a hole for a female SMA coaxial connector for GPS, and (on the reverse side) a mounting position for a DHT22/AM2302 temperature/humidity sensor.
139156

140-
![3D stand side panel](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-03.jpg)
157+
![3D stand side panel](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-03.jpg)
141158

142159
<br>
143160

144161
#### Original monitor stand
145162

146163
This is the original stand that came with the 2560x1600 ELECROW 10.1" touchscreen monitor. It’s not a bad stand in general, but, with the Raspberry Pi attached to the back of the monitor, the cables and wires were an awkward fit. The stand had to be skewed off-center quite a bit for it to work at all.
147164

148-
![Original monitor stand](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-04.jpg)
165+
![Original monitor stand](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-04.jpg)
149166

150167
<br>
151168

152169
#### Stand attached to monitor
153170

154171
The stand is attached using 4 M3 x 10 mm wafer-head machine screws. Please note that M4 is the typical size screw for a VESA mount of this size (75 mm square spacing), so it’s a little unusual M3s were needed instead.
155172

156-
![Stand attached to monitor](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-05.jpg)
173+
![Stand attached to monitor](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-05.jpg)
157174

158175
<br>
159176

160177
#### Stand attached to monitor, side view
161178

162-
![Stand attached to monitor, side view](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-06.jpg)
179+
![Stand attached to monitor, side view](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-06.jpg)
163180

164181
<br>
165182

166183
#### Side panel with components attached
167184

168185
The long arm that reaches out from the side panel is designed so the temperature/humidity sensor can be placed at a distance from the heat generated by the Raspberry Pi. The open design is also to prevent heat build-up that an enclosure might cause, which could also skew indoor temperature readings.
169186

170-
![Side panel with components attached](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-07.jpg)
187+
![Side panel with components attached](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-07.jpg)
171188

172189
<br>
173190

174191
#### Raspberry Pi Model 4 attached to stand-offs
175192

176193
I was a bit uncertain how well machine screws would work with the stand-offs that I’d designed, since I wanted them to function like self-tapping screws. As it turned out, the four M2.5 x 6 mm pan-head machine screws fit quite nicely and snuggly, without being difficult to turn. If the Pi were to be repeatedly removed and reattached, however, this design might not be durable enough. For my current purposes, it’s just fine.
177194

178-
![Raspberry Pi Model 4 attached to stand-offs](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-08.jpg)
195+
![Raspberry Pi Model 4 attached to stand-offs](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-08.jpg)
179196

180197
<br>
181198

182199
#### GPS HAT added, and components wired together
183200

184-
![GPS HAT added, and components wired together](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-09.jpg)
201+
![GPS HAT added, and components wired together](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-09.jpg)
185202

186203
<br>
187204

@@ -191,13 +208,13 @@ I was able to find a [single, short HDMI cable](https://www.amazon.com/gp/produc
191208

192209
I couldn’t find a right-angle USB-C cable for hooking up the touchscreen, but I did find a [right-angle adapter](https://www.amazon.com/gp/product/B07JK1G6W2/) and a short [male USB C to male USB A 2.0 cable](https://www.amazon.com/gp/product/B012V56D2A/).
193210

194-
![Monitor connections for HDMI video and USB touchscreen](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-10.jpg)
211+
![Monitor connections for HDMI video and USB touchscreen](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-10.jpg)
195212

196213
<br>
197214

198215
#### Rear view of completed clock project
199216

200-
![finished project](https://shetline.com/readme/aw-clock/2.4.0/aw-clock-w-stand-11.jpg)
217+
![finished project](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-11.jpg)
201218

202219
<br>
203220

img/awc_screenshot.png

142 KB
Loading

img/wind_barbs.png

26 KB
Loading

0 commit comments

Comments
 (0)