I have a requirement to automatically transfer data from handheld measurement devices located on vessels at sea, to a network folder on the vessel. There are two types of devices located on the vessels:
Android
Normal phone with latest Android, connected via Wifi to vessel networks
MQTT/USB
The second device currently connects via USB and the operator drags and drops files from the unit to the dedicated network folder. It is capable of auto-sending an MQTT stream when in range of the WIFI, but this does not help with transfer of the full data files. For this we would need MQTT File Transfer. Or alternatively, if Syncthing can auto-detect when the unit is plugged into a USB port, it will detect it and automatically move the full data files to the network folder.
Is any of the above possible?
Many thanks in advance
Brian
With a normal Syncthing setup, no, afraid not. The normal expectation is that each linked device runs Syncthing – i.e. the vessel’s file server, Android phone, device connected to the MQTT/USB.
What OS is running on the device connected to the MQTT/USB?
What type of network folder is being used? (e.g. SMB/CIFS)
The vessel server and Android device can definitely have Syncthing installed, so I guess it can run there Ok.
The MQTT enabled device does not has an OS per se, probably a proprietary OS from the OEM, but is recognised as a Flash Drive when plugged into a USB slot.
Just need to configure Syncthing as though you have a closed network without internet access (i.e. no access to Syncthing’s global discovery servers and network of volunteer relay servers).
Ideally, when the MQTT-enabled device switches to USB storage mode the drive isn’t read-only.
If so, and Syncthing (or perhaps you) can create Syncthing’s marker folder on the MQTT-enabled device, then the PC it’s plugged into can use Syncthing to sync the data files to the vessel’s file server.
Whenever the MQTT-enabled device is unplugged from the PC, Syncthing on the PC will present an error that the source folder is missing, but it’ll automatically recover once it’s plugged back in.
However, if the MQTT-enabled device appears as a read-only USB flash drive, then you’ll have to use the recommended solution in Syncthing’s FAQ and also start/stop the sync only when the drive is plugged in.
If the file system presents as read only, the folder can still be synced assuming there is another folder that’s always present on the USB “drive”. It’s an advanced setting but you can change the name of the folder syncthing uses as the marker.
The device has a fixed folder structure, we can copy and paste via Explorer to the unit, and the files in question will always be in the same named folder, so I think this my be a workable solution.