-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIN Slave Example #4
Comments
No, not with this library, sorry! A LIN slave library looks very different from a master library. Actually I've been playing with an Arduino LIN slave library for AVR, but frame synchronization requires special measures. Reason is that LIN slaves use a Sync Break (=>13bit dominant) for frame synchronization. To the slave that looks like 0x00 with a framing error (=no stop bit received). But Arduino For AVR like Arduino Mega I therefore modified the NeoHWSerial library by SlashDevin to store the framing error as well. You find the modified version here. The (largely untested) LIN slave library is not available via Github yet, but I've attached it as LIN_slave.zip Let me know if that works for you. Have fun, |
Thanks so much for the info and files. Just a few issues compiling in my environment: In the example file LIN_Daimler_MRA2.ino should the LIN_master3.h be including from the library: LIN_master_emulation_with_background_operation at version 1.4 It's using the above and there are a few compile errors relating to: "no matching function for call to 'LIN_Master_3::begin(int, LIN_version_t)" Also there are a few compile errors relating to calling function sendSlaveResponse, which I see is a function included in the LIN_slave.zip file LIN_slave3 PS I'm using the Mega2560 for testing. Regards, |
oh darn! The example is for a LIN master, not a slave :-( Looks like I have to do some more work... Forget what I sent you before. I have to clean up the mess first. Sorry! |
No worries, I was just looking through the code to see if I could fix it by replacing the master references with slave based on the header definitions. The sendSlaveResponse function seems to be in the header file but missing from the cpp. Just a bit lost now :) |
I did a quick check and I'm afraid that it's quite some effort to create a GENERIC library. However, it should be straightforward to implement a specific LIN slave. So you have a LDF or protocol description you could share?Am 14.12.2022 5:45 nachm. schrieb patrickjsimons ***@***.***>:
No worries, I was just looking through the code to see if I could fix it by replacing the master references with slave based on the header definitions. The sendSlaveResponse function seems to be in the header file but missing from the cpp.
Just a bit lost now :)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
I'm working on iBus using an MCP2003 transceiver at the physical layer within a 2004 Range Rover L322. It's BMW's implementation as they owned Land Rover at the time. I retro fitted an Android radio and I'm looking at developing an app that I'll install on the radio that can be used to display and reset non-critical devices while the car is in park mode. The app will eventually communicate beyond the Kline and access other protocols such as CAN, which I'll use to read and reset faults. The starting point is to receive messages from the steering wheel radio controls, which are working out-of-the box with the retro fitted radio. I first need to simulate on the beach a slave device that is able to control the radio such as volume controls, etc., and I can work my way up to simulating other devices later. As a staring POC I have two Arduino devices communicating at a very basic level through two MCP2003 chips that are connected to a UNO and Mega device. |
hi again,
As said, LIN slave is not really the problem, but creating a generic library is. But I hope the above already helps you...!? PS: I'm busy with another project right now, so please don't hold your breath... ;-) |
Any help on this is greatly appreciated. I'll continue on in the background to see if I can expand out the POC. It's all exploratory at this stage so not really sure myself about the details. Transferring data from one Arduino to another via two MCP2003 ICs is quite straightforward. The hard part for me is getting it working within the context of a real network in my car i.e. when I connect it to the LIN bus I see no data. The first task I'm trying to solve is viewing the data on the car network when the radio remote steering wheel controls are pressed, and after storing these codes, the second task is to transmit them over a bench setup LIN network that has the radio connected with two Arduino devices: 1 slave and 1 master. My understanding is there can only be one master device on the network and that the salve devices communicate via the master device. If this is correct, I was looking at using your LIN master project to simulate the LIN master device in the car, and a LIN slave device to simulate the sending of control button presses to the radio via the LIN master. Am I on the right track here or have I missed the context of what your LIN Master project is intended for? |
You are correct, there must only be 1 master in a LIN Network. However I'm still unclear what you want to achieve exactly. Can you please draw a picture of the network with nodes and which ones are Arduino? Thanks in advance!Am 16.12.2022 2:01 nachm. schrieb pjs ***@***.***>:
Any help on this is greatly appreciated. I'll continue on in the background to see if I can expand out the POC. It's all exploratory at this stage so not really sure myself about the details.
Transferring data from one Arduino to another via two MCP2003 ICs is quite straightforward.
The hard part for me is getting it working within the context of a real network in my car i.e. when I connect it to the LIN bus I see no data.
The first task I'm trying to solve is viewing the data on the car network when the radio remote steering wheel controls are pressed, and after storing these codes, the second task to the transmit them over a bench setup LIN network that has the radio connected with two Arduino devices: 1 slave and 1 master.
My understanding is there can only be one master device on the network and that the salve devices communicate via the master device. If this is correct, I was looking at using your LIN master project to simulate the LIN master device in the car, and a LIN slave device to simulate the sending of control button presses to the radio via the LIN master.
Am I on the right track here or have I missed the context of what your LIN Master project is intended for?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
The above shows the high-level bench setup that I'm using. The radio is powered from a car battery and the LIN bus is powered by a seperate 12v power supply. When I connect the radio into the car using three wires i.e. ground, battery, and LIN, the remote steering wheel controls work fine. If I can get it working on the bench, the next test will look at connecting the slave and radio into the car for more testing and to see if it can coexist without conflicts. I'll then build out the slave to have more control over devices and finally interface the slave into the radio app that I intend to build. |
Thanks a lot for the explanation! Do I understand correctly that the Arduino Mega listens to the LIN bus and forwards selected information to the radio app (USB or Serial)? It doesn't send any data to the LIN bus...? Georg Am 16.12.2022 8:49 nachm. schrieb pjs ***@***.***>:
The above shows the high-level bench setup that I'm using. The radio is powered from a car battery and the LIN bus is powered by a seperate 12v power supply. When I connect the radio into the car using three wires i.e. ground, battery, and LIN, the remote steering wheel controls work fine. If I can get it working on the bench, the next test will look at connecting the slave and radio into the car for more testing and to see if it can coexist without conflicts. I'll then build out the slave to have more control over devices and finally interface the slave into the radio app that I intend to build.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
The plan is to send it from the slave to the LIN bus direct just it was a
standard slave device installed in the car.
Regards,
Patrick
…On Sat 17 Dec 2022 at 17:17, Georg Icking-Konert ***@***.***> wrote:
Thanks a lot for the explanation! Do I understand correctly that the
Arduino Mega listens to the LIN bus and forwards selected information to
the radio app (USB or Serial)? It doesn't send any data to the LIN
bus...? Georg Am 16.12.2022 8:49 nachm. schrieb pjs ***@***.***>:
The above shows the high-level bench setup that I'm using. The radio is
powered from a car battery and the LIN bus is powered by a seperate 12v
power supply. When I connect the radio into the car using three wires i.e.
ground, battery, and LIN, the remote steering wheel controls work fine. If
I can get it working on the bench, the next test will look at connecting
the slave and radio into the car for more testing and to see if it can
coexist without conflicts. I'll then build out the slave to have more
control over devices and finally interface the slave into the radio app
that I intend to build.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are
receiving this because you commented.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATN6RUARUT4OG7IKQRSVIE3WNXYTLANCNFSM6AAAAAAS5YYL4U>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
here is a small LIN sniffer project which allows you to log the LIN traffic (but no sending). It requires a modified NeoHWSerial library available from https://github.com/gicking/NeoHWSerial and runs on an Arduino Mega 2560. I believe the code is self explanatory. Please let me know if this works for you |
if I now understand you correctly, I think that would require creating a new LIN sub-net. So here's my understanding, please correct me if I'm wrong.
Is my understanding now correct? If yes, please note some LIN properties, which you should know:
Especially from the last statement you see that - unless you can change the LIN master scheduler - there is no free frame ID to send data from your slave to the bus. But before I continue discussing options (LIN sub-bus), please confirm if my above understanding is correct - or correct it. Maybe I'm still missing something...!? Georg |
I’m still trying to get my head around this jigsaw puzzle before I get around to actually building the App. I might be going in the wrong direction, however, I suspect that the only option available for the App is to communicate via the K bus wire on the radio (which I’m assuming is LIN) and the K wire will connect to the Arduino via a LIN transceiver. The Arduino in turn will likely communicate with the diagnostic port as opposed to connecting directly to one of the networks listed in the table below. I’m assuming that typical diagnostic tools are not acting as LIN slaves when communicating via the diagnostic port? Directly answering your questions above:
The purpose of the LIN slave initially is just for experimentation, i.e. there isn’t really any practical example where I would need to simulate the radio controls. However, being able to do this on a bench setup, independent of the car devices, will assist greatly with understanding how these networks work, and hopefully will be useful to others too. |
Some additional information to the above which I extracted from the workbook manual: A number of different types of data bus are incorporated into the vehicle wiring harnesses for the transmission of commands and information between ECU’s.
Serial interface circuits in the ECU’s transmit and receive commands and information on the buses as digital messages. ECU’s connected to the same bus use a common protocol (format) and baud rate (transmission speed) for the messages they transmit. The protocol and baud rate varies between bus networks. To enable messages to be exchanged between ECU’s from different bus networks, the instrument pack provides a communication gateway. A microprocessor in the instrument pack converts and/or re-transmits messages between bus networks. |
That's great. I'll set this up to see what I can log. |
Hello, nice lin master code. i will test it soon... There is een old project that i worked with. That has an injector and a slave logger tools... |
I've been working on integrating the Android radio and Arduino into the car, which is taking some time. The above diagram shows how the Arduino integrates to the car via existing harness connections. The diagram is an extract from a video that I'm in the process of editing, which will show the end-to-end setup, installation and operation. I'm in the process of installing a secondary car battery, which will power the Amp and Arduino. The battery will connect to the main power via an ignition key triggered new relay. I'll be able to start testing the initial Arduino communications using the LIN Sniffer as soon as the initial installation is complete. @hnsmarkt thanks for sharing the link, this might come in handy when I move on to building the Android App, which will interface to the Arduino via USB. |
check this link https://modbmw.com/shop/ibus-interface/ and this one for you'r project http://www.navcoder.com/downloads/NavCoderDownload.htm#navcoderrelease |
i use this (smart) relay for use off a second battery https://www.samlex.com/product/bs-100-dual/ it protects the main (start) battery. It can be triggert by ignistion but it is a option. it checks the voltage of the battery bank. read the manual on the site. |
This looks like an excellent product for seamlessly adding a secondary battery. In my case I would need to use the connection to the starter motor, which will be activated just at the point the key is fully turned, then it will drop back to normal operation. |
In my original post above I was using the MCP 2003 transceiver. This was pending delivery of a number of TH3122 transceivers, which are much better as they have built in collision detection. The Modbmw iBus interface above also uses the TH3122 chip. |
Is it possible to reuse this library to build an example slave project that connects to either a LIN master implementation or to a physical network in a car?
The text was updated successfully, but these errors were encountered: