Your findings are correct and there is no general solution that can help. Sorry.
I can only rephrase what you said:
Either they have a write protector switch or they don't
File System level protection that can vary between OSs and implementations
Microchip/key specific features, no easy way to know in advance - typically you would ask and get it manufactured to the specification e.g. I had one client who purchased some that were locked to read only after being duplicated. There was no way around this.
Basically USB protocol requires one device to act as a Master, and others as Slaves. Master-master connections are not supported. Master devices typically have A-type connectors: computers, photo frames that support external USB media, etc. Slaves are your typical USB sticks, mice, etc. Master supplies power to slave over USB bus.
To cloud the water, USB OTG specification allows devices that support it to behave both as a master and as a slave (some Android phones, etc.).
Your photo frame is a master device, you need your Raspberry Pi acting as a slave. As far as I know, it is rather tricky, if possible at all: As a computer, Raspberry Pi supports USB master mode, but apparently USB slave mode also should be possible on some devices. Quoting the forum you mentioned in your question:
The model B has a built in 2 port USB hub, which does not know how to act as a USB device. The model A directly connects the processor USB interface, which can be configured either as a USB device or USB host.
Obviously, that won't work until people have Model A's to develop on, and someone has the talent, the time, the inclination, and the documentation, to write the device driver.
Bit-banging a slow speed USB device over GPIO should be possible on the model B.
This all will require some very significant hacking, many hours of programming/debugging time. In my opinion, waste of time.
My suggestion: Throw out your photo frame, get some second-hand/cheap small LCD display, connect it to your Raspberry Pi and use it as a photo frame. Much easier, faster, etc.
Best Answer
I know that this post is quite old but I've stumbled across it when I was looking for a solution for the same problem. I haven't seen a ready-made solution that you can buy, but several do it yourself (DIY) approaches.
Those DIY approaches are therefore all based on building your own "adapter". The adapter is a Linux-based computer, e.g. a single-board computer (SBC) such as the Raspberry Pi. It acts as a USB mass storage device ("flash drive") to your smart TV on the one side and accesses (read and write) a network attached data storage (NAS) on the other side.
Matt Olan has realized this approach earlier this year when he has tried to store games and backups of his PlayStation 4 earlier this year: https://matt.olan.me/making-a-piscsi-usb-drive-part-1/ and https://matt.olan.me/making-a-piscsi-usb-drive-part-2/ - he has also done some performance measurements.
Getting started with an installation of the Linux operating system (OS) on the SBC
If you use a Raspberry Pi based SBC you should start with a Linux installation. The current version of the Raspberry Pi OS (previously called Raspbian) can be downloaded from https://www.raspberrypi.org/software/.
You can then also follow the guide on https://www.raspberrypi.org/documentation/configuration/wireless/headless.md to set up your Raspberry Pi headlessly, i.e. you can already modify the contents (the boot folder) on the SD card. You can also start with SSH being enabled (by creating a new empty file named
ssh
inside the boot directory). Then useraspi-config
to change further settings.Providing a mass storage device to your smart TV
Usually a computer acts as a USB host. What we need here instead is a computer acting as a USB slave device. The hardware of the computer needs to provide a USB On-The-Go (OTG) port. In Linux speak this kind of system is also called a USB gadget. You will need to modify your Linux installation.
The USB driver
dwc2
needs to be used in/boot/config.txt
and/etc/modules
.The "Mass Storage Gadget" (MSG) is used here. It "provides support for the USB Mass Storage class. It can appear to a host as a set of up to 8 SCSI disk drives (called Logical Units often referred to as LUNs, even though it technically stands for Logical Unit Number), although most of the time a single LUN is all you will need. The information stored for each LUN must be maintained by the gadget somewhere, either in a normal file or in a block device such as a disk partition or even a ramdisk. This file or block device is called the backing storage for the gadget (...)." (source: http://www.linux-usb.org/gadget/file_storage.html)
The module
g_mass_storage
is loaded viamodprobe
pointing to that backing storage:sudo modprobe g_mass_storage file=/dev/sd... stall=0
We will use a block device as provided via iSCSI, see below.
(There's also a nice article about only making the Pi Zero W a USB flash drive, so without the connection to the NAS on the other side. Some parts still apply for our scenario: https://magpi.raspberrypi.org/articles/pi-zero-w-smart-usb-flash-drive - Hint: If you take this approach make sure that your container file is large enough for your Smart TV. I just discovered that my LG TV only accepts flash drives with a capacity of at least 4 GBytes.)
Acessing your NAS
Limitation: You cannot directly provide access to a directory shared in the network as a backing storage for the gadget. The underlying communication protocol of your NAS often is Server Message Block (SMB) or Common Internet File System (CIFS) or Network File System (NFS).
"The g_mass_storage module needs a block device or a flat file, most network shares aren't either." (source: https://www.raspberrypi.org/forums/viewtopic.php?t=220468)
Instead, it requires your NAS to provide an iSCSI, an Internet Small Computer Systems Interface, "an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. It provides block-level access to storage devices by carrying SCSI commands over a TCP/IP network. iSCSI is used to facilitate data transfers over intranets (...)." (source: https://en.wikipedia.org/wiki/ISCSI)
As it is based on TCP/IP networks, it is basically independent from the underlying link layer, i.e. you should be able to access it both via a wired Ethernet connection or wireless Wi-Fi. This depends on your local setup. Keep in mind, that the throughput via Ethernet should be higher.
You need to ask your NAS' user manual on how to enable it as an iSCSI target.
On the SBC running Linux, you need to perform some more steps to initiate an iSCSI connection to your NAS. Matt Olan has a pretty nice description in the "Method" section of https://matt.olan.me/making-a-piscsi-usb-drive-part-1/ - it also describes the previous steps of setting up the mass storage gadget as sketched above.
Hardware selection hints
Alternate way without iSCSI support
If your NAS does not provide an iSCSI, a different approach can be taken. The files on the NAS are accessed via SMB.
But, as mentioned earlier, SMB access is not supported with
g_mass_storage
and this is why we need to take a work-around:dd
,fdisk
andmkdosfs
(for partitioning and creation of a FAT32 filesystem; the settings like sectors and cylinders should be chosen to matchg_mass_storage
and your file)mount -t vfat
)The drawback of this approach is that you need to synchronize/schedule accesses to the backing storage. Copying the data from A to B and vice versa will take some time and you will need additional steps to automate this.
Other attempts