CANbus to Instruments etc. working

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

frank_ster
Experienced MS/Extra'er
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Post 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 ?
2005 subaru legacy with buick grandnational engine and awd :D
1976 gmc k10 pickup vortec 383 tbi ms2 nv4500 3.42 final drives
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post 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
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Peter Florance
Super MS/Extra'er
Posts: 3653
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA
Contact:

Re: CANbus to Instruments etc. working

Post 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
Peter Florance
PF Tuning
81 BMW Euro 528i ESP Car
60-2 Wheel LS2 Coils, Low Z Inj
Co-Driver 1999 BMW E46 DSP car.
frank_ster
Experienced MS/Extra'er
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Post by frank_ster »

http://www.youtube.com/watch?v=WfSZdWHiM9k

this looks like it would be usefull
2005 subaru legacy with buick grandnational engine and awd :D
1976 gmc k10 pickup vortec 383 tbi ms2 nv4500 3.42 final drives
Peter Florance
Super MS/Extra'er
Posts: 3653
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA
Contact:

Re: CANbus to Instruments etc. working

Post 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
Peter Florance
PF Tuning
81 BMW Euro 528i ESP Car
60-2 Wheel LS2 Coils, Low Z Inj
Co-Driver 1999 BMW E46 DSP car.
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANbus to Instruments etc. working

Post 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
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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];
                    }
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANbus to Instruments etc. working

Post by jsmcortina »

This code is already present in the current MS2/Extra pre-3.3 alpha code.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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 :(
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post 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
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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 :(
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post 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
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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...
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post 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
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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...
Tjabo
Master MS/Extra'er
Posts: 846
Joined: Sat Nov 05, 2005 7:36 pm

Re: CANbus to Instruments etc. working

Post 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!
--'98 Dodge Neon ACR Turbo - MS3 beta test car - Sold
--'97 BMW 540i/6spd - Single Front/Top Mount Turbo 550+ HP - MS3+MS3X V3.0 - Sold but ripping in Vegas
--'97 BMW 328i 5.3 L33/TH400 Swapped drift car - MS3+MS3X V3.0 Full Sequential - Turbos And Radiator In the Trunk 9.6@144 on a 1.55 60ft
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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.
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post 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
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post 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?
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANbus to Instruments etc. working

Post 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
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Post Reply