I have two Raspberry Pis, connected by an ethernet cable. Can I somehow convince the master Pi that the other Pi is its own right hand? Camera, USB ports, GPIO, SD card files, serial devices, all of it; I want to be able to access all of these resources (or as much as possible) of the 2nd pi, from the first pi, as if they were local to the first pi.
Take the MIPI camera port for example, currently I have on the master Pi, something like (fictitious pseudo code) :
picture1 = myCamera.takePicture(res='64mp')
and for the master to get a picture from the second camera on the other pi (running flask server) it is something like:
picture2 = httpGet.send('http://ip.of.2nd.pi/camera/takePicture?res=64mp')
which will prompt the 2nd pi to take a picture with its camera and send the image back to the master as a payload.
Today I discovered pickle so now I can send actual python objects back and forth and don't need to keep wrapping all my Python functions in HTTP methods, but can it be even simpler than pickle?
Can it be as simple as:
picture1 = pi1.myCamera.takePicture(res='64mp') # this camera exists on this Pi
picture2 = pi2.myCamera.takePicture(res='64mp') # this camera exists on the remote Pi
?
If so, how?
Please don't get focused on the camera thing and start suggesting multi-camera boards. I know they exist (yes even for 64mp sensors) but there is a lot more going on than just two cameras and I have good reasons for using two separate Pis. I'm trying to strike a balance between TL;DR and preemptively defending against the inevitable assertion that I'm making things more complicated than they need to be, so please forego the customary 8 pages of vetting and just trust that the question I'm asking is relevant to the project that birthed it.
Take the MIPI camera port for example, currently I have on the master Pi, something like (fictitious pseudo code) :
picture1 = myCamera.takePicture(res='64mp')
and for the master to get a picture from the second camera on the other pi (running flask server) it is something like:
picture2 = httpGet.send('http://ip.of.2nd.pi/camera/takePicture?res=64mp')
which will prompt the 2nd pi to take a picture with its camera and send the image back to the master as a payload.
Today I discovered pickle so now I can send actual python objects back and forth and don't need to keep wrapping all my Python functions in HTTP methods, but can it be even simpler than pickle?
Can it be as simple as:
picture1 = pi1.myCamera.takePicture(res='64mp') # this camera exists on this Pi
picture2 = pi2.myCamera.takePicture(res='64mp') # this camera exists on the remote Pi
?
If so, how?
Please don't get focused on the camera thing and start suggesting multi-camera boards. I know they exist (yes even for 64mp sensors) but there is a lot more going on than just two cameras and I have good reasons for using two separate Pis. I'm trying to strike a balance between TL;DR and preemptively defending against the inevitable assertion that I'm making things more complicated than they need to be, so please forego the customary 8 pages of vetting and just trust that the question I'm asking is relevant to the project that birthed it.


