Ardunio linbus converter

hi

i like to do a project

to build a ardunio mini pro linbus converter with mcp2004 and a mcp4134

the thing is i have a golf 7 multi functional steering wheel and a pioneer sph-da120 radio
and the goal is to get the mfsw buttons work and the cruise control plus flippers on the back of the steer

but i m not the best at coding ardunio i can make everything with hardware

i hope somone can help me with the project

i read the simulair project on this form

and some extra data to output for the pioneer wired remote via mcp4134 chip

and a other project i found

Split the project into smaller parts. Look for example code handling just one peripheral. When that works go for the next device and adopt its code into the previous one......
Divide and conquer....

can you build a code to analyze the linbus and print it to the com port so i can make a list of the output what button is pressed and to translate the output

i try the code from the audi but that does not work
only this is my output
LIN⸮#⸮⸮l⸮ggi⸮;&[⸮⸮⸮⸮s

what i think is that my mfsw is a mqb and not a pq

1 Like

No, that's not the way this forum works. The goal is to assist members learning and growing in coding.
Use Your favorite search engine on "analyze linbus".
There is a section were You can pay for such work. A well documented build is needed.

1 Like

i try to install the volvo_linbus_master on my ardunio pro mini but when i compile it i get this error

In function handle_frame': volvo_linbus-master\volvo_linbus/volvo_linbus.ino:88: undefined reference to LinFrame::isValid() const'
collect2.exe: error: ld returned 1 exit status

There is a section on this forum where you can pay to have software written.

hi

i get the code running on arduino mega 2560
when i look in the com port i get lin debugging begins

but there is no outpot data

i checked if o connected the wiring good
and power to the steering wheel remote buttons etc

this is my code

#include <SoftwareSerial.h>

// https://github.com/zapta/linbus/tree/master/analyzer/arduino
#include "lin_frame.h"

// Pins we use for MCP2004
#define RX_PIN 10
#define TX_PIN 11
#define FAULT_PIN 14
#define CS_PIN 8

#define SYN_FIELD 0x55

SoftwareSerial LINBusSerial(RX_PIN, TX_PIN);

byte b, i, n;
LinFrame frame;

void setup() {
pinMode(LED_BUILTIN, OUTPUT);

// Open serial communications to host (PC) and wait for port to open:
Serial.begin(9600, SERIAL_8E1);
Serial.println("LIN Debugging begins");

LINBusSerial.begin(115200);

pinMode(CS_PIN, OUTPUT);
digitalWrite(CS_PIN, HIGH);

pinMode(FAULT_PIN, OUTPUT);
digitalWrite(FAULT_PIN, HIGH);

frame = LinFrame();
}

void loop() {
if (LINBusSerial.available()) {
b = LINBusSerial.read();
n = frame.num_bytes();

if (b == SYN_FIELD && n > 2 && frame.get_byte(n - 1) == 0) {
  //Added delay for better read if I delete this is doesn't read anything
  delay(10);
  digitalWrite(LED_BUILTIN, HIGH);
  frame.pop_byte();
  handle_frame();
  frame.reset();
  digitalWrite(LED_BUILTIN, LOW);
} else if (n == LinFrame::kMaxBytes) {
  frame.reset();
} else {
  frame.append_byte(b);
}

}
}

void handle_frame() {
if (!frame.isValid())
return;

dump_frame();
}

void dump_frame() {
for (i = 0; i < frame.num_bytes(); i++) {
Serial.print(frame.get_byte(i), HEX);
Serial.print(" ");
}
Serial.println();
}

I recommend you read the forum guidelines and post your code using code tags. Simply press the then insert your code.

type or paste code here

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.