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

Re: CANbus to Instruments etc. working

Postby frank_ster » Sun Dec 23, 2012 5:13 pm

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
frank_ster
Experienced MS/Extra'er
 
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Postby racingmini_mtl » Sun Dec 23, 2012 5:41 pm

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

Re: CANbus to Instruments etc. working

Postby Peter Florance » Thu Dec 27, 2012 3:46 am

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.
User avatar
Peter Florance
Super MS/Extra'er
 
Posts: 3619
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA

Re: CANbus to Instruments etc. working

Postby frank_ster » Sat Dec 29, 2012 5:57 am

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
frank_ster
Experienced MS/Extra'er
 
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Postby Peter Florance » Sat Dec 29, 2012 6:14 am

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.
User avatar
Peter Florance
Super MS/Extra'er
 
Posts: 3619
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA

Re: CANbus to Instruments etc. working

Postby jsmcortina » Sat Dec 29, 2012 7:12 am

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

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33830
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CANbus to Instruments etc. working

Postby acab » Sun Dec 30, 2012 7:05 pm

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];
                    }
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby jsmcortina » Mon Dec 31, 2012 6:33 am

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

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

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33830
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: CANbus to Instruments etc. working

Postby acab » Mon Dec 31, 2012 11:08 am

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 :(
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby racingmini_mtl » Mon Dec 31, 2012 11:13 am

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

Re: CANbus to Instruments etc. working

Postby acab » Mon Dec 31, 2012 12:42 pm

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 :(
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby racingmini_mtl » Mon Dec 31, 2012 1:36 pm

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

Re: CANbus to Instruments etc. working

Postby acab » Wed Jan 02, 2013 4:07 pm

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...
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby racingmini_mtl » Wed Jan 02, 2013 4:35 pm

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

Re: CANbus to Instruments etc. working

Postby acab » Wed Jan 02, 2013 4:46 pm

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...
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby Tjabo » Wed Jan 02, 2013 7:04 pm

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!
--'97 BMW 540i/6spd -- Single Front/Top Mount Turbo -- MS3+MS3X V3.0 Full Sequential
User avatar
Tjabo
Master MS/Extra'er
 
Posts: 773
Joined: Sat Nov 05, 2005 7:36 pm

Re: CANbus to Instruments etc. working

Postby acab » Wed Jan 02, 2013 7:17 pm

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.
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby racingmini_mtl » Wed Jan 02, 2013 7:23 pm

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

Re: CANbus to Instruments etc. working

Postby acab » Wed Jan 02, 2013 7:25 pm

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?
User avatar
acab
Experienced MS/Extra'er
 
Posts: 207
Joined: Tue Aug 21, 2012 5:52 am
Location: Minsk, BY

Re: CANbus to Instruments etc. working

Postby jsmcortina » Thu Jan 03, 2013 4:56 am

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

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33830
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

PreviousNext

Return to Other Development

Who is online

Users browsing this forum: No registered users and 1 guest