I'm not sure if anyone else might find this interesting, but having finally achieved some success I thought I might post about it.
One day while I was playing with a raspberry pi zero in usb host mode (so it appears to be different types of devices to whatever its plugged into), I got the idea to try to build what would appear to be a usb mass storage device, but would not actually have a hard drive or sd card in it per se... It would mount an NFS or CIFS/SMB share and make that appear to be a USB drive to whatever it was plugged in to. That particular dream hasn't worked out very well because the USB host mode gadget ( g_mass_storage ) needs a block device.
But along the way I found out about iSCSI. So what I did was create a 2TB iSCSI target on my Linux server, and configure the Raspberry pi to use open-iscsi to connect to that drive, then it appears as /dev/sda on the raspberry pi. From there I can do this on the pi while it's plugged into the dock of my switch:
and all of the xci's on the iSCSI target appear in the sxos Games and Installer menus as soon as I do that. Wonderful.
It seems like xci cartridge emulation doesn't work for some reason, on the pi everything just hangs, and dmesg shows:
However, installing xci's seems to work fine. It's slow over wifi, but with ethernet added to the pi, it seems to work as well as my external usb hdd.
I hope to figure out why it hangs with xci emulation, and I also plan to figure out if somehow the pi can realize what it's being plugged into and connect to different iSCSI targets accordingly. Like if it's plugged into a switch, mount switch roms. If its plugged into a Wii-U, mount those. If it's plugged into an android device, mount movies and tv? It can also do neat things like scan the filesystem for errors before it makes the drive available to the switch, and switch to a different iSCSI target without unplugging anything.
I thought I would put it out there for discussion if anyone is interested, let me know. It also seems that a USB Y cable is a very good idea because the switch will cause the pi to reboot when it goes to sleep or wakes up.
One day while I was playing with a raspberry pi zero in usb host mode (so it appears to be different types of devices to whatever its plugged into), I got the idea to try to build what would appear to be a usb mass storage device, but would not actually have a hard drive or sd card in it per se... It would mount an NFS or CIFS/SMB share and make that appear to be a USB drive to whatever it was plugged in to. That particular dream hasn't worked out very well because the USB host mode gadget ( g_mass_storage ) needs a block device.
But along the way I found out about iSCSI. So what I did was create a 2TB iSCSI target on my Linux server, and configure the Raspberry pi to use open-iscsi to connect to that drive, then it appears as /dev/sda on the raspberry pi. From there I can do this on the pi while it's plugged into the dock of my switch:
Code:
$ modprobe g_mass_storage file=/dev/sda stall=0
and all of the xci's on the iSCSI target appear in the sxos Games and Installer menus as soon as I do that. Wonderful.
It seems like xci cartridge emulation doesn't work for some reason, on the pi everything just hangs, and dmesg shows:
Code:
[ 4195.555978] dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ebba9a1b ep1in, 0)
[ 4195.556501] dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep 2a080014 ep1out, 0)
However, installing xci's seems to work fine. It's slow over wifi, but with ethernet added to the pi, it seems to work as well as my external usb hdd.
I hope to figure out why it hangs with xci emulation, and I also plan to figure out if somehow the pi can realize what it's being plugged into and connect to different iSCSI targets accordingly. Like if it's plugged into a switch, mount switch roms. If its plugged into a Wii-U, mount those. If it's plugged into an android device, mount movies and tv? It can also do neat things like scan the filesystem for errors before it makes the drive available to the switch, and switch to a different iSCSI target without unplugging anything.
I thought I would put it out there for discussion if anyone is interested, let me know. It also seems that a USB Y cable is a very good idea because the switch will cause the pi to reboot when it goes to sleep or wakes up.