Oh, I could be wrong then. Perhaps I had just forgot to ever initialize SPI before and when I went back and added transaction support I also issued a call to SPI.begin… Whoops. Well, that kind of dumb stuff happens sometimes… At any rate, the SW_CAN library is updated as is M2RET and now you can start up SavvyCAN with the newest M2RET and it doesn’t crash. I still have yet to find an SWCAN source and test against it. Hopefully soon.
No worries man, double check to make sure those 0 ohm jumpers are not populated to be sure.
Also, I picked up one of these boards a while back. Not bad for a simulator really - decent software, relatively inexpensive. Here is a link, but there may be places to find it cheaper/faster shipping, etc:
OK that latest update fixed it, does not lock up anymore.
However the “overwrite mode” in SavvyCAN v168 still doesnt seem to work…when you click it, the logging slows immediately and then stops. If you click “clear frames”, it will clear the window, then reload the messages again for about 2 seconds, and stall again.
As soon as you uncheck “overwrite mode”, logging resumes.
The older SavvyCAN doesnt have this problem.
I wasnt able to get SWCAN to work in SavvyCAN…is there any documentation on how to use it just via a regular serial terminal?
Yeah, If I haven’t added an issue on github for that then I should. Overwrite mode certainly ought to work.
I forgot to mention, SWCAN doesn’t enable by default so you have to do it. But, SavvyCAN still doesn’t know it exists so you can’t do it there. You’re going to be stuck using the serial console one way or another.
So, quick crash course:
It’s a normal serial port so use whatever terminal program you want. But, you need to enable some form of line ending (/r, /n, /r/n) so that it can recognize commands. Then, without the quotes type these lines:
Now you’re in ascii mode and the swcan interface is active. You will get buried in traffic if you also have the other CAN ports on so you might want to:
To turn them off.
“h” or “?” gives you help and shows you what commands you can issue.
You can tweak the CAN speed of the swcan interface if needed. It defaults to 33333 which seems kind of sensible to me but I’m wondering if it is really supposed to be 33000 instead. I’ve had luck in the past with using 33333 on single wire CAN but you can try 33000 if you think that would be better.
Ill see if I can keep messing with the overwrite mode and get it to work.
Is there a possibility that the M2RET firmware could be tweaked to output data from the MCP2515 as “CAN1” to SavvyCAN?
I only work with two busses simultaneously, high speed CAN and SWCAN. I dont need the mid-speed CAN.
I know that SavvyCAN was only designed to work with two busses, so im wondering if it would be possible to change the serial output portion of the M2RET code so that SavvyCAN just displays traffic from the MCP2515 on “CAN1” INSTEAD of traffic from the Due’s internal CAN1 controller.
Unless Im misunderstanding the way SavvyCAN gets data from the Macchina, it should just display whatever is being sent to it as far as serial data…so if we could just delete the code to pipe data from the Due’s internal “CAN1” to SavvyCAN and replace it with the stream from the MCP2515…would that maybe work? And SavvyCAN wouldnt even know the difference?
I will look at later today. Doing some running around and will try testing on my CTS.
Just ordered one of these units. Looks like a good one to have to program for. Will still work towards having my lab together but certainly will speed up development. Was able to do it via Amazon Prime so I should have it by Monday or Tuesday.
Wow got the board today… No instructions with it. Just a board and USB cable. That was quick…
Also bought some bare plugs and such so I will be able to make this into a working unit quickly. Looking forward to it. The board also had a web site listed on it so I will be looking for the software to run it and the instructions there.
So anyone looking for one of these there were 4 listed left when I ordered mine.
Should have it up and running with my M2 shortly.
I bought that board too from Amazon…havent had a chance to mess with it yet. Let us know when you get it working…
The unit looks pretty straight forward.
You can tell the documentation is not written by someone with english as their base language but much better than most english documentation written by Chinese authors.
This unit seems to support all the protols that the M2 does and has what appears to be decent software with it. You can use it to scan a datastream much like SavvyCan or use it to provide a simulation which is useful when building diagnostic software.
Pretty informative on the different protocols when I glanced through it.
The device looks like it was originally designed to develop modules for vehicles but they later recognized it would also work as a diagnostic tool or simulator.
While it has 2 canbus channels it looks as though the second channel is used for SWCAN. You must provide a 12 - 36 volt supply to its power and ground points if doing pretty much anything other than standard canbus. It will run from your usb port. The documentation says 12 or 24 but I wrote them and they responded almost immediately that it could handle 12 - 36 volts.
I wired a plug on mine since it will be used as a simulator to help develop M2 drivers. Their documentation states to add a 120 OHM resistor if connecting directly to a diagnostic device for the CANBUS.
For j1850 their documentation is very confusing for PWM. It first says if using for simulation for a diagnostic tool you must add a 2k resistor to each line, then the next line states if using two of these units then the 2k resistors are not necessary because of the resistors already onboard. So I plan to try without first and only add if needed. The way I read it the absence of the resistors may make the data erratic. But might be OK.
Man going to have to dig up my resistors and find a 120 ohm… Might just hook to the M2 and see if it works without it.
I plugged my M2 UTD (w/ M2RET) into the ODB port of my 2015 Subaru today and launched SavvyCAN to try to start looking at the traffic and had the strangest thing happen. I added the connections in SavvyCAN and my lights suddenly dimmed like a brownout and my check engine light came on indicating an issue w/ my cruise control (which stopped working as soon as that happened).
I was able to see data coming back from the M2 in the connections window but SavvyCAN didn’t seem to show any traffic. I’m not sure what I did wrong.
The check engine light went away later and CC started working but I have no idea where things went sideways.
Anyone have any ideas?
I finally got a chance to test my Signstek board as a simulator and the following protocols work fine as long as you add a power supply to the + and - ports.
Note that I used a Scantool based STN device with its stock software to test the simulator… Ie test with known working hardware before diving in…
ISO14230 - 5 baud (KWP 2000)
ISO14230 - Fast Init (KWP2000)
J1850VPW - 10.4k baud
J1850PWM - 41.6k baud
The 11 and 29 bit Canbus protocols did not work but this means I have to add the resistor to make those work.
So for anyone looking to work with any of the others all it takes is to wire up the connections properly. And add a power supply. I am using a Radio shack 13.8v power supply.
I am running the simulator on a different computer because I have one hooked to my power supply that will go into my truck once I get some other repairs done on the truck. I will have an I3 based PC integrated into my truck and will be able to connect this to my M2 for testing purposes and such. I am looking through the due_can then the m2ret drivers to understand those before I dive into getting the J1850 stuff working.
The most likely culprit for “it doesn’t display CAN traffic and everything went haywire” is that your CAN baud rate is wrong. There are two main speeds you normally expect: either 250000 or 500000 (250k, 500k). Sometimes 125k or 1M is used. Those aren’t very often. If you connect to single wire CAN then the baud will almost certainly be 33k. Connecting to a CAN bus with the wrong speed and not in listen only mode causes the whole CAN bus to fault and nothing will work. This clears itself up if you remove the offending device and power cycle everything else.
So, try a different speed. Also, you might be tempted to use listen only mode. It may or may not work depending on which version of all the software you are using. I think I fixed it recently but using older versions will not allow it to work. You need the proper speed anyway to see traffic so try out a different speed. If you tried 500k then try 250k. If you tried 250k then try 500k. One of them is very likely to work and the other will not.
I suppose this highlights the need for an auto baud finding routine.
Thanks Collin. I’ll try again with different speeds.
Hey Collin, where can we get the latest version of Savvycan for windows?
You don’t mention in your readme how to compile Savvycan on windows. What is the preferred method of doing so on windows so I can run your latest version?
Now, if you want to compile on Windows then download Microsoft Visual Studio 2015. The community edition (or whatever their free version is called) is fine.
That’s all you need to compile it. Get Visual Studio, get Qt, get the source, use QTCreator to compile it.
Was looking for this posting…
Will VS 2017 work?
I downloaded the opensource version of QT and currently installing it.
I want to try compiling your code before the school year finishes up. I may be able to help with some of the bugs or feature requests as I build out some things to support other items.
Since I seem to have everything else working that I need I want to see if I can get this to compile. If I have any issues I will ask.
Yes, VS2017 should work. The open source version of QT will work fine too. You should use the 5.9.x branch of QT. With those two things you should be able to compile. It’s easiest to use QT Creator to do the compiling but you can do it from the command line too.
Create a VS C++ compiler command line (It’s found in the Start menu under the visual studio folder)
Run qmake (you will likely have to give the full pathname so it’d be something like c:\qt\5.9.1\vs2017_64\bin\qmake"
Having issues installing QT but probably due to not installing as administrator. Will see if it installs this time. Installing 5.9.3 branch of QT. Kept getting exception errors while installing and it eventually failed. Trying again but as administrator and see if it installs properly.
Will give it a shot as soon as this is finished and see if I can get it to compile. I should have more time after this week.
Edit. Install as Admin worked. Grabbing SavvyCAN and trying to compile next.
3 posts were merged into an existing topic: Building a Test Lab from vehicle xxx