Skip to content

Commit 9b37ca4

Browse files
authored
New 3-D stand (#59)
New 3-D stand and related documentation updates. Code de-linting.
1 parent fb4388d commit 9b37ca4

43 files changed

Lines changed: 1950 additions & 1637 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"jasmine",
2323
"chai-friendly"
2424
],
25-
"ignorePatterns": ["dist/**/*"],
25+
"ignorePatterns": ["dist/**/*", "build.js"],
2626
"rules": {
2727
"brace-style": [
2828
"error",
@@ -43,6 +43,7 @@
4343
}
4444
],
4545
"curly": "off",
46+
"@typescript-eslint/explicit-function-return-type": "error",
4647
"indent": "off",
4748
"@typescript-eslint/indent": [
4849
"error",
@@ -114,5 +115,13 @@
114115
"exceptRange": true
115116
}
116117
]
117-
}
118+
},
119+
"overrides": [
120+
{
121+
"files": ["*.js", "*.cjs"],
122+
"rules": {
123+
"@typescript-eslint/explicit-function-return-type": "off"
124+
}
125+
}
126+
]
118127
}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.11.0
2+
3+
* Updated design of 3-D printed stand.
4+
15
## 2.10.1
26

37
* Fixed a build error caused by an npm library update.
@@ -215,7 +219,7 @@
215219

216220
## 1.0.1
217221

218-
* Fixed gear.svg image so it's compatible with IE. Added MIT license to individual files.
222+
* Fixed gear.svg image, so it's compatible with IE. Added MIT license to individual files.
219223

220224
## 1.0.0
221225

README.md

Lines changed: 33 additions & 31 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.8.0/rpi_logo.svg)
3+
![raspberry pi logo](https://shetline.com/readme/aw-clock/2.11.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,11 +12,11 @@ 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.8.0/aw-clock-w-stand-12.jpg)
15+
![finished project](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-12.jpg)
1616

17-
![app screenshot](https://shetline.com/readme/aw-clock/2.8.0/awc_screenshot.png)
17+
![app screenshot](https://shetline.com/readme/aw-clock/2.11.0/awc_screenshot.png)
1818

19-
![app dst animation](https://shetline.com/readme/aw-clock/2.8.0/spring-forward-480.gif)
19+
![app dst animation](https://shetline.com/readme/aw-clock/2.11.0/spring-forward-480.gif)
2020

2121
<br/><br/>
2222

@@ -58,7 +58,7 @@ Having a back-up weather data source is still, therefore, a good idea. For that
5858

5959
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:
6060

61-
![Hypothetical leap second](https://shetline.com/readme/aw-clock/2.8.0/moment_of_leap_second.jpg)
61+
![Hypothetical leap second](https://shetline.com/readme/aw-clock/2.11.0/moment_of_leap_second.jpg)
6262

6363
_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>_
6464

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

6969
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.
7070

71-
![app screenshot](https://shetline.com/readme/aw-clock/2.8.0/awc_dlog.png)
71+
![app screenshot](https://shetline.com/readme/aw-clock/2.11.0/awc_dlog.png)
7272

7373
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`.
7474

@@ -80,7 +80,7 @@ With your Raspberry Pi shut down and disconnected from power, connect the DHT22/
8080

8181
*&#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.*
8282

83-
![Picture of wiring to GPS HAT](https://shetline.com/readme/aw-clock/2.8.0/rpi_with_gps_hat.jpg)
83+
![Picture of wiring to GPS HAT](https://shetline.com/readme/aw-clock/2.11.0/rpi_with_gps_hat.jpg)
8484

8585
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/).
8686

@@ -105,7 +105,7 @@ When connecting the 433 MHz receiver module follow the same precautions as speci
105105

106106
### Wind speed
107107

108-
<img src="https://shetline.com/readme/aw-clock/2.8.0/wind_barbs.png" width=820 height=55 alt="wind barbs">
108+
<img src="https://shetline.com/readme/aw-clock/2.11.0/wind_barbs.png" width=820 height=55 alt="wind barbs">
109109

110110
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, by default, 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).
111111

@@ -136,92 +136,92 @@ If an arc becomes a full circle, that means the corresponding planet on that tra
136136

137137
#### Rearview of stand
138138

139-
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.
139+
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 $28 USD.
140140

141-
![3D stand rear view](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-01.jpg)
141+
![3D stand rear view](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-01.jpg)
142142

143-
I’m reasonably happy with the results using this stand, but if I did it over again, I’d:
144-
145-
* Make the stand about 0.75" (19 cm) shorter, all of that taken from below the stand-offs for mounting the Raspberry Pi.
146-
* Move the wire pass-through hole for the temperature/humidity sensor forward, so that it was roughly below the hole for the GPS antenna connector — I hadn’t left as much room for the connectors at the ends of the jumpers as I would have liked.
147-
* Move the 433 MHz receiver clip outward, away from the surface of the side panel, to allow more room for the hex nut used to secure the temperature/humidity sensor.
148-
* Add an opening in the side panel for easier access to the SD card slot.
143+
This is my second design of this stand, after making a few improvements from my first design. I made this version shorter, improved wire routing, and added an access hole where (using tweezers) it’s possible to access the SD card slot without disassembling the clock.
149144

150145
<br>
151146

152147
#### Front view
153148

154-
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.
155-
156-
![3D stand front view](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-02.jpg)
149+
![3D stand front view](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-02.jpg)
157150

158151
<br>
159152

160153
#### Side mounting panel
161154

162155
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.
163156

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

166159
<br>
167160

168161
#### Original monitor stand
169162

170163
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.
171164

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

174167
<br>
175168

176169
#### Stand attached to monitor
177170

178171
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.
179172

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

182175
<br>
183176

184177
#### Stand attached to monitor, side view
185178

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

188181
<br>
189182

190183
#### Side panel with components attached
191184

192185
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.
193186

194-
![Side panel with components attached](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-07.jpg)
187+
A small piece of non-conductive foam wedged behind the RF module helps keep the module in place.
188+
189+
![Side panel with components attached](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-07.jpg)<br>
190+
![Side panel with components attached, temp/humidity sensor](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-07b.jpg)
195191

196192
<br>
197193

198194
#### Raspberry Pi Model 4 attached to stand-offs
199195

200196
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 snugly, 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.
201197

202-
![Raspberry Pi Model 4 attached to stand-offs](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-08.jpg)
198+
![Raspberry Pi Model 4 attached to stand-offs](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-08.jpg)
203199

204200
<br>
205201

206202
#### GPS HAT added, and components wired together
207203

208-
![GPS HAT added, and components wired together](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-09.jpg)
204+
![GPS HAT added, and components wired together](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-09.jpg)
209205

210206
<br>
211207

212208
#### Monitor connections for HDMI video and USB touchscreen
213209

214-
I was able to find a [single, short HDMI cable](https://www.amazon.com/gp/product/B07BLX88H4/) with a 90°-down micro HDMI connector on one end. This is great for use with the Pi 4, replacing the two separate cables plugged together I started out with when I got the 4: a short dual HDMI male cable combined with an HDMI-to-micro-HDMI adapter cable.
210+
I was able to find a [single, short HDMI cable](https://www.amazon.com/gp/product/B07BLX88H4/) with a 90°-down micro HDMI connector on one end. This is great for use with the Pi 4, replacing the two separate cables plugged together I started out with when I got the 4: a short dual HDMI male cable combined with an HDMI-to-micro-HDMI adapter cable. I added a full-sized HDMI right-angle adapter as well to improve cable management.
215211

216212
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/).
217213

218-
![Monitor connections for HDMI video and USB touchscreen](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-10.jpg)
214+
The odd reddish-brown object at the end of the USB cable is an adapter that blocks power flow, so the USB connection is a data-only connection. This was needed to because the monitor otherwise supplies power to the Raspberry PI over the USB connector.
215+
216+
While this would actually be a good thing if it meant I could hook up the clock with only one power cable, not two, the power from the monitor only keeps the Raspberry Pi running *after* the Pi has been separately powered up using its own power supply. The result is no simplification of the power connections, but merely making it harder to shut the clock down without adding this power isolating adapter.
217+
218+
![Monitor connections for HDMI video and USB touchscreen](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-10.jpg)
219219

220220
<br>
221221

222222
#### Rearview of completed clock project
223223

224-
![finished project](https://shetline.com/readme/aw-clock/2.8.0/aw-clock-w-stand-11.jpg)
224+
![finished project](https://shetline.com/readme/aw-clock/2.11.0/aw-clock-w-stand-11.jpg)
225225

226226
<br>
227227

@@ -236,8 +236,10 @@ I couldn’t find a right-angle USB-C cable for hooking up the touchscreen, but
236236
* 2 x 433 MHz Acu Rite 06002M wireless temperature and humidity sensors
237237
* 433 MHz receiver module
238238
* [¼-wave 433 MHz antenna](https://www.digikey.com/en/products/detail/linx-technologies-inc/ANT-433-PW-RA/340122)
239-
* Miscellaneous jumper wires, cables, machine screws (some specifics listed above), etc.
240-
* Suggested: SD extension cable for easier access to SD card.
239+
* [Right-angle HDMI adapter](https://www.amazon.com/gp/product/B00Y7UT6EK/)
240+
* [12-inch 90°-down micro HDMI male to HDMI male cable](https://www.amazon.com/gp/product/B07BLX88H4/)
241+
* [USB power blocker](https://www.amazon.com/gp/product/B08VHDKCX3/)
242+
* Miscellaneous other jumper wires, cables, machine screws (some specifics listed above), etc.
241243

242244
<br>
243245

build.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let interactive = false;
5151
let treatAsRaspberryPi = process.argv.includes('--tarp');
5252
let isRaspberryPi = false;
5353

54-
let spin = () => {
54+
let spin = (): void => {
5555
const now = processMillis();
5656

5757
if (lastSpin < now - SPIN_DELAY) {
@@ -342,9 +342,9 @@ async function readUserInput(): Promise<string> {
342342
return new Promise<string>(resolve => {
343343
let buffer = '';
344344
let length = 0;
345-
const clearLine = () => write('\x08 \x08'.repeat(length));
345+
const clearLine = (): void => write('\x08 \x08'.repeat(length));
346346

347-
const callback = (ch: string, key: Key) => {
347+
const callback = (ch: string, key: Key): void => {
348348
if (ch === '\x03') { // ctrl-C
349349
write('^C\n');
350350
process.exit(130);
@@ -501,7 +501,7 @@ function showStep(): void {
501501
write(`Step ${++currentStep} of ${totalSteps}: `);
502502
}
503503

504-
function chalkUp(s: string, currentStyle = (s: string) => s): string {
504+
function chalkUp(s: string, currentStyle = (s: string): string => s): string {
505505
const closed = /(.*?)(\[([a-z]+)])(.*?)(\[\/\3])(.*)/.exec(s);
506506
const open = /(.*?)(\[([a-z]+)])(.*)/.exec(s);
507507

@@ -749,9 +749,9 @@ let questions = [
749749
ask: true
750750
},
751751
{ prompt: 'Use wired DHT temperature/humidity sensor?', ask: true, yn: true, deflt: doDht ? 'Y' : 'N', validate: dhtValidate },
752-
{ name: 'AWC_WIRED_TH_GPIO', prompt: 'GPIO pin number for wired temp/humidity sensor', ask: () => doDht, validate: pinValidate },
752+
{ name: 'AWC_WIRED_TH_GPIO', prompt: 'GPIO pin number for wired temp/humidity sensor', ask: (): boolean => doDht, validate: pinValidate },
753753
{ prompt: 'Use wireless temperature/humidity sensors?', ask: true, yn: true, deflt: doAcu ? 'Y' : 'N', validate: acuValidate },
754-
{ name: 'AWC_WIRELESS_TH_GPIO', prompt: 'GPIO pin number for wireless temp/humidity sensors', ask: () => doAcu, validate: pinValidate },
754+
{ name: 'AWC_WIRELESS_TH_GPIO', prompt: 'GPIO pin number for wireless temp/humidity sensors', ask: (): boolean => doAcu, validate: pinValidate },
755755
{
756756
prompt: `When finished, (l)aunch A/W clock, (r)eboot, or (n)o action ${finalOptions}?`,
757757
ask: true,
@@ -1050,7 +1050,7 @@ async function doServiceDeployment(): Promise<void> {
10501050
stepDone();
10511051
}
10521052

1053-
(async () => {
1053+
(async (): Promise<void> => {
10541054
try {
10551055
uid = Number((await monitorProcess(spawn('id', ['-u', user]))).trim() || '1000');
10561056

img/aw-clock-w-stand-01.jpg

-399 Bytes
Loading

img/aw-clock-w-stand-02.jpg

-12.8 KB
Loading

img/aw-clock-w-stand-03.jpg

-18.4 KB
Loading

img/aw-clock-w-stand-05.jpg

-37.7 KB
Loading

img/aw-clock-w-stand-06.jpg

-23.5 KB
Loading

img/aw-clock-w-stand-07.jpg

-28.7 KB
Loading

0 commit comments

Comments
 (0)