@@ -21,13 +21,15 @@ display and the other devices.
21
21
+ [ Wiring] ( #wiring )
22
22
- [ Schematic] ( #schematic )
23
23
- [ Cable] ( #cable )
24
+ - [ Power Splitter] ( #power-splitter )
24
25
* [ Software] ( #software )
25
- + [ Armbian] ( #armbian )
26
- - [ Custom Devive Tree Overlays] ( #custom-devive-tree-overlays )
27
- + [ Status LED] ( #status-led )
28
- + [ gpsd] ( #gpsd )
29
- + [ chrony] ( #chrony )
30
- + [ fbgpsclock] ( #fbgpsclock )
26
+ + [ Pre-built OS Image] ( #pre-built-os-image )
27
+ + [ Manual Configuration] ( #manual-configuration )
28
+ - [ Armbian] ( #armbian )
29
+ - [ Status LED] ( #status-led )
30
+ - [ gpsd] ( #gpsd )
31
+ - [ chrony] ( #chrony )
32
+ - [ fbgpsclock] ( #fbgpsclock )
31
33
* [ Links] ( #links )
32
34
33
35
## Hardware
@@ -57,8 +59,8 @@ display and the other devices.
57
59
</a ><br />
58
60
<em >side</em ></p >
59
61
60
- There's also [ gallery __ (NSFW)__ ] ( https://imgur.com/a/yd1e8r0 ) with some images
61
- from various stages of testing and building.
62
+ There's also [ a gallery __ (NSFW)__ ] ( https://imgur.com/a/yd1e8r0 ) with some
63
+ images from various stages of testing and building.
62
64
63
65
### Components
64
66
#### Orange Pi Zero
@@ -163,9 +165,9 @@ More details are available at [moonbuggy/GPIO-power-switch][moonbuggy/GPIO-power
163
165
<em >GPIO wiring</em ></p >
164
166
165
167
#### Cable
166
- The specific pins chosen allow us to make a convenient cable to connect the GPS
167
- and TFT modules while leaving the I2C pins clear for the RTC module to plug
168
- directly in.
168
+ The specific pins chosen allow us to make a convenient cable to connect the GPS,
169
+ TFT and power control modules while leaving the I2C pins clear for the RTC
170
+ module to plug directly in.
169
171
170
172
<p ><a href =" images/schematic-cable-2.0inch.png " >
171
173
<img src =" images/schematic-cable-2.0inch.png " width =" 600 " >
@@ -191,8 +193,55 @@ The OPiZ end of the cable will attach to GPIO pins 11 to 26. Using a
191
193
black wire for the ground connection to OPiZ pin 25 provides a convenient way to
192
194
align the connector, regardless of the other wire colours.
193
195
196
+ #### Power Splitter
197
+ <p ><a href =" images/schematic-splitter.png " >
198
+ <img src =" images/schematic-splitter.png " width =" 600 " >
199
+ </a ><br />
200
+ <em >power splitter</em ></p >
201
+
202
+ In an ideal world there'd be enough room in the enclosure to combine this
203
+ splitter and the power control circuit on a single PCB, to save a cable run
204
+ (although it's not a big deal that they're separate).
205
+
206
+ Closing the jumper bypasses the switch in the power control circuit, directly
207
+ connecting the OPiZ and bias tee to ground, and is useful during testing. The
208
+ button and LED in the power control circuit will still work as expected, and
209
+ the MOSFET will still switch, it just won't have any effect and actually cut
210
+ power after a <code >shutdown -h</code > command or button press.
211
+
194
212
## Software
195
- ### Armbian
213
+ ### Pre-built OS Image
214
+ There's a pre-built Armbian image at
215
+ [ moonbuggy/sbc-os-images] ( https://github.com/moonbuggy/sbc-os-images/releases/tag/Armbian-23.11.0-OPiZ-GPS-NTP )
216
+ which will work out of the box for a build using the same (or compatible)
217
+ hardware wired as described above. All the setup and configuration steps below
218
+ have been done during the image creation.
219
+
220
+ Simply write the _ * .img.xz_ file to an SD card, put the card in the OPiZ, power
221
+ it up.
222
+
223
+ GPS devices other than the Neo M8N should work easily with this image, so long
224
+ as they use _ uart2_ (and use _ pin 15_ /_ PA03_ for the PPS signal). A different
225
+ display controller or RTC, however, would be incompatible with the device tree
226
+ in the image.
227
+
228
+ It's possible to re-configure the pre-built OS after first boot, if necessary
229
+ to adjust for differing hardware. Depending on how much modification is needed,
230
+ it may be easier to start with a bare OS and do the manual steps described
231
+ below.
232
+
233
+ #### Packages
234
+ The _ * .deb_ files in the release are packages which can be installed on top of
235
+ an existing Armbian install, as an alternative to the pre-built image.
236
+
237
+ These packages just add the modules necessary for the GPIO power switch to work
238
+ to the kernel. They do not install any GPS/NTP/TFT software or handle any of the
239
+ configuration like the image does.
240
+
241
+ Install with: <code >sudo dpkg -i * .deb</code >
242
+
243
+ ### Manual Configuration
244
+ #### Armbian
196
245
We need to enable the _ i2c0_ , _ pps-gpio_ , _ tve_ and _ uart2_ devices. It probably
197
246
makes sense to enable _ clock-1.2GHz-1.3v_ as well, if it isn't by default. This
198
247
can be done in ` armbian-config ` or by editing _ /boot/armbianEnv.txt_ .
@@ -203,7 +252,7 @@ regardless of how the hardware overlays above are enabled:
203
252
sudo sh -c " echo 'param_pps_pin=PA3' >> /boot/armbianEnv.txt"
204
253
```
205
254
206
- #### Custom Devive Tree Overlays
255
+ ##### Custom Devive Tree Overlays
207
256
The device tree source (DTS) files in this repo for the display are for an
208
257
ST7789V SPI TFT controller with a 240x280 or 240x320 display. They can be
209
258
modified for other resolutions.
@@ -226,7 +275,7 @@ sudo armbian-add-overlay gpio-key-power.dts
226
275
sudo armbian-add-overlay sun8i-h3-gpio-poweroff.dts
227
276
```
228
277
229
- ##### Display Driver Init
278
+ ###### Display Driver Init
230
279
Both DTS files contain a custom init for the driver. This init sequence is based
231
280
off that in the kernel driver (as opposed to that in the ST7789V datasheet,
232
281
which differs in some places), with only the _ VSCSAD (37h): Vertical Scroll
@@ -250,27 +299,27 @@ The _240x320_ DTS is just using the kernel driver's default init unmodified. The
250
299
` init ` section probably doesn't need to be in this DTS, but it's a convenient
251
300
reference for the defaults.
252
301
253
- ### Status LED
302
+ #### Status LED
254
303
If using the [ moonbuggy/GPIO-power-switch] [ moonbuggy/GPIO-power-switch ] module,
255
304
the status LED can be changed from red to green to indicate the device is ready
256
305
by pulling pin 16 (_ PA19_ ) low. In this case we'll indicate 'ready' with a
257
306
systemd service, once both the _ gpsd_ and _ chrony_ services are running.
258
307
259
- ##### /usr/lib/systemd/system/ready.target
308
+ ###### /usr/lib/systemd/system/ready.target
260
309
``` ini
261
310
[Unit]
262
311
Description =System is booted and ready (for toggling status LED)
263
- Requires =chrony.service gpsd.service gpsd.socket multi-user.target
264
- After =chrony.service gpsd.service gpsd.socket multi-user.target
312
+ Requires =fbgpsclock.service chrony.service gpsd.service gpsd.socket multi-user.target
313
+ After =fbgpsclock.service chrony.service gpsd.service gpsd.socket multi-user.target
265
314
AllowIsolate =yes
266
315
```
267
316
268
- ##### /usr/lib/systemd/system/ready-led.service
317
+ ###### /usr/lib/systemd/system/ready-led.service
269
318
``` ini
270
319
[Unit]
271
320
Description =' ready' status indicator LED
272
- After =chrony.service gpsd.service gpsd.socket
273
- Requires =chrony.service gpsd.service gpsd.socket
321
+ After =fbgpsclock.service chrony.service gpsd.service gpsd.socket
322
+ Requires =fbgpsclock.service chrony.service gpsd.service gpsd.socket
274
323
275
324
[Service]
276
325
Type =oneshot
@@ -289,18 +338,18 @@ sudo systemctl enable ready-led
289
338
sudo systemctl set-default ready.target
290
339
```
291
340
292
- ### gpsd
293
- #### Installation
341
+ #### gpsd
342
+ ##### Installation
294
343
``` sh
295
344
sudo apt install gpsd
296
345
297
346
# optional tools
298
347
sudo apt install gpsd-tools pps-tools
299
348
```
300
349
301
- ##### /etc/default/gpsd
350
+ ###### /etc/default/gpsd
302
351
``` ini
303
- # Devices gpsd should collect to at boot time.
352
+ # Devices gpsd should connect to at boot time.
304
353
# They need to be read/writeable, either by user gpsd or the group dialout.
305
354
DEVICES =" /dev/ttyS2 /dev/pps0"
306
355
@@ -326,13 +375,13 @@ sudo systemctl enable gpsd
326
375
sudo systemctl start gpsd
327
376
```
328
377
329
- ### chrony
330
- #### Installation
378
+ #### chrony
379
+ ##### Installation
331
380
``` sh
332
381
sudo apt install chrony
333
382
```
334
383
335
- ##### /etc/chrony/conf.d/gpsd.conf
384
+ ###### /etc/chrony/conf.d/gpsd.conf
336
385
``` ini
337
386
refclock SHM 0 refid NMEA offset 0.110
338
387
refclock PPS /dev/pps0 refid PPS lock NMEA
@@ -347,7 +396,7 @@ The default configuration for the RTC is for chrony to tell the system to set it
347
396
every 11 minutes. To let chrony set the time from the RTC (as a backup if
348
397
there's some issue with the GPS), it needs to be run with the ` -s ` argument.
349
398
350
- ##### /etc/default/chrony
399
+ ###### /etc/default/chrony
351
400
``` sh
352
401
# This is a configuration file for /etc/init.d/chrony and
353
402
# /lib/systemd/system/chrony.service; it allows you to pass various options to
@@ -357,7 +406,7 @@ there's some issue with the GPS), it needs to be run with the `-s` argument.
357
406
DAEMON_OPTS=" -F 1 -r -m -s"
358
407
```
359
408
360
- ### fbgpsclock
409
+ #### fbgpsclock
361
410
The [ fbgpsclock] [ moonbuggy/fbgpsclock ] repo contains software for displaying
362
411
time and GPS information on the TFT display.
363
412
@@ -366,7 +415,7 @@ time and GPS information on the TFT display.
366
415
</a ><br />
367
416
<em >fbgpsclock screenshot</em ></p >
368
417
369
- #### Installation
418
+ ##### Installation
370
419
Check build dependencies are installed (this may not be a complete dependency
371
420
list):
372
421
``` sh
@@ -388,6 +437,7 @@ More detail and configuration information is available at [moonbuggy/fbgpsclock]
388
437
## Links
389
438
### Software
390
439
* [ moonbuggy/fbgpsclock] [ moonbuggy/fbgpsclock ]
440
+ * [ moonbuggy/sbc-os-images] [ moonbuggy/sbc-os-images ]
391
441
392
442
### Hardware
393
443
* [ moonbuggy/GPIO-power-switch] [ moonbuggy/GPIO-power-switch ]
@@ -398,4 +448,5 @@ More detail and configuration information is available at [moonbuggy/fbgpsclock]
398
448
* [ ST7789V] ( https://newhavendisplay.com/content/datasheets/ST7789V.pdf )
399
449
400
450
[ moonbuggy/fbgpsclock ] : https://github.com/moonbuggy/fbgpsclock
451
+ [ moonbuggy/sbc-os-images ] : https://github.com/moonbuggy/sbc-os-images
401
452
[ moonbuggy/GPIO-power-switch ] : https://github.com/moonbuggy/GPIO-power-switch
0 commit comments