Will I, as a new user be able to make this happen? (Bmw Ibus)

ian332isport:
I can't say that ALL button functions are listed in IbusGlobals.h, but I think all the ones you need should be there. This is assuming the E39 uses the same iBus codes as the E46, but I think they should be the same.

I would think they are the same to. I have the skip buttons on my computer, so i will compare them.

ian332isport:
It really is as simple as changing MFL_RT_PRESS to MFL_SEARCH_UP. All of the MFL iBus messages are 6 bytes long, so you don't need to change the 6, but if you use any messages that are longer or shorter, you need to change the number of bytes to match.

Oh.. That's really nice! Then i might be able to do this my selfe! :smiley:

ian332isport:
I'm not sure you'll be able to get ID3 tags from that module. If you can, then it is possible to display them.

Probably not, im not able to read what type of chip that's used.
But if i have a module that supports this, will this be transmitted over RX/TX?
I have a few bt dongles that i has RX/TX connection points. Bought them after reading on a car pc forum that they would be able to be used for my project. But not planning on using them at the time.
I must try to get this up and running first, then i will have to improve it over time. :slight_smile:

ian332isport:
Two transistors may be the safest option. I'm assuming the BT module is a 3.3v device, so the 5v from an Arduino output could damage things.

Actually, the BT module can run of +12v, i think it was rated between 7-32 volts or something..
But i have ran it of a power supply with 12 volts and it worked fine. There is a +5volt connectror on the board to, but not sure what this is for. If it can run from 5 volts or if it supply 5 volts. Need to test that.
But the control voltage for the pins was 3.3 volts. Probably just have to test this to.
It was a cheap BT board so if it gets broken, the worst is to wait for a new one .. :stuck_out_tongue:

ian332isport:
When you measured the 2 volts, was that when the pin was in the high state, or just when it was being pulsed high for a short duration ? Most digital volt meters take a certain amount of time to update the display, and a short pulse may only show as 2v, even though the pin is reaching 5v.

I think it was a pulse for a few seconds, so i got a steady reading before it went LOW again.

Thanks again Ian, your answers and knowlage is greatly appreciated! :slight_smile:

Regards
Fredrik

Hi Fredrik

Alpejohn:
But if i have a module that supports this, will this be transmitted over RX/TX?

I've worked with BC127 and WT32i BT modules, and both of those communicate over Serial Rx/Tx.

Ian.

ian332isport:
Hi Fredrik

I've worked with BC127 and WT32i BT modules, and both of those communicate over Serial Rx/Tx.

Ian.

I looked at the BC127, it was pretty expensive. But if this project turns out to be a success i will consider upgrading the BT module. :slight_smile:

I will have to see if i can manage to get it working first. :stuck_out_tongue:

Fredrik

I tried to edit the sketch to suite my project last night, but ran into some problems. :sweat_smile:

After including the output pins i verified the sketch, and got this error (think this error would have come anyways though):

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Fredrik\Documents\IBUS Aux Adapter Prosjekt\Arcuino Sketch TEST\examples\ibus_lib_setup_example\ibus_lib_setup_example.ino:21:27: fatal error: AltSoftSerial.h: No such file or directory

 #include <AltSoftSerial.h>

                           ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So, without knowing what i was doing i tried to "comment out" this part:

#include <AltSoftSerial.h>
AltSoftSerial debugSerial;

Verified again, then i got this error:

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Fredrik\Documents\IBUS Aux Adapter Prosjekt\Arcuino Sketch TEST\examples\ibus_lib_setup_example\ibus_lib_setup_example.ino: In function 'void setup()':

ibus_lib_setup_example:38: error: 'debugSerial' was not declared in this scope

   debugSerial.begin(38400); // Set debug Baud rate. Keeps speed high if sending lots of debug messages over serial. 38400 is about as fast as SoftwareSerial can handle reliably.

   ^

ibus_lib_setup_example:39: error: 'class IbusSerial' has no member named 'setIbusDebug'

   ibus.setIbusDebug(debugSerial); // Tell library which serial port is used for DEBUG. Comment out line if debug disabled in IbusGlobals.h

        ^

exit status 1
'debugSerial' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Not sure what's the problem here, im using the Arduino UNO, but i don't think i will use the MCP interface chip, but the Melexis TH3122.4 chip.

That's why i tried to comment out the AltSoftSerial.

What am i doing? :blush: :sweat_smile:

You have to install the AltSoftSerial library.

DrDiettrich:
You have to install the AltSoftSerial library.

As it said "no such file in library" i found the AltSoftSerial on github, downloaded the files and put them in the folder where the sketch is located (where all the other files are).

That did not work, also tried to look at examples where the AltSoftSerial where used, and write the code under void setup, but still cant get it to work.

But it says:
#include <AltSoftSerial.h>
AltSoftSerial debugSerial;

In the start of the sketch, isnt this how the files are being included in the sketch? Or installed?

Fredrik

Hi Fredrik,

Library files need to be located in the Arduino Libraries folder, not the sketch folder. This includes my iBus library, as well as AltSoftSerial.

Ian.

The sketchbook has its own library folder, where e.g. modified copies of a library reside, or versions different from the Arduino library files. Libraries in the sketchbook folder take precedence, but the linker may issue warnings.

Copies in the sketch folder may require to change the #include directive from <...> to "..." for the header name.

ian332isport:
Hi Fredrik,

Library files need to be located in the Arduino Libraries folder, not the sketch folder. This includes my iBus library, as well as AltSoftSerial.

Ian.

Aaaah! Ofcours! As soon as i read your first words i understood what i did wrong! :grin:
After putting them in the Libraries folder the problem was solved. ;D

But then it complained about this:

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Fredrik\Documents\IBUS Aux Adapter Prosjekt\Ibus Adapter Sketch - Test\examples\Ibus_Adapter_TEST\Ibus_Adapter_TEST.ino: In function 'void setup()':

Ibus_Adapter_TEST:39: error: 'class IbusSerial' has no member named 'setIbusDebug'

   ibus.setIbusDebug(debugSerial); // Tell library which serial port is used for DEBUG. Comment out line if debug disabled in IbusGlobals.h

        ^

exit status 1
'class IbusSerial' has no member named 'setIbusDebug'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

As it says in the comment for this line, i can comment out this line if debug is turned off in IbusGlobals.h, so i did. And now it verifies the sketch with no problems. :slight_smile:
I checked the IbusGlobals.h file, and the debug seems to be deactivated (commented out)

But is this something i need in my project? Or can i just leave it like this? :slight_smile:

DrDiettrich:
The sketchbook has its own library folder, where e.g. modified copies of a library reside, or versions different from the Arduino library files. Libraries in the sketchbook folder take precedence, but the linker may issue warnings.

Copies in the sketch folder may require to change the #include directive from <...> to "..." for the header name.

I put the AltSoftSerial files in the Library folder located in my "My documents" folder, same place where the sketch folder is located, is this what you refere to as sketchbook?
Is there other places where i should be putting the libraries to?

Many thanks!

Regards
Fredrik

See the IDE menu for the location of your sketchbook, it may be your MyDocuments folder, where all your sketches are stored by default.

Original libraries should reside in the Arduino libraries folder. Modified libraries should reside in the sketchbook libraries folder, for use by all your sketches. Libraries inside a sketch folder are for use only by that particular sketch.

DrDiettrich:
See the IDE menu for the location of your sketchbook, it may be your MyDocuments folder, where all your sketches are stored by default.

Original libraries should reside in the Arduino libraries folder. Modified libraries should reside in the sketchbook libraries folder, for use by all your sketches. Libraries inside a sketch folder are for use only by that particular sketch.

Ah, there is a Libraries folder in the installation folder for Arduino software also, not just in my documents. There where several libraries for the sketches that comes with the software. :slight_smile:

Hi Fredrik,

There's various different levels of debug in the library. For normal use, you don't need any of them, but they can be useful diagnostic tools if you're having problems sending or receiving iBus messages.

Ian.

I have good news! Actually, its awsome great news! :grinning:

I have just tested the ibus adapter, connected it to the arduino loaded with the ibus sketch, with minor adjustments to suite my project and connected the bluetooth module to the arduino.

And guess what?! :grin:

IT WORKS!!!

Video proof ;D

Worked on the first try! Exept that i had forgotten to add the skip backwards command for one of the pins the first time. :slight_smile:
So now im just waiting for the circuite board i drawed in Eagle software and got produced in china (the drawing i found on the curious ninja site) So i can have the ibus adapter on a proper board :slight_smile:
I might test it in my car tomorrow, if the weather is ok. But need to make the connections a bit more stable first i think.

But i was wondering of a thing, if i want to add a commandt thats not listed in the Ibusglobals.h, is it as simple as getting the ibus telegram for that function, and writing it in the same way as the other commands are written? The number [6] must corrospond to the length of the message right? Or the bytes.. Remember you wrote something about that earlier.

Would be nice to also impliment the "long press", so its possible to fastforward.. :slight_smile:

Anyways, thank you so much for all your imputs DrDiettrich!
And special thanks to you Ian, witch supported me with the complete working code!
I could never have done this without your help. :slight_smile:

Hi Fredrik,

Alpejohn:
IT WORKS!!!

Excellent news :slight_smile:

if i want to add a commandt thats not listed in the Ibusglobals.h, is it as simple as getting the ibus telegram for that function, and writing it in the same way as the other commands are written?

Yes, that's all you need to do.

The number [6] must corrospond to the length of the message right? Or the bytes.. Remember you wrote something about that earlier.

Also correct. You don't strictly need to put the number of bytes inside the square brackets, as the compiler will calculate it for you, but I like to put it there for reference, as you need to know how many bytes in each message when you use the memcmp function in your sketch.

And special thanks to you Ian, witch supported me with the complete working code!
I could never have done this without your help. :slight_smile:

Glad to help a fellow BMW driver 8)

Awsome!

Just a addon question, why is there a zero in front of every byte? Its not there when it gets tramsitted on the bus?

Oh, i have another one.. hehe :stuck_out_tongue:
Is it possible to make the sketch SEND messages on the ibus to?
Then im thinking of making the mirrors fold when locking, and unfold when the key is in position 2, or engine running or something.. There are a lot of "boxes" for sale where the fold/unfold mirror option is avaleble, but it always fold/unfold when locking/unlocking.. And i think thats stupid, as its not nesecarry to unfold if you just going to get your wallet or whatever.. But when you start the car, then it make sense to fold out automatically.. :stuck_out_tongue:

I have a feeling i can make a lot of cool stuff with this ibus thing.. :smiley:

Alpejohn:
Just a addon question, why is there a zero in front of every byte? Its not there when it gets tramsitted on the bus?

0x just shows that the byte is Hexadecimal.

Is it possible to make the sketch SEND messages on the ibus to?

Yes, just use commands like this:

ibus.write(CD_STOP, sizeof(CD_STOP));

This obviously sends the CD_STOP command, but change it to any command you like.

Ian.

Oh, I can see its written in the example code.. I had deleted this in my project so I didnt see it. :slight_smile:

Lets say i add the command for mirror fold in the ibusglobals.h, would i be writing something like
ibus.write(FOLD_MIRROR, sizeof(FOLD_MIRROR); ?

Ok, just one more question, then i wont bother you for a few days :grin:
I have looked in the ibusglobals.h for this, but not found it..
Is there a command for sending text messages to IKE? (the high obc cluster display)
Saw the ibus.radioWrite("Vol Down"); but i guess that wont show up in IKE.. :slight_smile:

Thanks again :slight_smile:

Hi Fredrik,

Alpejohn:
Lets say i add the command for mirror fold in the ibusglobals.h, would i be writing something like
ibus.write(FOLD_MIRROR, sizeof(FOLD_MIRROR); ?

Yes, that should do it.

Is there a command for sending text messages to IKE? (the high obc cluster display)
Saw the ibus.radioWrite("Vol Down"); but i guess that wont show up in IKE.. :slight_smile:

All of the display functions simulate messages coming from the telephone (TEL) module to the IKE, so there's a good chance that these will end up on either the MID or IKE (or both). I'm not familiar with the E39 though.

Try sending ibus.radioWrite("Fredrik"); and see what happens. It won't do any damage.

Ian.

Very nice! Then i have some more to play with! :grin:

More great news!
Just been out in my car and connected everything to test it.
It works there to! Not just on my desk. :grin:

Everything was in the back though, as i have a ready made +/- and ibus connection there used for navcoder. :slight_smile:

But i got it on memory! (or tape.. ::slight_smile: )

Neede to solder some wires to get audio, and think i will solder the whole circuite on a arduino uno prototyping board that i have. Then its a bit more robust. :slight_smile: