# Tux4Pi

<abstract>
This article describes how to use the Tux4Pi
</abstract>

## How to use the USR led

The USR LED is connected to __GPIO7__. This is an example Python script that blinks the USR LED: 

    import RPi.GPIO as GPIO
    import time

    # Use BCM GPIO numbering
    GPIO.setmode(GPIO.BCM)

    # GPIO pin where the LED is connected
    LED_PIN = 7

    # Set the GPIO pin as output
    GPIO.setup(LED_PIN, GPIO.OUT)

    try:
        while True:
            # Turn LED ON
            GPIO.output(LED_PIN, GPIO.HIGH)
            time.sleep(0.5)

            # Turn LED OFF
            GPIO.output(LED_PIN, GPIO.LOW)
            time.sleep(0.5)

    except KeyboardInterrupt:
        # Handle CTRL+C gracefully
        print("Program interrupted by user")

    finally:
        # Reset GPIO settings before exiting
        GPIO.cleanup()

## How to use the NVMe disk

Type <code>lspci</code>:

    00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2711 PCIe Bridge (rev 20)
    01:00.0 Non-Volatile memory controller: SK hynix BC901 NVMe Solid State Drive (DRAM-less) (rev 03)

Type <code>lsblk</code>:

    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    loop0         7:0    0   760M  0 loop 
    mmcblk0     179:0    0   7.4G  0 disk 
    ├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
    └─mmcblk0p2 179:2    0   6.9G  0 part /
    zram0       254:0    0   906M  0 disk [SWAP]
    nvme0n1     259:0    0 238.5G  0 disk 
    ├─nvme0n1p1 259:1    0    16M  0 part 
    └─nvme0n1p2 259:2    0 238.5G  0 part

Type <code>dmesg | grep -i nvme</code>

    [    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  smsc95xx.macaddr=2C:CF:67:20:42:2B vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 root=PARTUUID=0643e567-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=GB
    [    1.013119] nvme nvme0: pci function 0000:01:00.0
    [    1.013167] nvme 0000:01:00.0: enabling device (0000 -> 0002)
    [    1.032223] nvme nvme0: min host memory (64 MiB) above limit (0 MiB).
    [    1.044937] nvme nvme0: 4/0/0 default/read/poll queues
    [    1.057354]  nvme0n1: p1 p2
    [   10.552770] nvme nvme0: using unchecked data buffer
    [   10.582867] block nvme0n1: No UUID available providing old NGUID


## Enable the console port

Add this line to <code>/boot/firmware/config.txt</code>

    enable_usart=1

Add this parameter to <code>/boot/firmware/cmdline.txt</code>

    console=serial0,115200


## Download

* [Tux4Pi Product Datasheet by F2 Consulting](./TUX4PI_Datasheet.pdf)