File transfer under Nameko


#1

Hi Guys,

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?

Thanks

Steve


#2

Hi Steve,

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.

Cheers,
Jakub


#3

Hi Jakub,

Thanks for your reply. Sadly, I don’t really understand it.

Could you post some example code, please?

Tx

Steve


#4

Hi Steve,

No problem. Please find the example here https://gist.github.com/kooba/49d173e2aeaf93b262d254fb64e157aa


#5

Excellent, thank you, I’ll look through it. Do you think it is faster than SCP, which is what I ended up using?

Regards,

Steve.


#6

Hi Steve,

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.


#7

Hi Jakub,

Thanks for your support. I’ll probably stick with SCP then, unless I find a reason to move.

Steve.