Addon device with CAN pass through

For discussion of Phil Tobin's Tuner Studio software (Only about the tuning software itself, not about how to tune or firmware features)

Moderator: LT401Vette

drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Addon device with CAN pass through

Post by drytoast »

I've managed to stumble my way though most of the process of having TunerStudio talk to my add on device over the CAN bus but I'm stuck on one piece that I don't know how to get around.

Background:
- MSPNP-DIY with microsquirt module
- custom additions board that communicates with the MS over the CAN bus
- originally just using the gpioadc and gpioports to communicate to/from to the MS2, works fine

I am in the process of setting up the CAN device in TS so I can update configuration without needing to connect a programmer. I have the start of an ini file that I've attached. However, TS says that it can't communicate. The appropriate lines in the comm debug are:

Code: Select all

4/20/12 12:27:11 AM :Info: Going Online with MS2/Extra release 3.2.1 20111221 14:40GMT (c)KC/JSM/JB  u
4/20/12 12:27:11 AM :Info: Comms Watchdog is inactive
4/20/12 12:27:11 AM :Info: Started Comms Watchdog
Time: 0:01.232: SENT, 7 bytes
x72 x07 x0F x00 x00 x00 x14 

4/20/12 12:27:11 AM :Debug: High Speed Paint: true
4/20/12 12:27:11 AM :Debug: !!! Opened Dash 1352
Time: 0:01.632: Received, 20 bytes
x42 x57 x20 x4D x53 x32 x20 x41 x64 x64 x6F x6E x73 x20 x76 x31 
x2E x30 x30 x00 

4/20/12 12:27:12 AM :Warning: Unsupported Controller Firmware.
The return values from the device appear to match what is in my ini file but it says unsupported controller firmware. I tried adding a 20th byte in both the ini file and the device but its the same output with a character in place of the last null.

Any ideas? I don't see any other requests to my device except for the 3 requests to get the signature.

Thanks

Brett
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Re: Addon device with CAN pass through

Post by drytoast »

I should also note that with the frontpage that I've configured I get another warning at start that I don't think has anything to do with it:

Failed to load project
Reported Error:
Cluster not found for FrontPage, and no default gauge set defined in configuration


Also, I did notice that if I give it an incorrect signature, it just says "failed to communicate ... disabling ..." but when the signatures are correct it also adds "Settings Changes Made to this controller will not ...." to the dialog. So it does appear to act a bit differently when the signatures match... just not the way I'd like it to. :D
LT401Vette
Super MS/Extra'er
Posts: 12733
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Addon device with CAN pass through

Post by LT401Vette »

TS will not connect unless it recognizes the firmware family.
What is this add on board for?
What is the firmware with serial signature:
"BW MS2 Addons v1.00"

I have not seen this before.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Re: Addon device with CAN pass through

Post by drytoast »

Ah. That would be why. The board is my own stuff. It does a bunch of little things like knock sensing, vss, idle PWM (so I can have full resolution values), etc Basically a little play area for me that sits beside the MS2.

I thought that I just had to have the board and ini firmware match as the ini describes everything about what requests to send. Didn't realize that it also needed to match a list of known hardware. If I were to exchange the firmware name with something that it already knows about, I'm assuming that it would work then?
LT401Vette
Super MS/Extra'er
Posts: 12733
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Addon device with CAN pass through

Post by LT401Vette »

Yes, Actually you just need to use a currently known beginning like "MS2Extra" So say you called it:
"MS2Extra Add On 1.0"

That will work. If you get serious with it, a signature pattern for it can be added..

This check is really there primarily to prevent a the adoption of MS firmware, changing the signature to run on non MegaSquirt hardware as their own firmware.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
drytoast
Helpful MS/Extra'er
Posts: 46
Joined: Thu Jun 14, 2007 3:24 am
Location: Seattle, WA

Re: Addon device with CAN pass through

Post by drytoast »

Awesome. I'm just happy to have a way to configure stuff on my board without having to leave a JTAG header dangling out the back of the enclosure. I don't have any intention of this hardware going anywhere other than my own car. It is, however, stored on github (https://github.com/drytoastman/MiataECU) but the complete and total lack of documentation should stop it from going anywhere. :D

I attached a picture. It plugs into some of the headers on the PNP-DIY board underneath.
martinperry
MS/Extra Newbie
Posts: 12
Joined: Sun Jun 10, 2012 2:20 am

Re: Addon device with CAN pass through

Post by martinperry »

Hi There. I am having a bit of trouble setting up the CAN pass through. Setup is:
MSII & GPIO, GPIO is used as PWM fan & water pump controller and reads egt. Cooling control getting 'coolant' from MSII works fine.
When i try to set up the CAN pass through in the Tuner Studios MS Lite! v1.006 project properties I get the following error:

CAN Device Firmware Signature Mismatch!!!
Current configuration serial signature:'Template 1.000 '
Controller required serial signature:'MSII Rev 2.90500 '
Controller reported firmware version>**V2.90Embedded code by B&G*'
end of the world if you connect etc....

GPIO.ini is used as device config file in Tuner Studios
Code used in GPIO is template.mcp - generates S19 file no problem.
When I ignore the 'end of the world' message and connect anyway - the current display works fine. If I right click a gauge it gives me GPIO gauge template options, but the info displayed looks dodgy. egt2 just sits solid at a count of 30720. Data log shows the same CAN data as the CAN gauges.

I have probably missed something really basic here. Any help would be appreciated.
LT401Vette
Super MS/Extra'er
Posts: 12733
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Addon device with CAN pass through

Post by LT401Vette »

It sounds like the signature command in your in is still pointing at CAN ID 0.

If you upgrade to TunerStudio 2.0, you can set the CAN ID through the ui
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
martinperry
MS/Extra Newbie
Posts: 12
Joined: Sun Jun 10, 2012 2:20 am

Re: Addon device with CAN pass through

Post by martinperry »

Thanks for the help. Still struggling sorry. Have upgraded to Tuner Studio v2.0, changing the Main Controller CAN id (0 or 1)has no effect. If I change the signature in the GPIO ini to what the error says it is expecting (MSII Rev 2.90500) the signature mismatch error goes away, Tuner Studio attempts to connect, but a comms error replaces it - tried reading 3 times etc....

I dont understand serial comms very well sorry. Totally appreciate the help. Any other ideas?
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Addon device with CAN pass through

Post by jsmcortina »

What command is the ini using to check the firmware signature?

Enable debug comms logging and look in the TunerStudioAppDebug.txt file to see what commands TS is sending and what reply it is getting.

Post relevant extracts of both files here.

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".
martinperry
MS/Extra Newbie
Posts: 12
Joined: Sun Jun 10, 2012 2:20 am

Re: Addon device with CAN pass through

Post by martinperry »

Hi James. Thanks for the help. Not 100% sure exactly what parts of the Debug you need to see. There appears to be some sort of java warning at the start
Java warning.txt
.
This appears every time in debug. If no CAN device is enabled everything works fine so not sure if this is important or not. Also attached is part of the debug where it appears the GPIO is loaded?
GPIO load.txt
Lastly this is what I think is the ini firmware signature request
GPIOsignature.txt
Thanks again - help is definitely appreciated.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Addon device with CAN pass through

Post by jsmcortina »

Your signature fetch commands are not CAN enabled.

What is happening is that you are sending the local device a "Q" command so it replies with the local serial signature. What you actually want to do is send the equivalent of a Q to the remote device.

You need something like this:

Code: Select all

#if CAN_COMMANDS
   versionInfo    = "r\x00\x0e\x00\x00\x00\x3c"  ; Title bar
   queryCommand   = "r\x00\x0f\x00\x00\x00\x14"  ; Verify against signature.
#else
   versionInfo    = "S"  ; Put this in the title bar.
   queryCommand   = "Q"  ; Verify against signature.
#endif
(Note that you'll need to change the CANid.)

This works with MS2/Extra, MS3 and my trans firmware. I am unsure whether MS2/BG or GPIO support it, if they don't you are snookered.

The info you posted did answer the question, but the comms log extracts I was hoping to see were something like this:

Code: Select all

Time: 63:05.007: SENT, 1 bytes
x51                                                                   Q

13/06/12 00:30:17 :Info: Started Comms Watchdog
Time: 63:05.407: Received, 20 bytes
x4D x53 x32 x45 x78 x74 x72 x61 x20 x53 x65 x72 x69 x61 x6C x33       MS2Extra Serial3
x32 x33 x20 x00                                                       23 .

Time: 63:05.408: SENT, 1 bytes
x53                                                                   S

Time: 63:05.809: Received, 60 bytes
x4D x53 x32 x2F x45 x78 x74 x72 x61 x20 x62 x65 x74 x61 x20 x20       MS2/Extra beta  
x20 x33 x2E x32 x2E x33 x20 x20 x32 x30 x31 x32 x30 x36 x30 x35        3.2.3  20120605
x20 x32 x31 x3A x31 x34 x42 x53 x54 x20 x28 x63 x29 x4B x43 x2F        21:14BST (c)KC/
x4A x53 x4D x2F x4A x42 x20 x4D x53 x32 x00 x87                       JSM/JB MS2..

13/06/12 00:30:18 :Info: Going Online with MS2/Extra beta   3.2.3  20120605 21:14BST (c)KC/JSM/JB MS2
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".
martinperry
MS/Extra Newbie
Posts: 12
Joined: Sun Jun 10, 2012 2:20 am

Re: Addon device with CAN pass through

Post by martinperry »

Thanks James. Problem sorted. Had to enable a line of code in the main.c of template project (unsigned char cx_outmsg_no[NO_CANMSG];) - it was commented out. I now appear to be receiving CAN pass through info!! :D
Unfortunately for me - the EGT2 info is not showing yet. Will play with the code a bit more, suspect A to D problem.

Your help is definitely appreciated! Cheers!
SebastianS
MS/Extra Newbie
Posts: 22
Joined: Sat Apr 20, 2013 4:06 am

Re: Addon device with CAN pass through

Post by SebastianS »

Hello everyone, it seems I'm facing similar problems like martin did last year.

My setup:
MS3/Extra with firmware "ms3-pre1.3alpha2" (currently powered through a JimStim board)
GPIO-DIY board with the template firmware found here, mainly intended for EGT and VR wheel speed sensing
TunerStudio MS v2.0.8

If I don't enable CAN devices in TS, I've got no problems connecting to my MS3 and everything works fine.
When I do insert a CAN device however, after changing the Signature in the "GPIO_template.ini" file, I'm getting the attached error messages on-screen (TSError.jpg + TSError2.jpg)

After clicking OK, on all 3 of them, I'm getting my standard Dashboard lit up as normal but the gauges don't react to the Stim's signals anymore. Switching to the "CAN1"-Dashboard, I'm seeing the attached image (CAN1_Dashboard.jpg) that doesn't change over time either.

I also tried using the template's code project martin mentioned in his last post but unfortunately it won't compile on my computer, stating that it can't find the include-files ("hcs12def.h" etc) though they are present in the project's folder.

Any help would be greatly appreciated!

-Sebastian
LT401Vette
Super MS/Extra'er
Posts: 12733
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Addon device with CAN pass through

Post by LT401Vette »

MS3/Extra with firmware "ms3-pre1.3alpha2" (currently powered through a JimStim board)
GPIO-DIY board with the template firmware found here, mainly intended for EGT and VR wheel speed sensing
TunerStudio MS v2.0.8
ms3-pre1.3alpha2 requires the beta TunerStudio

However, I think there is currently an issue with secondary CAN devices in the current beta that was just reported last Friday.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
SebastianS
MS/Extra Newbie
Posts: 22
Joined: Sat Apr 20, 2013 4:06 am

Re: Addon device with CAN pass through

Post by SebastianS »

I also tried it with TS' latest beta before - same result. Will try to flash the MS3 back to a non-beta firmware soon. I'll keep you updated.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Addon device with CAN pass through

Post by jsmcortina »

While the secondary project stuff ought to work, with MS3, if possible I would suggest that you configure the MS3 to read the data from the other CAN device itself and use a normal MS3 project without a secondary CAN device.

If you need to make adjustments on the remote device, create a project for just that device (passing through the MS3, but not using the MS3 config.)

That gives two benefits:
1. you can log the new data to the SDcard
2. your project configuration is simpler

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

Re: Addon device with CAN pass through

Post by racingmini_mtl »

There is a third benefit. When logging from TS, the data rate is much higher due to having to communicate with only one device.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
SebastianS
MS/Extra Newbie
Posts: 22
Joined: Sat Apr 20, 2013 4:06 am

Re: Addon device with CAN pass through

Post by SebastianS »

jsmcortina wrote:While the secondary project stuff ought to work, with MS3, if possible I would suggest that you configure the MS3 to read the data from the other CAN device itself and use a normal MS3 project without a secondary CAN device.

If you need to make adjustments on the remote device, create a project for just that device (passing through the MS3, but not using the MS3 config.)

That gives two benefits:
1. you can log the new data to the SDcard
2. your project configuration is simpler

James
Wait - what "secondary project" are you talking about?
If I didn't make myself clear in the first post, I'm sorry. I have set up TS to have a CAN pass-through connection with my GPIO board through the MS3.
LT401Vette
Super MS/Extra'er
Posts: 12733
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Addon device with CAN pass through

Post by LT401Vette »

Yes... But what are they are saying is, there are 2 ways to do CAN pass through.

1) Create one project with a primary/main controller, then go to the CAN Devices tab and add a second device that you will talk to with CAN pass through.

2) Create a project with 1 primary / main controller and no other the same as if you had no CAN controller. Then to talk to it with CAN pass through, click on the CAN Devices tab and set the Main controller CAN ID to what ever your remote id is..

Where it sounds like you are configured with #1, with some firmwares that is the only way to display or log information from your CAN device.

However, as you have an MS3, the suggestion is to use #2. You can set up the MS3 to read the channels from the GPIO and pass them back to TunerStudio in the normal run time read.
Check out Generic Sensor inputs in the manual:
http://www.msextra.com/doc/ms3/genericsensors.html

Then you would create 2 projects, 1 for your MS3, 1 for your GPIO. By setting the CAN ID on the CAN devices tab to the appropriate setting you will be able to talk to your GPIO board through the MS3 in the project with just a gpio. Use this project to configure it as needed, but for normal operation you would only be talking to the MS3, thus your read rate will be much better.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
Post Reply