1

I have 2 Pi Zero Ws (wifi), each with a Pi camera connected to them. Both Pis/cams are running on battery power and deployed in the desert. There is no network or internet connection. The cams are programmed to take 4 still images every second (1 every 250ms).

There are two things I'm concerned with and need help. The first is that both Pis/cams should share a common time reference. The second, which obviously builds on the first, is that the images from each pi/cam should ideally be synchronized.

The duration of the deployment will obviously be bound by battery power, but I'd like pursue the best option for sharing a common reference time and synchronizing the images.

EDIT: Yes, my question does not show any code or present an code error, because I have not attempted any solution. I'm trying to get advice on where to focus further research efforts and why you believe the method will work best. I'm not an expert with Linux systems or the Raspberry Pi, so please give me enough information to push me in the right direction. I'm not asking for code or you to do my work, I'm asking for you to guide me in choosing the proper solution given my situation.

  • You STILL need to explain your problem. The easiest way to get 2 devices (Pi or anything else) to operate "simultaneously" is to run a process which instructs each to do SOMETHING. You can use ANY protocol, direct connection, serial, I²C, optical, or any of the networking protocols. If in addition you want "identical" timestamps there are probably a dozen methods of synchronising the clocks. No one is going to write your code for you - (I used to consult but am now retired). – Milliways Apr 12 '18 at 6:33
  • 1
    You do realize the Raspberry Pi was developed with the purpose of educating those who aren't well rehearsed with the stuff you refer to in your comments. I'm not looking for someone to write my code. I'm looking for some educational instruction. Your condescending responses do no one any good. – ThatsRightJack Apr 12 '18 at 6:58
  • Not Pi specific. – joan Apr 12 '18 at 10:12
  • @ThatsRightJack Sorry, but we don't share educational resources here. You might want to try Google, there's plenty of tutorials and books about networking and low-level protocols like SPI. This site expects you to have a specific problem which you tried to solve on your own but couldn't. – Dmitry Grigoryev Apr 12 '18 at 11:19
4

You've said, "I'm not an expert with Linux systems or the Raspberry Pi, so please thoroughly explain your solution." Fair enough, but if by a "thorough explanation" you expect to avoid any further investment of time beyond this forum post, I feel you will be disappointed :) That said, here goes:

  1. GPS is a straightforward solution for obtaining accurate time. The BU-353 is an often-used receiver in RPi projects, and there is a lot of "how-to" guidance available for using it with Raspbian. Once you've got your GPS receiver, you'll need to install some software... this should do it:

sudo apt-get install gpsd gpsd-clients python-gps ntp

I feel that's thorough enough for your time requirement in this post, but once you get this far, you can always come back and post more specific questions (and perhaps get more specific answers :)

  1. With respect to your "synchronization" requirement: In the absence of any details it would seem to be a waste of time and bandwidth to propose any "thorough" approaches... the "details" I refer to are, for example, whether or not your units are connected(!). And if not connected, what is the distance between your units? But, I'll offer two items for your consideration:

    • rsync can do the job once you have your units connected, drives mounted, etc.

    • WiFi Direct is a possibility if your units are not already connected, but "close enough". In fact, if they're "really close", you could simply connect them with an Ethernet patch cable :) As in part 1., this is something that is supported in Raspbian, and there are some How-Tos available, but they will need to be adapted to your situation I think.

Hope that helps.

0

Apparently time stuff (with ntp) can be set up to use gps devices

https://www.lammertbies.nl/comm/info/GPS-time.html

This one is for raspberry specifically:

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

  • Document seems to be a little bit outdated (it's not for raspberry pi and is not using systemd), but might be a good research starting point. – eftshift0 Apr 12 '18 at 6:01
  • Re, use of GPS devices -- this is true, but, presuming the Pis are withing wifi range of one another, the OP does not even need to do that, since they don't need to have the correct time, they just need to have the exact same time. This can be done by using one as the NTP server for the other. – goldilocks Apr 12 '18 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.