can id´s 4 Gear Selector

Jaguar / Landrover hardware hacking
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

medolino wrote: Sun Feb 05, 2023 3:50 pm doesn't work on the newer ones
New ones is with the canbus logs I made it should go down.
Founder Volt Influx https://www.voltinflux.com/
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: can id´s 4 Gear Selector

Post by LRBen »

nkiernan wrote: Sun Feb 05, 2023 11:42 am Model number on mine is BW83-7E453-AC and I get the same result as you. Playing back some of the different logs raises the knob, allows it to rotate, changes light between P-R-N-D but doesn't lower the knob in any. The knob raised on the first playback and stayed there.
I got mine to lower! I got the pinout wrong. pin 4 does nothing. pin 10 needs 12v, then when you disconnect ignition it will lower. It does need canbus to raise though, but doesn't lower via canbus messages.

Updated my pinout post.
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: can id´s 4 Gear Selector

Post by LRBen »

So you just need 0x3F3 to raise and unlock the gear selector, sending every 20ms.
No changing lights yet, but I do get the gear selector sending back gear change canbus messages. Just need to write in the changing of messages depending on value of byte 2 in 0x312

Code: Select all

#include "variant.h"
#include <due_can.h>

//Leave defined if you use native port, comment if using programming port
#define Serial SerialUSB

const int CAN_SPEED = 500000; // CAN bus speed in baud
const int SEND_DELAY = 20; // send message every 10ms
const int MESSAGE_LENGTH = 8; // 8 byte long message

void setup()
{
Serial.begin(115200);

// Initialize CAN0 and set the baud rate
Can0.begin(CAN_SPEED);
Can0.watchFor();
}

void loop()
{
static unsigned long lastTime = 0;
static int counter = 0x82;
static int counter1 = 0x00;

// Send a new message every SEND_DELAY milliseconds
if (millis() - lastTime >= SEND_DELAY)
{
CAN_FRAME msg;
msg.id = 0x3F3; // message ID
msg.length = MESSAGE_LENGTH;
msg.extended = 0; // standard frame format

// Set the data in the message
for (int i = 0; i < MESSAGE_LENGTH; i++)
{
  msg.data.bytes[i] = 0;
}
msg.data.bytes[0] = 0x5C;
msg.data.bytes[1] = 0x66;
msg.data.bytes[2] = counter1;
counter1++;
if (counter1 > 0x0E)
{
  counter1 = 0x00;
}
msg.data.bytes[3] = counter;
counter++;
if (counter > 0x90)
{
  counter = 0x82;
}
msg.data.bytes[4] = 0xFF;
msg.data.bytes[5] = 0x7F;
msg.data.bytes[6] = 0x00;
msg.data.bytes[7] = 0x80;

// Send the message
Can0.sendFrame(msg);


// Record the time the message was sent
lastTime = millis();


}
}
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: can id´s 4 Gear Selector

Post by LRBen »

Got a working arduino due script for selecting modes and lights.

Currently I can't get the S mode light to work. However I can select it without the selector locking up. It was a bit tricky to figure out. The two cycling values in 0x3F3 are in relation to each other. It also locks up for a couple of seconds when going into Park. Maybe an inbuilt timer to allow the E-brake to come on?

Edit: Updated thanks to Tom's canbus logs. S mode light now works. Still get the delay with the Park light, but it's functional at least.

https://github.com/SomersetEV/LandRover ... ear-change
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

LRBen wrote: Sun Feb 05, 2023 4:06 pm I got mine to lower! I got the pinout wrong. pin 4 does nothing. pin 10 needs 12v, then when you disconnect ignition it will lower. It does need canbus to raise though, but doesn't lower via canbus messages.
Nice one, I'll check this out. I have the 22 pin connector on mine, so I expect one of the pins needs the same 12V. Will do some checking :)
User avatar
medolino
Posts: 14
Joined: Fri Jan 13, 2023 8:41 pm
Has thanked: 3 times
Been thanked: 2 times

Re: can id´s 4 Gear Selector

Post by medolino »

can we use it with the ldu ??
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

medolino wrote: Thu Mar 09, 2023 11:26 pm can we use it with the ldu ??
No.


Not directly you need to create a controller to have the two interact.
Founder Volt Influx https://www.voltinflux.com/
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

Arduino Uno with Canshield code to have full control of the shifter.

https://github.com/Tom-evnut/Land-Rover ... LRgearknob

This code allows raising and lowering of the knob and selecting of all the positions with the lights working. This is ready for anyone to take and integrate into a vehicle.

The checksum has not been worked out, so it just is brute forced message filling based on logs.
Founder Volt Influx https://www.voltinflux.com/
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

Thank you for sharing Tom. I will try testing at the weekend on the gear selector I have :)
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

Also made the Gen 1 knob I have work. CAN bus was a bit easier.

Lights come on and Sport is selectable. I have not gone in depth to figure out any more.

Logs and Arduino code is on github.
https://github.com/Tom-evnut/Land-Rover ... en1%20Knob
Attachments
rn_image_picker_lib_temp_65d4afd3-c6d2-48e8-948b-0c902b6e0f13.jpg
Founder Volt Influx https://www.voltinflux.com/
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

22 way connector is TE 0-1411226-1
https://www.aliexpress.com/item/1005002582017711.html

This possibly looks like this part: https://www.te.com/usa-en/product-1-1419158-7.html , the drawing references FORD part numbers so most likely true.


12 way https://www.te.com/usa-en/product-1452015-2.html
Founder Volt Influx https://www.voltinflux.com/
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

Thank you Tom.

Are you seeing that for both the 12 and 22 way connectors, you only need 5 connections:
- GND
- 12V+ main feed
- 12V+ Ign
- CAN H
- CAN L

Or are there signals required on other pins also (just looking at LRBen's post re needing 12V on pin 10 of the 12 way connector also and wondeirng what the description of that pin is)
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

Hello friends. How long have I been looking for this topic in all the forums !!!! I'm trying to get it to work with a stepper motor for shifting gears in another car. I needed to find all the CAN bus codes and then I stumbled upon this forum. Happiness!!!
I found only 2 leds like in my picture
IMG20230403223835.jpg
CAN led.jpg
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

I also found voltage on the pins of the 22 way connector
Attachments
111.png
GSMTSM - Pinout.pdf
(484.6 KiB) Downloaded 65 times
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

tom91 wrote: Mon Mar 27, 2023 3:54 pm Arduino Uno with Canshield code to have full control of the shifter.

https://github.com/Tom-evnut/Land-Rover ... LRgearknob

Was having some compile issues (old CAN library installed, but when I updated to the latest, it required 3 arguments instead of the 2 used), so had to change below for my setup:

Code: Select all

 while (CAN_OK != CAN0.begin(CAN_500KBPS, MCP_16MHZ)
to:

Code: Select all

 while (CAN_OK != CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ)
Still to test on the gear selector
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

Hi! Where can I download the libraries: variant.h, mcp_can.h for MCP 8MHZ?
I am using an Arduino Nano with a module mcp2515 and library mcp2515.h.
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

VanGogh wrote: Tue Apr 04, 2023 8:02 am

Hi! Where can I download the libraries: variant.h, mcp_can.h for MCP 8MHZ?
I am using an Arduino Nano with a module mcp2515 and library mcp2515.h.
I believe this one should be okay https://github.com/autowp/arduino-mcp2515
nkiernan wrote: Tue Apr 04, 2023 7:21 am Was having some compile issues (old CAN library installed, but when I updated to the latest, it required 3 arguments instead of the 2 used), so had to change below for my setup:
Libraries and sharing them is always a painful part of the Arduino system.
Founder Volt Influx https://www.voltinflux.com/
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

I found mcp_can.h library on git. Applied nkiernan's advice uploaded to arduino. What should happen? Maybe I don't have a CAN bus connection? The port monitor should display information with the line 0x312 from selector?
Image
Attachments
3333.jpg
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

VanGogh wrote: Tue Apr 04, 2023 7:01 pm I found mcp_can.h library on git. Applied nkiernan's advice uploaded to arduino. What should happen? Maybe I don't have a CAN bus connection? The port monitor should display information with the line 0x312 from selector?
It does not print anything, as the Leds will feedback on the knob.

Send it the letter 'd' is you want to toggle canbus debugging.
Founder Volt Influx https://www.voltinflux.com/
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

I don't understand. Maybe my GSM doesn't work with this code? Because on the video of the seller from Aliexpress there is no mine. Does anyone have a video review of working GSM with arduino? How to make the knob move? I haven't been able to move it for 2 weeks now((((
I Send it the letter 'd', but nothing. Then 's', then 'w' and nothing(((
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

VanGogh wrote: Tue Apr 04, 2023 8:08 pm I don't understand. Maybe my GSM doesn't work with this code? Because on the video of the seller from Aliexpress there is no mine. Does anyone have a video review of working GSM with arduino? How to make the knob move? I haven't been able to move it for 2 weeks now((((
I Send it the letter 'd', but nothing. Then 's', then 'w' and nothing(((
Couple of suggestions. You have the CAN lines connected between the arduino CAN shield and the Jag unit and did you check the resistance between the lines ( approx 60R). Think I added a 120R resistor between the lines because my CAN shield didn't have the termination resistor.

You're applying 12V+ and GND to relevant pins and are you applying the 12V+ ignition signal also? When you open serial monitor in arduino and connected to the UNO, this is what would print when first powered up or reset (baud rate is set to 115200 yes?):
  • Entering Configuration Mode Successful!
    Setting Baudrate Successful!
    CAN BUS OK!
    Time Stamp,ID,Extended,LEN,D1,D2,D3,D4,D5,D6,D7,D8
Looking at the SerialComms function in the code, I don't think 'd' is specified as CAN debug? But 's' should raise knob and 'q' should lower it. I need to test but think when ignition is applied selector knob would raise (tbc).
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

VanGogh wrote: Tue Apr 04, 2023 8:08 pm I don't understand. Maybe my GSM doesn't work with this code? Because on the video of the seller from Aliexpress there is no mine. Does anyone have a video review of working GSM with arduino? How to make the knob move? I haven't been able to move it for 2 weeks now((((
I Send it the letter 'd', but nothing. Then 's', then 'w' and nothing(((
Please show us your wiring setup, as wiring can be an issue.
Have you ever gotten canbus from it using anything else?
Founder Volt Influx https://www.voltinflux.com/
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 204 times

Re: can id´s 4 Gear Selector

Post by tom91 »

nkiernan wrote: Tue Apr 04, 2023 8:26 pm Looking at the SerialComms function in the code, I don't think 'd' is specified as CAN debug? But 's' should raise knob and 'q' should lower it. I need to test but think when ignition is applied selector knob would raise (tbc).
gen 1 ignition rasies knob.

d toggles debug for canbus
image.png
Founder Volt Influx https://www.voltinflux.com/
VanGogh
Posts: 41
Joined: Mon Apr 03, 2023 7:33 pm
Has thanked: 2 times
Been thanked: 1 time

Re: can id´s 4 Gear Selector

Post by VanGogh »

Thanks I tried.
I have another code for arduino and used canhacker 2.00.02 to find signals without 120 ohm resistor. But he could not find the signals to raise the knob. Found your code and can't get any results with it. There is no resistance between the CAN bus contacts. I added a 150 ohm resistor and no change (or do you need 120 ohms?). I sent a letter 'w' and the port monitor says "UnLocked" and "Locked" but I don't hear the solenoid valve inside.
When I send other characters nothing happens at all
Attachments
121.jpg
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: can id´s 4 Gear Selector

Post by nkiernan »

tom91 wrote: Tue Apr 04, 2023 8:53 pm gen 1 ignition rasies knob.

d toggles debug for canbus
Apologies Tom, was using your sketch from the first link (gen 2):
1234.JPG
Post Reply