Date/Time related events in Raspberry Pi?

Gabriel9's icon

Hello RNBO folks!
I would need to use the Raspberry Pi clock to trigger some date/time related events (switch on/off things, mainly).
Something like the [date] object in Max, basically.
Isn't there a way to access the RaspPi clock?
Thanks,
Gabriele

Jan M's icon

Accessing time information from the Raspi inside RNBO isn't possible AFAIK.
What you could do is create a script in python or another language that accesses the time information and then send values via OSC to the RNBO.
To keep in mind: RasPi 4 and lower don't have a real time clock, so each time the RasPi reboots you'll need to set the clock manually.

Alex Norman's icon

I think the default setup for the pi is to use ntpdate to synchronize to a date server, so if you're connected to the internet you should get the correct time automatically set eventually.

Gabriel9's icon

Thanks Jan! That sounds like the best solution indeed. Any tips for the script to access the time info?

Thanks Alex! Yes I believe you are right and the clock should be automatically updated in case of a reboot, if the pi is connected to the internet.