Still trying to read F series lin bus...
I got acces to an osciloscope, connected it to the car, as Ian suggested. I saw what looks like a typical lin signal. The 13 bits break and the sync byte (x55 or 01010101 binary) were there, i have included a picture of the signal.
However when i read the bus with an arduino i cant find any sync byte x55, i even dumped the data in binary format and looked for '01010101' with no results.
I'm lost right now, starting to think i have some hardware problem on the arduino side ?
So not much of my own code to post, I only modified the Serials to suit an Arduino Mega instead of an UNO + usb-serial adapter, and modified IBusSerial.cpp at IbusSerial::readIbus() with:
ian332isport:
I don't think you'll have much success with that code. It was written specifically to decode BMW iBus messages, not standard LIN frames.
Ian.
Yes, I started with that code but as it wasnt working im just using now to dump binary data with the little modification i posted.
Anyways i bought a 50$ Lin analyzer and hope it will clear all my doubts.
Thanks guys.
How is working the send buffer? Can handle the buffer more than one ibus message?
I can't figure out, where the buffer differences between two messages, because of the pause between two messages.
How is working the send buffer? Can handle the buffer more than one ibus message?
I can't figure out, where the buffer differences between two messages, because of the pause between two messages.
Hi,
It uses a circular buffer on both send and receive. You can send several messages, and the library will buffer them and send them out with a gap of 10mS between each message.
At the moment have connected the nano with mcp2025 to ibus and do some things (cdc emu, welcome/leaving light, comfort blink, flash to pass, fog turn light, DRL, mirror folding) directly in the arduino. all messages forwarded as string via serial to the raspberry. and it is possible to receive messages from serial to transmit to ibus. and some other commands for config the arduino.
but the ibus part of the program needs lot of memory.
If memory is tight, you may want to consider something like a Teensy 3.2 instead of the Nano. My library was originally written for the Teensy, so no problems with compatibility.
harryberlin:
At the moment have connected the nano with mcp2025 to ibus and do some things (cdc emu, welcome/leaving light, comfort blink, flash to pass, fog turn light, DRL, mirror folding) directly in the arduino. all messages forwarded as string via serial to the raspberry. and it is possible to receive messages from serial to transmit to ibus. and some other commands for config the arduino.
but the ibus part of the program needs lot of memory.
Hi Harry, interesting to see others doing the same stuff!
You say you created an option for welcome lights, this is what I'm trying to get working on my E46.
I used navcoder for testing, works great! I then started with some short hex messages such as turning on the light under the rearview mirror and Opening windows. These commands work fine.
However for the lights (outside) the messages are much longer. These won't work for some reason.
Sometimes the messages show up split in Navcoder. When sending them more often at some point the whole message will show up correctly. However nothing happens!
None of the modules or only some of them respond. When I send the exact same message with navcoder, it works fine!?
NavCoder sent:
2018-05-18 17:02:56.684 3F 12 D0 0C 00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00 2D DIA LCM Set IO status Data="00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00" [ ÿÿb> € €€ ]
2018-05-18 17:02:56.701 D0 03 3F A0 4C LCM DIA Diagnostic command acknowledged Data="" []
arduino sent:
2018-05-18 17:03:57.184 50 04 68 32 11 1F MFL RAD Volume Control Increase 1 step
2018-05-18 17:03:57.232 12 WARNING: Discarded data
2018-05-18 17:03:57.279 D0 0C 00 00 FF FF 62 3E 00 80 00 80 80 00 LCM GM Cmd_0x00 Data="FF FF 62 3E 00 80 00 80 80"
2018-05-18 17:03:57.296 00 00 00 2D WARNING: Discarded data
2018-05-18 17:03:57.343 50 04 68 32 11 1F MFL RAD Volume Control Increase 1 step
2018-05-18 17:03:57.367 50 04 68 32 11 1F MFL RAD Volume Control Increase 1 step
2018-05-18 17:03:57.500 3F 12 D0 0C 00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00 2D DIA LCM Set IO status Data="00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00" [ ÿÿb> € €€ ]
2018-05-18 17:03:57.552 50 04 68 32 11 1F MFL RAD Volume Control Increase 1 step
2018-05-18 17:03:57.691 3F 12 D0 0C 00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00 2D DIA LCM Set IO status Data="00 00 FF FF 62 3E 00 80 00 80 80 00 00 00 00" [ ÿÿb> € €€ ]
2018-05-18 17:03:57.736 50 04 68 32 11 1F MFL RAD Volume Control Increase 1 step
What are your thoughts about this?
I read you are using an mcp2025
Maybe this would solve my problem?
i don't use the ibus library at the moment. i use use my own ino code. but i have seen, the library don't check the echo.
is the delay between two chars short enough?
otherwise, i have no idea what goes wrong in your case.
what hardware do you use?
About the delay, I'm not entirely sure where the delay for sending messages is located in the code. If there even is a delay..
If I'd guess I'd say it's not "static const byte packetGap = 10;" That seems to be the time to wait before sending a message after the bus becomes available.
I haven't found anything else indicating a delay between sending chars.
Would you mind taking a look and see If you are able to find it?
Many thanks!