Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NTP sync using CAN bus
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sun Apr 05, 2015 4:22 pm    Post subject: NTP sync using CAN bus Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Apr 06, 2015 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 565
Location: münchen.de

PostPosted: Thu Apr 09, 2015 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Apr 14, 2015 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum