1

I have three remote devices controlled by another one. What I want is those remote devices to execute a code in a syncronous way. I mean, all at the exact time.

This comes from the need to take photos from different perspectives in the same time moment. So I have a Python program running on three different devices that takes a picture. What I need now is to control those devices from an external one to take the pictures at the same moment (with no delay).

I have read about RPyC but I am not sure if it is the best option.

How do you think it can be implemented in the best possible way? Thanks!

user3748883
  • 319
  • 2
  • 16
  • Who decides when to take the pictures? Is there a schedule, or is it ad-hoc? If the former, than set up NTP sync on the devices and use e.g. cron to have the pictures taken, without any outside interaction. If the latter, then you need some kind of messaging system. For example, the devices could listen for messages on a shared message queue. – Erik Cederstrand Aug 31 '18 at 08:25
  • Another device is who decides when to take the pictures. What I am worry about is the latency of sending that messages. It would be great if there was a way to grant that remote code execution synchronously in the three devices at the same time – user3748883 Aug 31 '18 at 11:29
  • Unless you're tinkering with quantum particles, there will always be *some* latency. What are your requirements? Offering solutions depends on whether we're talking seconds, milliseconds or microseconds, and what your options are for getting the message through to the devices (network setup, firewall etc). – Erik Cederstrand Aug 31 '18 at 11:35
  • Yes, you are right. I am only thinking about what is the best way to do it. We are talking about microseconds. Since the three pictures should be taken in the same moment to combine that pictures into one. So if they are taken with milliseconds of difference, the final picture will be blurred. The lowest latency the better. I am thinking about using MQTT, 0MQ... but don't know which would be the best option for this case. All devices are connected through ethernet – user3748883 Aug 31 '18 at 11:42
  • Microsecond precision is a *very* tough requirement. There's https://stackoverflow.com/questions/41987430/what-is-the-lowest-latency-communication-method-between-a-computer-and-a-microco to give you an idea of the problem. A signal through an Ethernet cable will only travel ca. 200 meters per microsecond and you'll have lots of random latency due to buffers, schedulers, GC etc in your stack. Even if you manage to trigger a signal to the camera at the exactly right time, you'll still have random latency before the shutter is activated. I would urge you to rethink your strategy. – Erik Cederstrand Aug 31 '18 at 12:03
  • Okay. Thanks for the information! – user3748883 Aug 31 '18 at 12:06

0 Answers0