Rocp PI E - OTG with Debian Buster

Hi Everyone,

Does anyone knows how to enable the USB Mass Storage OTG in the Debian Buster? I have seen a post on Armbian. I don’t even know what is the difference between all the distribution, just looking for the more stable and lightweight.

Thank you,
Armandooooo

Putting what I am doing:
-Switch to super user mode
$ sudo su

-Open the WIFI
$ nmcli r wifi on

-Scan WIFI
$ nmcli dev wifi

-Connect to WIFI network (mkr5kqxrBmdr)
$ nmcli dev wifi connect “wifi_name” password “wifi_password”

-Edit /boot/uEnv.txt with overlays=rk3328-uart2 rk3328-usb-otg
$ nano /boot/uEnv.txt

-Update package list (apt full-upgrade kills the g_mass_storage)
$ apt update
$ apt full-upgrade

$ sudo apt-get install -y rockchip-overlay
$ sudo apt-get install -y linux-4.4-rock-pi-e-latest

NO NEED-Install Device-Tree-Compiler
$apt install device-tree-compiler

https://docs.armbian.com/#what-is-armbian

NO NEED-Convert DTB to DTS
dtc -I dtb /boot/dtbs/4.4.194-17-rockchip-g07288d4ebac7/rockchip/rk3328-rock-pi-e.dtb -O dts -o /boot/dtbs/4.4.194-17-rockchip-g07288d4ebac7/rockchip/rk3328-rock-pi-e.dts

NO NEED-Modify rk3328-rock-pi-e.dts
nano /boot/dtbs/4.4.194-17-rockchip-g07288d4ebac7/rockchip/rk3328-rock-pi-e.dts

NO NEED-Locate section usb@ff580000
NO NEED-Modify dr_mode
Change
dr_mode = “host”;
To
dr_mode = “otg”;

NO NEED-Convert DTS file back to DTB format
dtc -I dts /boot/dtbs/4.4.194-17-rockchip-g07288d4ebac7/rockchip/rk3328-rock-pi-e.dts -O dtb -o /boot/dtbs/4.4.194-17-rockchip-g07288d4ebac7/rockchip/rk3328-rock-pi-e.dtb

NO NEED-Add g_ether module
sudo nano /etc/modules
NO NEED-Add the following to /etc/modules
g_ether

I continue my journey in trying to make my device a virtual usb drive.
-Create a file of 512MB
sudo dd bs=1M if=/dev/zero of=/piusb.bin count=512 status=progress
-Install the tools to create FAT 32 filesystem
apt-get install dosfstools
-Format the file in FAT 32
sudo mkfs.fat /piusb.bin -F 32 -I
-or format ext4 without journal:
mkfs.ext4 -t ext4 /piusb.bin -O ^has_journal
NO NEED-Change the /etc/modules from g_ether to g_mass_storage
sudo nano /etc/modules
NO NEED-Replace g_ether to g_mass_storage
g_mass_storage
-Reboot
shutdown -r 0
-Enable usb mass storage with the file:
sudo modprobe g_mass_storage file=/piusb.bin stall=0 removable=1 ro=1
-Create mounting point:
sudo mkdir /mnt/usb_share
sudo mount /piusb.bin /mnt/usb_share
-Install web downloader
apt-get install wget
-Copy a file:
cd /mnt/usb_share
wget https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4
sync
-Connect the usb OTG to the computer:
I got an error from windows telling it cannot recognize the device and that was due to wrong D+ & D- pin assignment. After swapping the pins it is all good.

Things that must be fixed is I cannot make the g_mass_storage automatic as it does not perform the command in /etc/modules… If someone can help.

Thank you
Armandooooo

-Continuing on the SAMBA share connection:
cd mnt
cd usb_share
mkdir games
sudo mount -t cifs “//192.168.0.10/games” “/mnt/usb_share/games” -o username=admin

It works but it did not expose the share to the mass storage in windows afterward. Need to look into this.

-Trying now to connect to a iSCSI drive
sudo apt install open-iscsi
cd /etc/iscsi
nano initiatorname.iscsi
-Update the file with the initiator IQN
nano iscsid.conf
-Uncomment the following:
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password
-Restart de iscsi driver:
sudo systemctl restart iscsid open-iscsi

-Unfortunately it failed.
-If it was working I would then continue with (iqn.2004-04.com.qnap:ts-453pro:iscsi.nsw.ef0d6e)
sudo iscsiadm -m discovery -t sendtargets -p IP_Address
sudo iscsiadm --mode node --targetname IQN_Target --portal IP_Address --login

For USB Mass Storage, can you check this guide, https://wiki.radxa.com/RockpiE/dev/usb-mass-storage and test again?

About Samba, I follow this guide https://wiki.radxa.com/RockpiE/Samba .
And make a new folder to share, it work to be shared successfully.

Hi Stephen,

This works perfect, it is even easier than the other solution that was suggested in the another post.

Thank you very much.
Armandooooo