Skip to content
View in the app

A better way to browse. Learn more.

Ford Owners Club - Ford Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.



Join the Independent Ford Owners' Club

Our community has been built by enthusiasts, for enthusiasts, and proudly run by Ford owners' for over 18 years. As an independent, non-official club, everything you’ll find here, advice, support, and opinions, comes directly from members with genuine Ford ownership experience.

Join our friendly community... it's Free!

 

Arduino project communicating with CAN

Featured Replies

So ive begun a project to attempt to interact with the CAN system on my Focus.

The Repo is here: https://github.com/ste2425/ArduinoCanBUSWIP

In the root of that repo is a spreadsheet with the messages iv'e gathered so far and what i think at this early stage their meaning is.
 

The code is written in C++ and runs on an Arduino. Take the code with a pinch of salt, I'm a web developer and used to very abstracted languages such as C# and JavaScript so this is quite a new experience! I never knew i would miss dynamically allocated Array sizes for example!

Iv'e made quite a bit of progress to say this is my first Arduino project and i have very little experience with C++. I can read messages, filter them out and believe ive located messages relating to indicators, locking / unlocking, brake peddle, clutch peddle, main beam, dipped beam etc.

I've noticed that when the bus comes alive, turn radio on, lock car through key, turn ignition on, it sends messages all the time. Each message indicating a current status at that point.
So every time message id 210 is emitted the first message body block will always have a value of 32 if the doors are locked. Only changing to 64 if the doors open. However i only expected a message to be sent on the action of locking or unlocking so that was unexpected. Also different message ID's appear to emit at different frequencies.

This is all interacting with the MSCAN at this stage.

I do however have a couple of questions and will probably have more as this project continues so i will update this thread.

First question.

Are can messages a cause or affect? I mean does the message trigger the action, or is the existence of the message indicating the action happened?

For example I attempted to emit the message relating to doors being locked and expected my doors to lock. However they didn't. The bus came alive and messages started emitting, which makes me believe i correctly sent the message.

Also the message ID relating to locking doors, 210, emits with the new values i sent. From that i gathered that i did correctly send the message. However all the actions that should have happened of the back of that, foot-well lights go out, interior light go out etc didn't.

This and the fact messages are being emitted all the time makes me think their more of a read mode indicating the current status of that system, not directly instructing that system to change. Which leads me on the the next question.

Second question

Are the messages being emitted read-only, is there a special message i have to emit to indicate a status change / action? I need to read up on the CAN protocol and how you communicate with other systems on it. Do they literally just emit everything and other systems choose to react to it, or do you have to emit a special 'update' message to indicate intent?

So if anyone has any information that could help with this project i would be very grateful to hear it!

 

Ta
 



Latest Deals

Ford UK Shop for genuine Ford parts & accessories

Disclaimer: As the club is an eBay Partner, The club may be compensated if you make a purchase via the club

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

The "Digestive"






Background Picker
Customize Layout

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.