View previous topic :: View next topic |
Author |
Message |
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Apr 05, 2015 4:22 pm Post subject: NTP sync using CAN bus |
|
|
Hi all.
I'm building a Gentoo system for use in cars. The board (*-PI derived) has no RTC so I know it's not uncommon to use NTP and a GPS to sync the internal clock. Now I'd like to know how I could take the time from CAN bus. Assume I already decoded the CAN frames to get the time, how would I pass the time over to ntpd?
Any hint/suggestion welcome. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Mon Apr 06, 2015 5:03 pm Post subject: |
|
|
CAN is just a communication platform (really good one mind).
If you want to pass custom data from one CAN enabled device to another you just have to decide how to pack the data into the 8bytes for a message.
I would ensure you set the message identifier as low priority as possible _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
forrestfunk81 Guru
Joined: 07 Feb 2006 Posts: 565 Location: münchen.de
|
Posted: Thu Apr 09, 2015 12:28 pm Post subject: |
|
|
I assume you get the time from CAN bus by a script. Why do you want to use ntpd and why not setting the parsed date from CAN bus manually in your script?
Code: | # date -s '2015-04-09 14:28:00' |
_________________ # cd /pub/
# more beer |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Apr 14, 2015 9:59 am Post subject: |
|
|
forrestfunk81 wrote: | I assume you get the time from CAN bus by a script. |
Not yet in fact. I'm still trying to figure out the best way to achieve time sync between CAN and ntpd.
forrestfunk81 wrote: | Why do you want to use ntpd and why not setting the parsed date from CAN bus manually in your script? |
Simply because ntpd manages all kinds of date synchronization and it catches the slightest slot (e.g. network, GPS) as soon as one is available to synchronize the clock. Since ntpd does that thing well, I thought of expanding its features to the CAN bus. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
|