Relatively new to coding need assistance with setting up a CAN monitoring 'daemon'

34 views
Skip to first unread message

Matt Bonnett

unread,
Sep 21, 2015, 10:33:28 AM9/21/15
to OpenXC
To give a preface to this and why I posted it in this group is this: I currently have an '07 North American Focus which has the early Canbus radios predating Sync compatibility. To date I have an auxillary input adapter and a Raspberry Pi with a CAN board and via SocketCAN tools I have been able to successfully reverse engineer some of the CAN signals on the radio mainly concerning button presses and on/off and aux/cd/radio mode signalling. I have even documented messages relating to updating the radio display text but have not had luck trying to update the display myself.

My intent is to set up the Pi as a DIY Sync system mainly for media purposes. The meat of the Pi-Radio interaction is going to be button presses on the radio being retrieved by the Pi and send them to the media player. This would also include switching out of Aux mode on the radio or turning it or the ignition off triggering the media player to pause. At this current early stage that is my focus and sending info back to the radio for display is a bonus goal.

Here's my snag: I'm still a bit newbish to coding and am trying to learn as I go. My biggest strength is USUALLY I can read someone elses code at a fundamental level and debug or make small tweaks but when it comes to writing my own from scratch comes the deer in a headlights look.

So my initial task that is acting as my roadblock is simply trying to set up some form of constantly running daemon that monitors the CAN bus and given a list of messages it should look for, translate and relay those to another process.

But that is where it gets tricky. Outside of the included command line utilities, there's minimal documentation on interacting with the SocketCAN libraries in any sort of code. Preferably using Python or NodeJS. Hell, if I can kluge something together with PHP and have it function that'd be amazing at this point in time.

Any advice would be a big help and I'd be very appreciative. Paying back I did get a screen and mic recording when I was doing the above reverse engineering in the car. When I get off work later today I am going to try and upload that to Youtube. I'm confident I got some pretty good data out of that run.
Reply all
Reply to author
Forward
0 new messages