Skip to content

Instantly share code, notes, and snippets.

@MartinRGB
Last active November 8, 2023 13:36
Show Gist options
  • Save MartinRGB/2d5da4badc1aff7794f020e30fc2cc09 to your computer and use it in GitHub Desktop.
Save MartinRGB/2d5da4badc1aff7794f020e30fc2cc09 to your computer and use it in GitHub Desktop.
NanoPi Duo2 Init
@MartinRGB
Copy link
Author

rror: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

solution:

sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED

@MartinRGB
Copy link
Author

@MartinRGB
Copy link
Author

wiringNP

Add Duo Support

friendlyarm/WiringNP#5

@MartinRGB
Copy link
Author

MartinRGB commented Oct 31, 2023

with ILI9341

image

reference:
https://www.youtube.com/watch?v=tqfh4gD0zCw

/boot/armbianEnv.txt

verbosity=1
bootlogo=false
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
rootdev=UUID=436d4e55-8407-4f7b-b8b0-8baee2572628
rootfstype=ext4
user_overlays=ili9341_test
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

ili9341_test.dts

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";
    fragment@0 {
        target = <&spi1>;
        __overlay__ {
            status = "okay";
            #address-cells = <1>;
            #size-cells = <0>;
            ili9341: ili9341@0{
                compatible = "ilitek,ili9341";
                reg = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&ili9341_pins>;

                spi-max-frequency = <16000000>;
                rotate = <90>;
                bgr;
                fps = <33>;
                buswidth = <8>;
                dc-gpios = <&pio 0 12 0>;
                debug = <0>;
            };
        };
    };

    fragment@1 {
        target = <&pio>;
        __overlay__ {
            ili9341_pins: ili9341_pins {
                pins = "PA12";
                function = "gpio_out";
            };
        };
    };
};

armbian-add-overlay ili9341_test.dts

@MartinRGB
Copy link
Author

auto login

sudo systemctl enable [email protected]

in /lib/systemd/system/[email protected]/20-autologin.conf

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM

@MartinRGB
Copy link
Author

MartinRGB commented Oct 31, 2023

@MartinRGB
Copy link
Author

MartinRGB commented Nov 2, 2023

reference:

https://www.kernel.org/doc/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt
https://github.com/notro/fbtft/wiki/fbtft_device#parameters

(color was inverted)

st7789_test.dts

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";
    fragment@0 {
        target = <&spi1>;
        __overlay__ {
            status = "okay";
            #address-cells = <1>;
            #size-cells = <0>;
            st7789: st7789@0{
                compatible = "sitronix,st7789v";
                reg = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&st7789_pins>;

                spi-max-frequency = <16000000>;
                rotate = <90>;
                bgr;
                spi-cpol;
                spi-cpha;
                fps = <33>;
                buswidth = <8>;
                dc-gpios = <&pio 0 12 0>;
                debug = <0>;
            };
        };
    };

    fragment@1 {
        target = <&pio>;
        __overlay__ {
            st7789_pins: st7789_pins {
                pins = "PA12";
                function = "gpio_out";
            };
        };
    };
};

@MartinRGB
Copy link
Author

MartinRGB commented Nov 5, 2023

font-size

sudo dpkg-reconfigure console-setup
Terminus
6x12

xorg openbox

sudo apt-get install xorg openbox

@MartinRGB
Copy link
Author

MartinRGB commented Nov 6, 2023

Ethernet

I just bought a Milk-V Duo board with HR91105A 5pinS

gtogto/nanoPi-Duo2#2

@MartinRGB
Copy link
Author

56-RJ45-8p8c

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment