Volvo Community Forum. The Forums of the Volvo Owners Club

Forum Rules Volvo Owners Club About VOC Volvo Gallery Links Volvo History Volvo Press
Go Back   Volvo Owners Club Forum > "Technical Topics" > XC90 '02–'15 General

Notices

XC90 '02–'15 General Forum for the P2-platform XC90 model

Information
  • VOC Members: There is no login facility using your VOC membership number or the details from page 3 of the club magazine. You need to register in the normal way
  • AOL Customers: Make sure you check the 'Remember me' check box otherwise the AOL system may log you out during the session. This is a known issue with AOL.
  • AOL, Yahoo and Plus.net users. Forum owners such as us are finding that AOL, Yahoo and Plus.net are blocking a lot of email generated from forums. This may mean your registration activation and other emails will not get to you, or they may appear in your spam mailbox

Thread Informations

Arduino in an XC90 - who wants to join me?

Views : 3368

Replies : 38

Users Viewing This Thread :  

Reply
 
Thread Tools Display Modes
Old Jan 9th, 2018, 12:36   #11
Bonefishblues
Premier Member
 

Last Online: Today 20:56
Join Date: Oct 2014
Location: Near Bicester, Oxon
Default

Would a chimp with a hammer be of any use in your enterprise?

PM me if yes. I have my own hammer
Bonefishblues is offline   Reply With Quote
Old Jan 9th, 2018, 16:46   #12
SiliconS
Junior Member
 

Last Online: Apr 16th, 2024 20:29
Join Date: Sep 2017
Location: West Sussex
Default

Interesting project! I can't help, but I'm very interested. Please post updates as you make progress.
SiliconS is offline   Reply With Quote
Old Jan 9th, 2018, 19:36   #13
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default UPDATE 1 (of many to come)

So here's my first update:
1. Dusted of my Ardunio Uno board - literally, it was covered in dust. Shame on me.
2. Updated my Ardunio IDE to v1.8.5
3. Installed the mcp2515 library and various other CAN bus libraries
4. Studied some examples
5. Started writing my first example code to get debugging working

First output:
Welcome to SwissXC90's VolvoXC90 CAN of Worms Example
Version: 09 Jan 2018
0
1


Yeah it's not much but I've got to get the debugger working first before anything else, so gotta make sure the Serial.println() is working and understand the basic structure.

Next steps:
Research the code to use with CanHacker Windows software

Solder the headers onto my CAN bus board - I have this one:
https://www.seeedstudio.com/CAN-BUS-....2-p-2256.html

Try it!
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.

Last edited by SwissXC90; Jan 9th, 2018 at 21:36.
SwissXC90 is offline   Reply With Quote
Old Jan 9th, 2018, 21:35   #14
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default Update 2

OK, managed to decypher and understand the source code of some examples. Heavy going, especially when the original example is very sparsely documented.

My Ardunio code compiles and produces:

Welcome to SwissXC90's VolvoXC90 CAN of Worms Example
Version: 09 Jan 2018
Can't Init CAN


Which is exactly what it should do as the CAN interface is not yet built.
This is all desktop stuff at the moment, haven't touched the car yet.

Enough for tonight, off to bed.
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.
SwissXC90 is offline   Reply With Quote
Old Jan 10th, 2018, 12:20   #15
GreenBrick
SilverBrick Lives!
 
GreenBrick's Avatar
 

Last Online: Apr 5th, 2024 19:06
Join Date: Apr 2015
Location: Poynton, Cheshire
Default

I'm looking at replacing the ECU in my pickup with a Speeduino (Arduino based standalone system) in the future.

I will follow this, as I am also interested in the CAN stuff.
__________________
Jeep ZJ, 960, Past:- Mazda2, Jumbuck, V70 (2002), 945 (1995), Hyundai Coupe, Golf Mk4, Previa, Carina, 2 x Corsa, 4 x Astra, 944 16v (1991), Espace, Escort, Audi 80, Renault 21 Savanna, Polo, Mini Clubman/Pickup, Standard 8, Capri, Maxi.
GreenBrick is offline   Reply With Quote
Old Jan 10th, 2018, 12:22   #16
GreenBrick
SilverBrick Lives!
 
GreenBrick's Avatar
 

Last Online: Apr 5th, 2024 19:06
Join Date: Apr 2015
Location: Poynton, Cheshire
Default

So far I have got a dallas button working to use as the immobiliser key.

__________________
Jeep ZJ, 960, Past:- Mazda2, Jumbuck, V70 (2002), 945 (1995), Hyundai Coupe, Golf Mk4, Previa, Carina, 2 x Corsa, 4 x Astra, 944 16v (1991), Espace, Escort, Audi 80, Renault 21 Savanna, Polo, Mini Clubman/Pickup, Standard 8, Capri, Maxi.
GreenBrick is offline   Reply With Quote
The Following User Says Thank You to GreenBrick For This Useful Post:
Old Jan 10th, 2018, 13:54   #17
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default

You're a few steps ahead of me then
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.
SwissXC90 is offline   Reply With Quote
Old Jan 10th, 2018, 22:23   #18
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default Update 3

A mixed bag tonight

Went to solder the headers onto the CAN interface, and found I'd lost a header. Swore and cursed and hunted and eventually found it. Fitted the headers.

Connected to the Arduino and tried to initialise the CAN interface. Init failled. Scratched my head and thought hard and then realised I left of the ISP header, not thinking it was needed.
So soldered that on.

Tried again. Init fail.
Googled and hunted and tried a few things.
One post said sometimes an external supply works.
So got my 12V supply, and connected it, and OOPS - laptop crashed.
Thats not good. Static / voltage leakage and all that.
Rebooted laptop, picked up Arduino and OOPS - Arduino regulator smoking hot.
Thats not good.
Disconnected everything pronto, let it cool, reconnected it.
Ardunio dead.
Won't run, won't reset.
Drats, I thought these Arduinos were foolproof. Obviously not.

Grabbed my 2nd Arduino (clone)

Fitted the CAN board.
Tried to init. Init fail.
Googled
Changed CS from pin9 to pin10
Tried again and....

Enter setting mode success
set rate success!!
Enter Normal Mode Success!!
CAN BUS Shield init ok!
In loop


Finally!

Then went back to the dead Arduino, checked the regulator- Shorted input to output. All the 5V components had 12V on them. Dead. Totally. Damn. Better buy a few spare Arduinos then....

OK, that's enough for tonight, off to bed.
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.
SwissXC90 is offline   Reply With Quote
Old Jan 10th, 2018, 23:13   #19
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default Update 4

Just bought 3 x replacement Arduino clones

They cost around 6 EUR each. incl shipping!
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.
SwissXC90 is offline   Reply With Quote
Old Jan 13th, 2018, 13:30   #20
SwissXC90
Premier Member
 

Last Online: Mar 20th, 2024 18:26
Join Date: Jan 2016
Location: Cross Country
Default Update 5 - Live Data being read!

So today after having prepared myself with sufficient information, my Ardunio and CAN bus shield, some cables, my laptop and a battery charger, I went down to the garage

Opened the boot of the XC90
Connected the battery charger to the power outlet in the boot to ensure I don't get a flat battery.
Opened up the boot floor
Removed the rear quarter side panel to access the REM and the Parking Camera PAC (which I have). I had already determined the PAC was the easiest place to get into the active low-speed CAN bus.
Disconnected the connector from the PAC (with ignition off, as the PAC is only powered with key in PosI and PosII)
This connector has PosI ACC power, Ground, CAN-H, CAN-L and nothing else
I connected the Ardunio CAN shield to the CAN bus
Nothing. Drats.
I check the connections, all OK

Then I thought: maybe the CAN bus is not active?
I turned on the Ignition and BINGO - the CAN activity LEDs on the CAN shield started blinking and the CAN messages started appearing on my serial power monitor.
Success at first connection!
I had already set the bit rate to 125000 bps (the Volvo low-speed CAN runs at 125kbps)

Currently, I am just printing the messages to the serial port to show them on my PC

And logging them like this:
"13.01.2018 13:32:35",ID: 0 Data 0 0 0 0 0 0 0 0
"13.01.2018 13:32:36",ID: 42 Data 96 48 0 64 7 0 25 0
"13.01.2018 13:32:36",ID: 190 Data 128 49 64 6 0 160 160 2


Here's is what I learnt so far
  • When the vehicle is asleep, the CAN bus is not active (logically)
  • Pressing the Yellow button on the remove wakes up the CAN bus and messages start appearing for 25 seconds. After 25 seconds, the messages stop. After 30 seconds, the CAN bus goes back to sleep
  • The first wakeup message is ID 0, with am empty packet (all 8 data bytes are 0)
  • Pressing a remote button, opening any door, putting the key in the ignition - all these activities wake up the CAN bus.

I am now modifying my Arduino code to use with a CAN bus sniffer program I grabbed from the net, to save me writing my own sniffer....

Back to the garage I go....
__________________
XC90 R-Design MY2009, Black Sapphire Metallic. HP-Sound, RSE, Nav, Tel, ParkingCam, BLIS, ParkingHeater, RestHeat, Removable Towbar, Summer: CRATUS 20x8 on Pirelli Scorpion Zeros 255/45, Winter: NEPTUNE 17x7 on Continental WinterContact 4x4 235/65.
SwissXC90 is offline   Reply With Quote
The Following User Says Thank You to SwissXC90 For This Useful Post:
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:59.


Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.