So I now I have Nameko microservices running on a Raspberry Pi and it all works beautifully. One service controls and Arduino and the other controls a Nikon camera with gphoto2.
The camera produces image files and these are downloaded by one of the services onto the Raspberry pi using one of the gphoto2 options. But now the files are on the Raspberry Pi and the main calling programme is running on a desktop. Is it possible to use Nameko to transfer the files from the Raspberry Pi to the main machine,or do I need to use another protocol like ftp or ssh?
You can use simple HTTP based file upload. Nameko HTTP entrypoint is build on top of werkzeug library. Request object has files property you can use to handle incoming file payload.
Not sure what the speed implications would be here, that would require some testing. If scp works for your case then there is nothing wrong with it. Going through Nameko service would only make sense if you need some additional operations to be performed or events triggered before or after that file upload on the receiver side.
With nameko, we use the strategy to use external web service, in our cases it is either AWS S3 or alternative S3 implementation minio.
In general, I try to avoid sending larger amount of data via messaging, I prefer to store the file somewhere and notify others about it (via small event message). In case of AWS S3, one can configure S3 notification which sends notification to AWS SNS, from there to (arbitrary number of) SQS and from there, nameko SQS entrypoint consumes the events and fires events within it’s environment. It takes under a second from the moment a file is published to the moment nameko event about new object creation.
With minio, it may work very similarly, they also provide notification system and it uses (almost) the same messaging format of messages.