mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Legacy RPi functionality + documentation
This commit is contained in:
@@ -4,3 +4,4 @@ src/seedsigner.egg-info/
|
|||||||
.nova
|
.nova
|
||||||
.vscode
|
.vscode
|
||||||
src/seedsigner/models/settings_definition.json
|
src/seedsigner/models/settings_definition.json
|
||||||
|
.idea
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ If you have specific questions about the project, our [Telegram Group](https://t
|
|||||||
|
|
||||||
To build a SeedSigner, you will need:
|
To build a SeedSigner, you will need:
|
||||||
|
|
||||||
* Raspberry Pi Zero (preferably version 1.3 with no WiFi/Bluetooth capability, but any Raspberry Pi 2/3/4 or Zero model will work)
|
* Raspberry Pi Zero (preferably version 1.3 with no WiFi/Bluetooth capability, but any Raspberry Pi 2/3/4 or Zero model will work, Raspberry Pi 1 devices will require a hardware modification to the Waveshare LCD Hat, as per the [instructions here](./docs/legacy_hardware.md))
|
||||||
* Waveshare 1.3" 240x240 pxl LCD (correct pixel count is important, more info at https://www.waveshare.com/wiki/1.3inch_LCD_HAT)
|
* Waveshare 1.3" 240x240 pxl LCD (correct pixel count is important, more info at https://www.waveshare.com/wiki/1.3inch_LCD_HAT)
|
||||||
* Pi Zero-compatible camera (tested to work with the Aokin / AuviPal 5MP 1080p with OV5647 Sensor)
|
* Pi Zero-compatible camera (tested to work with the Aokin / AuviPal 5MP 1080p with OV5647 Sensor)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
@@ -0,0 +1,22 @@
|
|||||||
|
# Legacy Hardware Modifications
|
||||||
|
|
||||||
|
Older Raspberry Pi devices have a smaller GPIO header, 26 pin as opposed to the 40 pin header found on more recent models. The Waveshare LCD hat uses some of the pins between 26 and 40 for the buttons, meaning that these will need to be reassigned (and remapped in software) when used with an older device.
|
||||||
|
|
||||||
|
## Hardware Changes
|
||||||
|
|
||||||
|
A suggested remapping can be found here:
|
||||||
|

|
||||||
|
|
||||||
|
This remapping can be done by soldering wires on to the Waveshare hat as below:
|
||||||
|

|
||||||
|
|
||||||
|
Alternatively, you could do this by connecting the LCD hat on with individual breadboard jumper wires.
|
||||||
|
|
||||||
|
Once you have re-mapped the pins, it is advised to do an IO Test to ensure that everything works.
|
||||||
|
|
||||||
|
**Warning: Some of the GPIO pins on contain 5 volt output. Raspberry Pi GPIO pins are NOT 5V tolerant, meaning that if you accidentally connect a 5V supply pin to a GPIO input pin, you risk permanent damage.**
|
||||||
|
|
||||||
|
## Software Changes
|
||||||
|
The Seedsigner software will automatically detect which hardware revision you are using and if the older hardware is detected, will remap the software to match the above modifications to the Waveshare hat.
|
||||||
|
|
||||||
|
If you are using a pre-built Seedsigner image that hasn't yet has this incorporated, you can simply take the file "buttons.py" (/src/seedsigner/hardware/ int his repository) and overwrite same file on your Seedsigner SD card. (The easiest way to do this is to copy it on to the /boot/ partitition of the SD card then copy it over via the command line while connected to your Pi via monitor+keyboard) O
|
||||||
@@ -3,8 +3,9 @@ import time
|
|||||||
|
|
||||||
from seedsigner.models.singleton import Singleton
|
from seedsigner.models.singleton import Singleton
|
||||||
|
|
||||||
|
|
||||||
class HardwareButtons(Singleton):
|
class HardwareButtons(Singleton):
|
||||||
|
if GPIO.RPI_INFO['P1_REVISION'] == 3: #This indicates that we have revision 3 GPIO
|
||||||
|
print("Detected 40pin GPIO (Rasbperry Pi 2 and above)")
|
||||||
KEY_UP_PIN = 6
|
KEY_UP_PIN = 6
|
||||||
KEY_DOWN_PIN = 19
|
KEY_DOWN_PIN = 19
|
||||||
KEY_LEFT_PIN = 5
|
KEY_LEFT_PIN = 5
|
||||||
@@ -15,6 +16,17 @@ class HardwareButtons(Singleton):
|
|||||||
KEY2_PIN = 20
|
KEY2_PIN = 20
|
||||||
KEY3_PIN = 16
|
KEY3_PIN = 16
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Assuming 26 Pin GPIO (Raspberry P1 1)")
|
||||||
|
KEY_UP_PIN = 3
|
||||||
|
KEY_DOWN_PIN = 17
|
||||||
|
KEY_LEFT_PIN = 2
|
||||||
|
KEY_RIGHT_PIN = 22
|
||||||
|
KEY_PRESS_PIN = 4
|
||||||
|
|
||||||
|
KEY1_PIN = 23
|
||||||
|
KEY2_PIN = 18
|
||||||
|
KEY3_PIN = 14
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_instance(cls):
|
def get_instance(cls):
|
||||||
@@ -165,6 +177,7 @@ class HardwareButtons(Singleton):
|
|||||||
# TODO: Implement `release_lock` functionality as a global somewhere. Mixes up design
|
# TODO: Implement `release_lock` functionality as a global somewhere. Mixes up design
|
||||||
# patterns to have a static constants class plus a settable global value.
|
# patterns to have a static constants class plus a settable global value.
|
||||||
class HardwareButtonsConstants:
|
class HardwareButtonsConstants:
|
||||||
|
if GPIO.RPI_INFO['P1_REVISION'] == 3: #This indicates that we have revision 3 GPIO
|
||||||
KEY_UP = 6
|
KEY_UP = 6
|
||||||
KEY_DOWN = 19
|
KEY_DOWN = 19
|
||||||
KEY_LEFT = 5
|
KEY_LEFT = 5
|
||||||
@@ -173,6 +186,16 @@ class HardwareButtonsConstants:
|
|||||||
KEY1 = 21
|
KEY1 = 21
|
||||||
KEY2 = 20
|
KEY2 = 20
|
||||||
KEY3 = 16
|
KEY3 = 16
|
||||||
|
else:
|
||||||
|
KEY_UP = 3
|
||||||
|
KEY_DOWN = 17
|
||||||
|
KEY_LEFT = 2
|
||||||
|
KEY_RIGHT = 22
|
||||||
|
KEY_PRESS = 4
|
||||||
|
KEY1 = 23
|
||||||
|
KEY2 = 18
|
||||||
|
KEY3 = 14
|
||||||
|
|
||||||
OVERRIDE = 1000
|
OVERRIDE = 1000
|
||||||
|
|
||||||
ALL_KEYS = [
|
ALL_KEYS = [
|
||||||
|
|||||||
Reference in New Issue
Block a user