Page 3 of 7

Re: CANbus to Instruments etc. working

Posted: Sun Dec 23, 2012 5:13 pm
by frank_ster
well one could fine rpm out by reving the engine. then changing the vehicle speed.
then fuel level and then coolant level.

is there such a thing as can sniffer ? any links to where i could get one ?

Re: CANbus to Instruments etc. working

Posted: Sun Dec 23, 2012 5:41 pm
by racingmini_mtl
You can Google 'CAN bus sniffer' and you should get some hits. You could also use some of my hardware which would need some minimal firmware and minimal PC software for it to be used as a sniffer: http://forum.jbperf.com/viewtopic.php?f=14&t=381.

But getting all the data from the CAN bus and making sense of it would likely be a bit more involved than what you mention. I'm not sure how easy it would be to have a single thing changing at a time. But if you're ready to put the time and effort into this, it certainly is a doable task.

Jean

Re: CANbus to Instruments etc. working

Posted: Thu Dec 27, 2012 3:46 am
by Peter Florance
Will this stay hard coded in MS3 or will there be a point where ID's, data source and multipliers would be user-input?
I'm collecting and testing some BMW data.
Thanks

Re: CANbus to Instruments etc. working

Posted: Sat Dec 29, 2012 5:57 am
by frank_ster
http://www.youtube.com/watch?v=WfSZdWHiM9k

this looks like it would be usefull

Re: CANbus to Instruments etc. working

Posted: Sat Dec 29, 2012 6:14 am
by Peter Florance
frank_ster wrote:http://www.youtube.com/watch?v=WfSZdWHiM9k

this looks like it would be usefull
I just got one to test the MS CAN output

Re: CANbus to Instruments etc. working

Posted: Sat Dec 29, 2012 7:12 am
by jsmcortina
Peter Florance wrote:Will this stay hard coded in MS3 or will there be a point where ID's, data source and multipliers would be user-input?
I'm collecting and testing some BMW data.
Thanks
The scaling factors I've seen so far can be quite cumbersome (including exponents and such) which would be difficult to expose. Simple add / multiply would be fine to expose.

James

Re: CANbus to Instruments etc. working

Posted: Sun Dec 30, 2012 7:05 pm
by acab
Does anybody add CAN code from first page to 3.2.1 or 3.2.4 releases?

I cant compile it :(


When i add to ms2_extra_can_isr.c that code:

Code: Select all

case MSG_STD:  // msg format 11 bit STD - do not let MSII mess with it
                    // reset identifier registers for standard ID
                    CAN_TB0_IDR0 = (unsigned char)(can[ix].cx_destvaroff[jx] >> 3);
                    // 8 high bits in IDR0, 3 low bits in IDR1
                    CAN_TB0_IDR1 = (unsigned char)((can[ix].cx_destvaroff[jx] & 0x0007) << 5);
                    CAN_TB0_IDR2 = (unsigned char)(0x00);
                    CAN_TB0_IDR3 = (unsigned char)(0x01);
                    CAN_TB0_DLR = (unsigned char) (can[ix].cx_varbyt[jx]);
                    for (kx = 0;kx < CAN_TB0_DLR;kx++)  {
                        *(&CAN_TB0_DSR0 + kx) = can[ix].cx_datbuf[jx][kx];
                    }
                    break;
I get:

Code: Select all

collect2: ld returned 1 exit status
make[1]: *** [ms2_extra.elf] Error 1
make[1]: Leaving directory `/home/artem/ms2extra_3.2.4_release/ms2extra'
make: *** [megasquirt] Error 2
With some magic, i found, that all problem is (its compile, but i donno about functionality):

Code: Select all

                    for (kx = 0;kx < CAN_TB0_DLR;kx++)  {
                        *(&CAN_TB0_DSR0 + kx) = can[ix].cx_datbuf[jx][kx];
                    }

Re: CANbus to Instruments etc. working

Posted: Mon Dec 31, 2012 6:33 am
by jsmcortina
This code is already present in the current MS2/Extra pre-3.3 alpha code.

James

Re: CANbus to Instruments etc. working

Posted: Mon Dec 31, 2012 11:08 am
by acab
jsmcortina wrote:This code is already present in the current MS2/Extra pre-3.3 alpha code.

James

I know, but i wanna add to stable version.

On pre-3.3 alpha i cant get work ignition :(

Re: CANbus to Instruments etc. working

Posted: Mon Dec 31, 2012 11:13 am
by racingmini_mtl
acab wrote:On pre-3.3 alpha i cant get work ignition :(
The solution is not what you're trying to do but to correct the alpha code setup. Make a new post on this and if there is a need to correct the code then it will be done. If the issue is a configuration then you will be able to correct it. And don't forget to post your msq and a log of the problem.

Jean

Re: CANbus to Instruments etc. working

Posted: Mon Dec 31, 2012 12:42 pm
by acab
racingmini_mtl wrote: The solution is not what you're trying to do but to correct the alpha code setup. Make a new post on this and if there is a need to correct the code then it will be done. If the issue is a configuration then you will be able to correct it. And don't forget to post your msq and a log of the problem.

Jean
its very hard to add code in 3.2.4?


i found problem, that i must modify memory.x, but i dont know what to change :(

Re: CANbus to Instruments etc. working

Posted: Mon Dec 31, 2012 1:36 pm
by racingmini_mtl
The thing is that if you have a genuine issue with the alpha code, it is very important that the developers know it and can correct it. Not posting about it makes sure that if there is a code issue it will not be corrected. That is a very bad way to handle a potential error and asking for help in the way you do is counter-productive.

Jean

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 4:07 pm
by acab
racingmini_mtl wrote:The thing is that if you have a genuine issue with the alpha code, it is very important that the developers know it and can correct it. Not posting about it makes sure that if there is a code issue it will not be corrected. That is a very bad way to handle a potential error and asking for help in the way you do is counter-productive.

Jean

First of all, i wanna add own code for my dashboard (instead Audi\VW). And other...

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 4:35 pm
by racingmini_mtl
acab wrote:
racingmini_mtl wrote:The thing is that if you have a genuine issue with the alpha code, it is very important that the developers know it and can correct it. Not posting about it makes sure that if there is a code issue it will not be corrected. That is a very bad way to handle a potential error and asking for help in the way you do is counter-productive.

Jean

First of all, i wanna add own code for my dashboard (instead Audi\VW). And other...
But then start with the alpha code and add to that.

And again, if you have a real problem you need to post your msq and a log of the issue. What you're doing is not helping anyone. The only way to correct the code is if we know that there is a problem and what the problem is. That's how the code becomes a stable version. If you find something and just ignore it then you are hurting everyone. And you will definitely not get any help for what you need.

Jean

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 4:46 pm
by acab
Oki!

I try add code to alpha build...

Code: Select all

    if (flash4.can_bcast1) {
        id = Engine;
        val_rpm = outpc.rpm * 1;
        val_clt = (((outpc.clt - 320) * 5) / 9)/10 + 40;
        dataLen = 0x08;
        data[0] = 0x00;
        data[1] = 0x00;
        data[2] = 0x00;
        data[3] = (unsigned char)val_clt;          // CLT
        data[4] = 0x00;                             // (fuel consumption) 0-132L L
        data[5] = 0x00;                             // (fuel consumption) 0-132L H
        data[6] = (unsigned char)(val_rpm / 32);  //= RPM                            
        data[7] = 0x00;
        ECANSendMessage(id, data, dataLen, MSG_STD);
    }
thats all, i remove all not good code for me...

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 7:04 pm
by Tjabo
Seems like we have a failure to communicate here! :lol:

Are you guys saying that acab should properly report the problem with whatever is keeping his ignition from working in the new code, so that problem can be fixed in the new code and he can use the CANBUS facility in it? There must be a better way to say it that will translate more effectively...

For what it's worth, this CANBUS stuff could be super helpful when I can get to my e39 540i/6 project later in the spring. I'm excited!

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 7:17 pm
by acab
Tjabo wrote:Seems like we have a failure to communicate here! :lol:

Are you guys saying that acab should properly report the problem with whatever is keeping his ignition from working in the new code, so that problem can be fixed in the new code and he can use the CANBUS facility in it? There must be a better way to say it that will translate more effectively...

For what it's worth, this CANBUS stuff could be super helpful when I can get to my e39 540i/6 project later in the spring. I'm excited!
By now - CANBUS functionality work (may be) only for Audi\VW, i can add code for Fiat\Alfa\Lancia. But we must recode some for choice of car brand.

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 7:23 pm
by racingmini_mtl
Tjabo wrote:Seems like we have a failure to communicate here! :lol:

Are you guys saying that acab should properly report the problem with whatever is keeping his ignition from working in the new code, so that problem can be fixed in the new code and he can use the CANBUS facility in it? There must be a better way to say it that will translate more effectively...
Yes and the message is not going through at all. Once more the reply completely ignores this... I'm done trying.

Jean

Re: CANbus to Instruments etc. working

Posted: Wed Jan 02, 2013 7:25 pm
by acab
racingmini_mtl wrote: Yes and the message is not going through at all. Once more the reply completely ignores this... I'm done trying.

Jean

Oki, i try post some errors info about pre-alpha code.

But what i must do, for add CANBUS code for my car?

Re: CANbus to Instruments etc. working

Posted: Thu Jan 03, 2013 4:56 am
by jsmcortina
acab wrote:But what i must do, for add CANBUS code for my car?
The single most important thing is to read, understand and take action on the replies that are posted on the forum.

James