I'm looking to use five android phones to take a photo simultaneously (from different angles).
I'd like to control the phones via a pc (linux or mac) and ideally they're all connected via USB/Ethernet.
I'm an EE, but I don't have much Android experience, so looking to get some feedback based on what I've read so far.
Looks like the Scrcpy library could work here, controlling the 5 devices via adb. I see it allows for multiple connections, have anyone tried this?
I could potentially create a PCB that integrates with the headphone jack of each device and control via push button and 470ohm resistor?
I could potentially build a client app on the Android devices, which connects to a server app on linux/mac (basic TCP/IP client server)
What routes/design would people take on architect-ing such a system?
Thanks for your help and reading this.
CodePudding user response:
What do you mean by "simultaneous"? How much leeway do you have- seconds? Milliseconds? Somewhere in between? Because those can require different techniques.
The easiest thing is to use adb on all 5 devices (I think you can, but I've never personally done more than 2 at once). YOu can even use adb over wifi, so you don't need the cables. You can open the photo app on each (either manually or via adb) then send an input command down via db to each device to send a click of a CAMERA media button, which should cause them to take a photo (of course this is dependent on the camera app honoring this keycode).
The problem with that approach is that you're going to have to have a script that either sends commands to each device 1 at a time (they'll be off by seconds) or spawns N processes that each send a command. That obviously isn't going to be simultaneous either, although it would be closer.
If you really do need simultaneous, its better to write an app on the PC that sends a UDP multicast message. Write an Android app that listens for it. Then when the device receives the message, take the picture. This will assure each device gets the message at the same time, and the picture should be within milliseconds of each other. Of course, if you don't need ms resolution this is total overkill.
