Giter VIP home page Giter VIP logo

linbus's Introduction

ARDUINO LINBUS GADGETS

An Arduino based LINBUS stack that allow to explore and hack linbus based system.

Unless specified otherwise, the PCBs can be used with standard Aruduino IDE, behaving as Arduino Pro Mini 5V 16Mhz with ATMEGA328.


**Analyzer** - a small PCB that connects on one hand to linbus and to a computer USB port on the other. The analyzer decode all the linbus frames and dump them to the computer. The USB connection emulates a serial port using a builtin FTDI adapter and can be read with standard serial application. A special python script is provided in the tools directory to dump the serial data in diff mode such that only changed bits are displayed. The board design support also linbus TX which allow to have this board functioning as a linbus master or slave (this however requires firmware changes).


**Beeper** - a small PCB and firmware that monitors a linbus and activates a buzzer when certain conditions met. The provided firmware includes a car specific example that beeps when the reverse gear in my car is engaged. The car specific logic is in the car_module* files and can be adapted to different applications.


**Injector** - a small PCB board with two linbus interfaces that connects in series between a linbus master and a linbus slave. The injector looks as a slave to the master and as a master to slave and it transparantly proxying LIN frame between the. At the same time, it can monitor bus signals, apply application spefici logic and can inject signals back to the bus by modifying on the fly LIN frames it proxys between the master and the slave. The Injector was developed to modiy the behavior of existing LIN bus based system (e.g. automatic activation of the Sport mode in my car).


**Feature Comparison**
Feature Analyzer Beeper Injector
Max LIN speed 20kps 20kps 20kps
Min LIN speed 1kps 1kps 1kps
Operating voltage 12V 12V 12V
Max voltage 40V 40V 40V
LIN frame dump/log Yes Yes Yes
LIN checksums V1/V2 V1/V2 V1/V2
Computer serial interface FTDI/USB Serial 5V Serial 5V
Computer serial speed 115,200 115,200 115,200
Audible output No Yes No
LIN signal interception Yes Yes Yes
LIN signal injection No No Yes
Arduino IDE compatible Yes Yes Yes
Programming language C/C++ C/C++ C/C++
MCU ATMEGA328P ATMEGA328P ATMEGA328P
MCU speed 16Mhz 16Mhz 16Mhz
Schematic/Layout software Cadsoft Eagle Cadsoft Eagle Cadsoft Eagle
PCB Size (inches) 1.3 x 1.5 1.15 x 1.6 1.31 x 1.44
PCB layers 2 2 2
Component mounting SMD SMD SMD
Min component size 0805 0805 0805
OSHPark compatible Yes Yes Yes

linbus's People

Contributors

amet avatar jmiles avatar zapta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linbus's Issues

Steering wheel Lin bus

Thanks for the nice open source project to start with LIN bus!

Do you have any data from the steering wheel LIN bus? (Illumination, chrono knob etc)
I have here a 991.2 steering wheel I want to play with, but sadly no access to a 991 gen car.

BOM, schematic

G'day Zapta. Keen to get in on this project, help where I can. I have ordered a set of the linbus analyser rev A boards from oshpark, these have just shipped out. When you're able to can you provide a bill of materials or a schematic so I can get the components and put something together. Doesn't need to be flash :)

If you'd like to email me, [email protected]

Cheers, and all the best.

EDIT: I found the schematic for the analyser, got enough info on there

Simple Bit changing

Hello,
I want to use the Injector Board as a simple LIN-Slave. Target is to send some comands over serial port to the Injector and use it as a kind of Multiswitch. I do not need a logic check off my comands. Just simple: if serial = a - > change Byte X Bit Y to Z. Can you give me a hint how to realize this whit your reference script? I do actually not completly understand your program parts.
Thanks and Regard
Christian

Analyzer not reading LIN messages

Hi Zapta,

First of all, thanks for all of your great work. Everything looks superb.

So I have fully soldered the Analyzer and checked over all components many times. Here is my outcome:

img_7212

I was able to correctly program with Tiny ISP programmer. Analyzer has a heart beat and seems to work with your serial tool, but when I connect it to my LIN system in my Toyota Tundra, it does not read any LIN messages. I've tried adjusting baud rates to 19200, 9600, 4800, 2400, and also adjusting checksum to true/false for all. I am running out of ideas. Is there any tips of why I may not be getting any LIN messages?

-Kenny

linbus analyzer

Hello Zapta! I'm from Russia and I speak English only with google traslate. I'm trying to reproduce your linbus analyzer, but when compiling, I get an error:
lin_processor.cpp: 340: error: 'setupTimer' was not declared in this scope
   setupTimer ();
 ^
exit status 1
'setupTimer' was not declared in this scope

what will I do wrong? The project will be on arduino pro mini 328p 5v 16MHz. can please, I'm new to this.

Write a frame

Hello,
I've just discovered the LIN last week and I don't understand how can I write a frame using the injector part. Is it possible for a slave to write? Can someone help me?

Thanks

Licence for hardware

Hello,

Really nice project, and would be a good starting point for a new project i am planning, but i was wondering under what licence the hardware for the linbus injector is.
I found Apache 2.0 licence notices in the firmware code but no mention of any licence for the hardware. Is it possible to use/improve on the hardware under a similar permissive licence ?

LIN Bus slave for ESP32

Hello Zapta,

is it possible to create a LIN Bus Slave and Master - read and send at digital port - for a ESP32-PICO-MINI-02 ?

BR
Alf

Arduino and LIN

I have been working on a project to make 2 Arduino mega boards communicate with each other over a LIN bus.
I use the LIN breakout boards from the following vendor.
[http://copperhilltech.com/lin-bus-breakout-board/]
I wanted to send commands from the master Arduino to the slave Arduino, where an LED is turned on or off.

Different LIN transceiver

Hello, I can't get the chip you used in your project (ATA6631) however i can get Philips TJA1020. Below you can see the example application note - my question is if there will be a lot of code change if i will use this chip instead of your chip, or is that chip is limited with some functions compared to your chip?
tja1020
I think that the only change will be the fact that:
pin 4 TXD from TJA1020 will be your LIN_TX
pin 1 RXD from TJA1020 will be your LIN_RX

Document that this project doesn't require custom hardware

It took a bit of reading and praying, but nothing in this codebase actually requires the custom circuit boards or firmware. It runs just fine on Arduinos with matching processors (ATMega 328). Tested both an Arduino Uno R3 and an Arduino Pro Mini. Any generic LIN transceiver can be used on the appropriate pins.

I have the pinouts as:
rx1: D2 (receive from master via a 'slave' LIN transceiver)
tx1: D16

rx2: D15 (receive from your slave device via a 'master' LIN transceiver)
tx2: D4

Status LEDs on D7, D8, D9

TJA1021

Hello, I would like to know if your linbus is compatible with TJA1021

Replacement of ATA6631/ATA6625

Both ATA6631 and ATA6625 have been deprecated by Microchip Technologies and can no longer be bought through the usual distributors.

Is there any IC that can be used as a drop-in replacement?

Hardware and Software question

Hi Zapta,

Great job with this project, just had a couple of questions regarding the project.

  1. Do you sell the board completed? I think it could be a good buy for some people!

  2. The project i am trying to put together is a LinBus controller, Where by the Lin Bus Analyser will be connected. It will read each signal and forward it on,
    With the ability of blocking set signals which can be activated / de-activated via a switch.
    Additionally, a SD Card shield will be connected as a data logger to help record then determine the desired signal to be blocked.
    I have been looking at the circuit, i believe we could use the SDA, SCL, A6, A7, D5 and D10 pins if we install the Arduino firmware.

Injector.zip

I have attached the modified board, which we could develop a breakout board, to attach to suit a variety of more situations. Any advice or help..... especially with the code would be greatly appreciated.

Best regards

Durante

Injector Build

I have been reading about your project and learning about Linbus, because i have a project that uses linbus to send commands, and I need to emulate those commands when certain criteria are met. These boards look like exactly what I am looking for. Do I have to have them made myself, or what is the easiest way to acquire one? I see that you have eagle files for them, but that is uncharted territory for me mostly.

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=APGDT001

would that be a similar product?

Arduino 1.6.5

Hi Zapta,
I am trying to use your analizer code in arduino 1.6.5 but I have a error :
..\Temp\build5482978294230449181.tmp\lin_processor.cpp: In function 'boolean lin_processor::getAndClearErrorFlags()':
..\Temp\build5482978294230449181.tmp\lin_processor.cpp:289:33: error: new declaration 'boolean lin_processor::getAndClearErrorFlags()'
boolean getAndClearErrorFlags() {
^
In file included from ..\Temp\build5482978294230449181.tmp\lin_processor.cpp:15:0:
..\Temp\build5482978294230449181.tmp\lin_processor.h:47:16: error: ambiguates old declaration 'uint8 lin_processor::getAndClearErrorFlags()'
extern uint8 getAndClearErrorFlags();

Please help !

Linbus frame

Hi Zapta,

I managed to capture few LIN frames from my Buick Regal
64 f2 fe 70 00 9d ERR
14 fc 70 90 ERR
14 fc 70 10 ERR
14 fe 70 90 ERR
64 72 ff 8e 00 fe ERR
64 f2 fe 70 00 99 ERR
14 fe 70 10 ERR
LIN errors: STOP SYNC

any ideea what's with the ERR ?

Thank you ,
Alex

LIN bus rate

Hello,

I have tried your project on Arduino uno board, and it works perfectly fine. I have two problems:

  1. When my LIN master sends a frame header (without data), and I print out the frame ID, I always get some garbage data on sio before the ID (which is detected correctly). What could be the reason for this?

  2. When I send LIN messages fast (from an scheduler thread), I get SYNC error. What is the fastest that the code can receive new frame header after sending data (or better how can one measure this?)

Cheers,
S

differend ID on serial port reported

Hi,
I tested the analyzer sctech at my System.
My setuP is a Watturino with a ATmega328P-AUR and a lin Chip TJA1021
A difference to your scematic is a 30K resistor for the slave termination (LIN Standard)
I send the Message (configured as a Master) by PCAN-LIN of PEAK company.
If i send a message some ID's seem to be different.
sent | serial report
30 | f0
31 | b1
32 | 32
33 | 73
34 | b4
35 | f5
36 | 76
37 | 37
38 | 78
39 | 39
3a | ba
3b | fb
3c | 3c
3d | 7d
3e | fe
3f | bf

The characters of the mesage are ok, just a little scramble in th message ID.
Could this be caused by the resistor in my setup?
BR
Alf

lin injector do not work at all

Hi
This is my first post here, and i like to write what i like to do.
I like to filter commands in volvo car (disable some function).
I build injector, but it not responses for lin frame.
I have only one to 3 sek blink error message led.
Master connect to slave, slave to master.
Better, i do not have any data on uart..
Could you tell me what can i check first?
Atmega328p.upladed hex from githup, without any changes..
Btw..it i setup fusebits as on github, connection to uc is not avaible..(setup clock as internal?)
Regards

Lin lin(master,4) and Lin lin(slave,15)

Hi.
Could you tell me, haw can i create object master and slave at the same time?
I have one slave what listen, and works well,second uart is as master and will resend frame.
Off-course 2 different uarts (esp32).

I try to do this way:
Lin 1 and lin 2 chip.
Lin 1 is connected to master (revived request) and lin 2 to device.
Rx lin 1 connected to tx on lin2 (to resend request from master to device).
I read on lin 2 respond and like to resend it to master ( read-filter-resend) when master send next request.
All the time when i like to resend, data is putted to the end of frame (behind respond of device), and do not possible to send it to master in correct time.
It is look like:

  1. no full duplex uarts (no possible)
  2. only read is possible on the same time using library??
  3. other bug..

Master as simple controller for windshield motor?

Hi zapta, I build a analyzer an successful read the mesages to controll a windshield motor from BMW.
I want to controll the motor out of BMW car, so only want to controll the motor with a buttons direct connected to the Atmega328p, I'm not a professional programmer and I wonder if you have a programm to direct write and send messages from a Lin master to a slave.
Thanks.

No Errors but only 1 Byte per Frame

Hey there,

I am getting some weird results here.
LIN as such seems to work. (Well, at least there is no error being printed to the console...)
However, as you can see the serial output only consists of one byte per line.
These bytes also seem to be the same every couple of bytes.

I am using a Arduino Nano clone with a Atmega328P.
The sketch is uploaded as provided in the "analyzer" subfolder of this repository. LIN signal is connected to D2.

Do you have an idea what's going wrong here?

Thanks!

1st screenshot is an overview of how the LIN data is being sent. The packet surrounded by the red rect is the one from screenshot 2
2nd screenshot is one packet of the stream
3rd screenshot is the console output

screen shot 2017-01-20 at 19 00 20

screen shot 2017-01-20 at 18 53 42

screen shot 2017-01-20 at 18 56 02

LIN Bus Hardware Question

Your LIN Bus project is very impressive and I am wondering if I can use it for a car project I am working on. I have two unused buttons in my car that I want to control aftermarket accessories via a standard digital relay.

These buttons in my car communicate with the car via both the LIN Bus and the CAN Bus. I have already confirmed the CAN Bus communication with these buttons using a CAN Bus sniffer. I have the schematics for my car which confirms that these two buttons also communicate via the LIN bus as well. I originally was going to use the CAN bus for this project based on this example here on YouTube:

https://www.youtube.com/watch?v=YK2GefWiG4w

However, after further research which includes discovering your LIN Bus project, it seems that using the LIN bus to achieve my goal is a better and cleaner solution. So, my questions are as follows:

  1. Will one of your LIN bus devices (the analyzer or the injector) work in the manner that I need to control a digital relay?

  2. If one of your LIN bus devices can't do it independently, can it work with an Arduino type micro controller (such as the Uno, Leonardo, etc) to control a digital relay, similar to the CAN bus example I provided above?

Thanks in advance for the help!

PCB routes?

Hi there,

I'm working to get the injector (unmounted) manufactured and before I submit the project, I wanted to double check an inconsistency that I noticed. In the .brd file, there are a number of GND routes on the bottom of the board that don't show up in your .pdf. They also don't show up in my PCB project views (using macrofab.com as mfg.)

Is there something here I'm missing about why they don't show up? Should they be showing up and I need to adjust settings?

I've tried redrawing the GND routes, and re uploading the files with no luck.

Thanks.

OSH Park differs from source

The Injector on OSH Park is labeled "linbus Injector Version C Rev1" and has this layout:

827bc02839406c97d3ac14fa2afe58aa

That's different from the pdfs in injector/eagle and injector/eagle_991_mounted - probably doesn't make much difference - just curious about the discrepancy.

Signal Injector

Hi, i have 2 gauge of a Smart roadster temp and turbo pressure, i want to install on a smart fortwo. The temp works, but the turbo pressure dont, the fortwo is diesel and the roadster is petrol, the pressure on the diesel is mesured on the manifold positive and the petrol is the vacum so it is negative. Is it possible to read the value and change it? Do you Know how i can identify the value on the Smart lin protocol? Were can i buy your board?
Thanks.

injector sources fail to compile with latest arduino software

Hi,

at first I was getting many "arduino.h: No such file or directory" errors, which I was able to fix by changing each occurence of arduino.h to Arduino.h.

However, now I'm getting the following errors:

In file included from sketch/sio.h:17:0,
                 from sketch/sio.cpp:13:
sketch/sio.cpp: In function 'void sio::setup()':
sio.cpp:67:16: error: 'UDORD0' was not declared in this scope
     UCSR0C = H(UDORD0) | H(UCPHA0);  //(3 << UCSZ00);  
                ^
sketch/avr_util.h:29:21: note: in definition of macro 'H'
 #define H(x) (1 << (x))
                     ^
sio.cpp:67:28: error: 'UCPHA0' was not declared in this scope
     UCSR0C = H(UDORD0) | H(UCPHA0);  //(3 << UCSZ00);  
                            ^
sketch/avr_util.h:29:21: note: in definition of macro 'H'
 #define H(x) (1 << (x))
                     ^
exit status 1

I'd very much appreciate some help.

Injector sources not compile

Arduino:1.7.8 (Windows 8.1), Scheda:"Arduino Uno"

lin_processor.cpp: In static member function 'static void lin_processor::StateReadData::handleIsr()':

lin_processor.cpp:555:67: error: no matching function for call to 'LinFrame::append_byte(uint8&)'

   rx_frame_buffers[head_frame_buffer].append_byte(byte_buffer_);

                                                               ^

lin_processor.cpp:555:67: note: candidate is:

In file included from lin_processor.h:17:0,

             from lin_processor.cpp:15:

lin_frame.h:65:15: note: void LinFrame::append_byte(uint8, boolean)

inline void append_byte(uint8 value, boolean byte_has_injected_bits) {

           ^

lin_frame.h:65:15: note: candidate expects 2 arguments, 1 provided

Errore durante la compilazione

Questo report potrebbe essere più ricco
di informazioni con
"Mostra un output dettagliato durante la compilazione"
abilitato in "File > Impostazioni"

Is a prebuilt board available anywhere?

Working on messing with my car's linbus and I need an injector. I don't even know where to start. From what I can see I'd have to order a board from OSH Park, buy all the components separately, and solder them on...I'm not confident in my ability to even buy the right components much less solder them on the board. So is there somewhere I can go to get this linbus injector prebuilt?

Obsolet parts

I am not able to find lin bus transceiver
the one in the BOM file is obsolete in digikey and i dont know which ic could be compatible.
Help please, i have already ordered pcbs.

arduino due vs LIN

Hi Zapta,

I must make a PWM-LIN converter.
I take a Arduino due, so i have frequency and duty-cycle on Canbus output.
So now i need a CAN-LIN converter.
The injetor board is the my solution? Where I can buy the board?
Is this way the correct way?
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.