Rock Pi 4C plus Installation - marcone/teslausb GitHub Wiki

Hardware requirements:

  • a Rock Pi 4C+. Note that there are several "Rock Pi 4" variants, but only the Rock Pi 4C+ is specified to work when powered from a regular USB port.
  • a micro sd card. 128 GB or larger is recommended
  • a USB3-A-to-A cable to connect the topmost USB-3 (blue) port to the car
  • a USB-A-to-C cable to power the Rock Pi 4C+
  • a USB3 hub or Y-cable to allow connecting the above two cable to a single USB port. If you'll be using the car's glovebox USB power, there are USB hubs available specifically for allowing multiple devices to be connected to the single glovebox USB port
  • optional: a micro-HDMI cable to connect a display to the Rock Pi 4C+
  • optional: a USB-to-TTL-serial adapter to access the Rock Pi 4C+ serial console

Software requirements

Latest tested image: Armbian_23.11.1_Rockpi-4cplus_bookworm_current_6.1.63.img.xz

If you choose to use a different image, be sure to use an image that supports the Rock Pi 4C+. The images linked directly on the Armbian Rock Pi 4 page do not support the "+" variant, you must follow the link at the bottom of the page to the 4C+ specific images. Note that the community images do not currently have working USB OTG.

Latest tested community images: Armbian_community_25.11.0-trunk.302_Rockpi-4cplus_trixie_current_6.12.51_minimal.img.xz

Steps to install (Armbian_23.11.1_Rockpi-4cplus_bookworm_current_6.1.63.img.xz):

  • download the Armbian image linked above
  • flash the Armbian image onto an sd card
  • insert the sd card into Rock Pi 4C+'s sd card slot
  • power up the Rock Pi 4C+ by connecting its USB-C port to an appropriate power source such as a computer's USB port, a phone charger, or a portable power bank
  • log in to the Rock Pi 4C+ as "root" using the default Armbian root password "1234". You will be prompted to change the password, and configure a few initial Armbian settings. When prompted to choose the default system command shell, choose "bash"
    • if you connect the Rock Pi 4C+ using ethernet, you should be able to log in to it remotely via ssh.
    • if you have a USB to TTL serial adapter (this one works), you can connect to the Rock Pi 4C+'s serial console using e.g. PuTTY
    • if you have neither ethernet nor serial available, you must connect a keyboard and display to the Rock Pi 4C+ and log in via the console. You will need a micro-hdmi cable to connect a display to the Rock Pi 4C+
  • once you're past the initial Armbian setup and have a root shell prompt, run nmtui to configure wifi
  • once wifi is configured, verify that you can ssh into the Rock Pi 4C+ via ssh, as root, using the password you chose earlier
  • once logged in to the Rock Pi 4C+ again, run curl https://raw.githubusercontent.com/marcone/teslausb/main-dev/setup/generic/install.sh | bash
  • after a few minutes, both the green and blue LEDs on the Rock Pi 4C+ should start flashing rapidly
  • log in to the Rock Pi 4C+ again as root
  • edit the TeslaUSB config file: nano /teslausb/teslausb_setup_variables.conf You can use any editor you like, but may have to install it first. You do not have to fill out the SSID and WIFIPASS values, since you already configured wifi earlier.
  • when you've filled out all the required entries in the config file, save and exit, and run /etc/rc.local Setup should now begin, logging progress to the console. If the device reboots during setup, you can log in again and run tail -f /teslausb/teslausb-headless-setup.log to follow setup progress. Once setup is complete, it should print "All done" and reboot one final time.

Steps to install (Armbian_community_25.11.0-trunk.302_Rockpi-4cplus_trixie_current_6.12.51_minimal.img.xz):

  • download the Armbian image linked above
  • flash the Armbian image onto an sd card
  • insert the sd card into Rock Pi 4C+'s sd card slot
  • power up the Rock Pi 4C+ by connecting its USB-C port to an appropriate power source such as a computer's USB port, a phone charger, or a portable power bank
  • log in to the Rock Pi 4C+ as "root" using the default Armbian root password "1234". You will be prompted to change the password, config wifi, create a new user account and configure a few initial Armbian settings.
    • if you connect the Rock Pi 4C+ using ethernet, you should be able to log in to it remotely via ssh.
    • if you have a USB to TTL serial adapter (this one works), you can connect to the Rock Pi 4C+'s serial console using e.g. PuTTY
    • if you have neither ethernet nor serial available, you must connect a keyboard and display to the Rock Pi 4C+ and log in via the console. You will need a micro-hdmi cable to connect a display to the Rock Pi 4C+
  • by this point, you should have a root shell prompt and connected to wifi
  • To config additional wifi, run armbian-config to configure additional wifi
  • Install libsensor to display cpu temperature. apt-get update && apt-get install libsensors5
  • Install your preferred text editor (nano/vim). apt-get install nano vim
  • The stock image does not have usb device controller. Next step is to config the controller.
    • create nano /boot/dtb/rockchip/overlay/dwc3-0-device.dts
/dts-v1/;
/plugin/;

/ {
        compatible = "rockchip,rk3399";

        fragment@0 {
                target = <&usbdrd_dwc3_0>;
                __overlay__ {
                        dr_mode = "peripheral";
                        compatible = "snps,dwc3";
                        reg = <0x0 0xfe800000 0x0 0x100000>;
                        phys = <&tcphy0_usb3>;
                        phy-names = "usb3-phy";
                        phy_type = "utmi_wide";
                        snps,dis_enblslpm_quirk;
                        snps,dis-u2-freeclk-exists-quirk;
                        snps,dis_u2_susphy_quirk;
                        snps,dis-del-phy-power-chg-quirk;
                        snps,xhci-slow-suspend-quirk;
                };
        };
};
  • run armbian-add-overlay /boot/dtb/rockchip/overlay/dwc3-0-device.dts
  • reboot and verify that you can ssh into the Rock Pi 4C+ via ssh, as root, using the password you chose earlier
  • once logged in to the Rock Pi 4C+ again, run curl https://raw.githubusercontent.com/marcone/teslausb/main-dev/setup/generic/install.sh | bash
  • after a few minutes, both the green and blue LEDs on the Rock Pi 4C+ should start flashing rapidly
  • log in to the Rock Pi 4C+ again as root
  • edit the TeslaUSB config file: nano /teslausb/teslausb_setup_variables.conf You do NOT have to fill out the SSID and WIFIPASS values, since you already configured wifi earlier.
  • when you've filled out all the required entries in the config file, save and exit, and run /etc/rc.local Setup should now begin, logging progress to the console. If the device reboots during setup, you can log in again and run tail -f /teslausb/teslausb-headless-setup.log to follow setup progress. Once setup is complete, it should print "All done" and reboot one final time.
  • during bootup, systemd-networkd-wait-online will wait for 2 mins then timeout. To disable systemd-networkd-wait-online, run bin/teslausb_remountrw, then systemctl mask systemd-networkd-wait-online.service to disable systemd-networkd-wait-online.