CANbus development tools - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 03:06:20 pm
content: Can anyone recomend CAN tools? I'd need a CAN to USB adapter and some software to generate messages. I am familiar with Peak CAN explorer but this is now 600 euros and lots of things that were part of it are now addons making in 600 euros to simply be able to send a message.I am looking to develop CAN coms on the SANC series of ARM micro controllers.

author: nctnico
author_rank: Super Contributor
timestamp: August 17, 2019, 03:14:26 pm
content: I have good experience with CANUSB from Lawicel.

author: TopLoser
author_rank: Unknown
timestamp: August 17, 2019, 03:19:16 pm
content: Yep I’ve used their CANUSB and CAN232 adaptors without any problems, software is free and the hardware is cheap.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 03:20:18 pm
content: Yea they don't seem to sell any software other than a moniter software. Basic monitor software comes with most CAN/USB adaptoers these days.

author: legacy
author_rank: Super Contributor
timestamp: August 17, 2019, 03:39:55 pm
content: The Linux support is ... "not good" ( I want to be polite ), and a couple of PCI-CAN bus boards are now deprecated and abandoned, and nobody seems interested in updating the kernel driver to modern kernel v4 or v5.It's a shame because despite the poor Linux support these cards were cheap (< 50..100 euro).

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 03:43:46 pm
content: Not wanting to make this a linux debate and as much as i hate windows, Linux will never gain serious traction in the desktop environment and particularly in the engineering field until someone like Linus Torvaids gets behind a distro and it becomes the defacto like there is only ever one current version of windows. i can'n use an OS tha no one develops engineering software for.

author: legacy
author_rank: Super Contributor
timestamp: August 17, 2019, 03:55:44 pm
content: Quote from: Simon on August 17, 2019, 03:43:46 pmWhat I mean is: if the support sucks and the Peak support is expensive, at least you have a chance to fix OpenSource and Semi-Opensource stuff by yourself. It might be an option.The problem I have is related to the lack of interest in help, and even the company who did those boards has recently replied to my emails telling me that the product is EOL, therefore there will be no support from them concerning the kernel driver for recent kernels. And tools in userspace are generally ... poor.This means you need to put your effort here, developing stuff, updating stuff, porting stuff, etc, because with CAN bus nothing is ready out of the shelf, and this is probably the bad face of semi-OpenSource. You have a source, but there not much interest, and you are alone, but It's better than nothing when you are not willing to spend money on commercial products like Peak USBCAN.-The other option is Coldfire v2 since they had something implemented by Motorola and Freescale.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 04:01:35 pm
content: I don't mind spending money. i need to develop CAN on microcontrollers not try and learn to write PC prgrams too and i need to know that one side of the chain is working. i can use PeakCAN explorer 5 at work with one of their dongles but was looking for a solution of my own, now i will easily be buying 1000 euros worth of gear and i have not been impressed with peak can explorer 5 so I'm not sure if i wnat to drop 600 euros plus more for plugins that used to be basic functionality of the software if it's still as bad as what i have at work. My now famous retort at work henever I have to come and sort out CAN problems is "shit german software".

author: errorprone
author_rank: Contributor
timestamp: August 17, 2019, 04:31:09 pm
content: I've used the Komodo Can analyzer by Total Phase at work that comes in both single and dual port. Also not that cheap around $450. The stock software is pretty good and it come with a C and python library.https://www.totalphase.com/protocols/can/protocol-analyzers/Sent from my LG-H810 using Tapatalk

author: nctnico
author_rank: Super Contributor
timestamp: August 17, 2019, 04:35:10 pm
content: Quote from: Simon on August 17, 2019, 03:20:18 pmYou can buy softwarehttps://www.antratek.nl/can-monitor-profor less than 40 euro.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 04:38:38 pm
content: thanks, that looks much better.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 17, 2019, 05:09:02 pm
content: I have used Peak CAN usb for CANOpen development, its 180€ non isolated.In my case it was very usefull because it was supported by all the CANOpen related programs I used. I didn't use PCAN-View because Canopen is an addon but you can send raw message.Their USB libraries must be very good for custom software.Also a good logic analyzer can also help in message decoding during development.

author: MosherIV
author_rank: Super Contributor
timestamp: August 17, 2019, 06:33:53 pm
content: The best tool by far is CANalyser and their VN16xx interfaces by Vector.However, at £8000 it is out of reach for most hobbiests.We have PeakCan as well at my place of work. Very basic.Also have Ixxat CAN interfaces - again very basic.One of the suppliers visited recently and showed me kvaser interface, basic but worked much better than the PeakCAN.CANalyser is the defacto standard in automotive industry.It not only logs messages with time stamps.It does real time message decoding if you supply the message format in a .dbc file.Vector provide a .dbc edit as part of CANalyser.I have written a number of CAN device simulations in the CANalyser language CAPL.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 07:20:46 pm
content: I just need something that i know works to bat messages to my prototypes and display messages sent back.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 07:30:00 pm
content: https://www.antratek.com/usb-can-adapter-isolatedhttps://www.antratek.com/can-monitor-proLess than £170.

author: JPortici
author_rank: Super Contributor
timestamp: August 17, 2019, 07:46:23 pm
content: We use a Kvaser interface.To generate traffic i use either their free software (can king) or busmaster (open source, suppports many interfaces). They also have paid software which is fantastic, they tell me.if i wanted i could also load a c program in the interface itself so i don't even need the laptop anymore

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 08:03:36 pm
content: um, yea, Kvaser stuff is over 500 euro's for anything. So you actually pay for the software when you buy the hardware.

author: Simon
author_rank: Unknown
timestamp: August 17, 2019, 08:09:28 pm
content: OK, just found a kvaser adapter for 275 euro's, can live with that.

author: MosherIV
author_rank: Super Contributor
timestamp: August 17, 2019, 11:55:53 pm
content: HiI know what you mean. Why cant someone do a really good CAN protocol analyser and not charge a fortune for it.Forgot to mention, Busmaster is the basic protocol analyser that I have seen work for PeakCan and Ixxat.The supplier was using some paid for protocol analyser from Emtas. Did not look any better than Busmaster.Some of my colleagues have also been using CAN with National Instrument.Again the NI CAN tool looked really basic, only shows raw CAN with no decoding.Apparently, it does load .dbc files but not for message decoding.

author: rounin
author_rank: Regular Contributor
timestamp: August 18, 2019, 04:52:58 am
content: I have one I've releasedhttps://suburbanmarine.io/product/hadou-can-beta/, good bit cheaper than Vector et all. Disclaimer, it hasn't seen a lot of use outside my lab yet.Protocol compatible with the Lawicel CAN232 (+ extensions for CAN FD, and a lot more config options), but supports CAN FD @ 12Mbps and is electrically isolated. No GUI at the moment.Is .dbc file reading / graphical display a hard requirement? I'd like to do that but a GUI wasn't on my road map anytime soon.

author: Simon
author_rank: Unknown
timestamp: August 18, 2019, 07:41:28 am
content: Well i bit the bullet and bought a kvaser adapter..dbc files are essential for sending and receiving and very much so for receiving or you can't see in real time what is going on and what is what.

author: digsys
author_rank: Unknown
timestamp: August 18, 2019, 09:09:05 am
content: What is the link to that adapter? I've been messing around with the same issues - bought a few "cheapies" with the same results as others describe -So far, the MICROCHIP APGDT002 CAN BUS ANALYZER TOOL has been the most useful .. just have to start writing my own interface I guess.

author: Simon
author_rank: Unknown
timestamp: August 18, 2019, 09:20:20 am
content: https://uk.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=15001&langId=44&productSeoURL=kvaser&storeId=10151&partNumber=2400355&krypto=OsZL%2F0%2FqRTTa5JL9y29ABcthKHpCBj7gV9AyfW7xSckQSJtMMbNmmpgCyQDQcFr4Va6LPE06wkDgGVLAOBcA8Q%3D%3D&ddkey=https%3Aen-GB%2FElement14_United_Kingdom%2Fkvaser%2F00685-0%2Fcan-module-usb-leaf-light-v2-1ch%2Fdp%2F2400355

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: August 18, 2019, 11:54:20 am
content: For those of us who love a $7 CAN interface... I'm using the candleLight firmware right now on a barebones STM32F072 board containing a non-isolated CAN transceiver, a micro USB jack, and little else:https://github.com/normaldotcom/candleLight_fwThe supplied image was loaded via SWD. When plugged into my Linux desktop, the device showed up as a CAN network device. I've done HLP development by sending and receiving raw packets using the command line cansend and candump tools, which was not entirely horrible. I've been running a simple NodeJS server, receiving and logging environmental data sent by an own-built remote device, and handling J1939-like network management. CAN FD support is unknown/untested.Not tested: I just found a free .dbc interpreter plugin for Wireshark, including Windows DLL and source, assuming it hasn't been folded into upstream yet:https://canlogger.csselectronics.com/downloads.php?q=wiresharkDisclaimer: I do not pretend that this is a match for Vector or Kvaser tooling in any way. All trademarks and identifying names are the property of their originators and are used purely for insinuation purposes.

author: Simon
author_rank: Unknown
timestamp: August 18, 2019, 12:07:08 pm
content: The problem is that I have to develop my ECU, not spend time assembling my own tools. While my budget is not limitless I prefer to spend a little money up front to save having to debug the tool that is supposed to debug my prototypes.I have chosen kvaser over peak because I have poor experience with peak and kvaser seems to be supported by many 3rd parties.

author: Gabri74
author_rank: Regular Contributor
timestamp: August 19, 2019, 12:23:28 pm
content: I know you already bought one, but I'll leave this for other people looking for something similar:https://www.8devices.com/products/usb2can_korlanComes with python and wireshark support.I've bought the old usb2can model and I'm very happy with it. I use it in linux (socketcan)

author: IDEngineer
author_rank: Super Contributor
timestamp: August 19, 2019, 04:15:53 pm
content: This question about CAN dev tools has come up here before, and in that thread I mentioned we use the Peak CAN tools. Peak has already been covered in this thread so I won't repeat myself, other than to say we've had great success with them and have ended up purchasing quite a few more CAN-USB interfaces from them. The free version of their PC software has proven incredibly useful and we've had no reason to buy any of the pay-for versions.However, this thread does give me the chance to raise a related topic. We are considering developing a bootloader for our PIC18F-based CAN products. The firmware side is straightforward, but we haven't nailed down the PC side of things. Peak has a library which we've downloaded but we haven't actually tried yet. Anyone here ever implemented a CAN bootloader? What did you use for the PC side of things? We'd need the ability to send and receive CAN messages under the control of our own in-house PC application software.Thanks!

author: Gabri74
author_rank: Regular Contributor
timestamp: August 19, 2019, 04:28:30 pm
content: Quote from: IDEngineer on August 19, 2019, 04:15:53 pmI've done it in the past. We used a PDO for sending chunks (PC->board) and another PDO for ack (boars->PC).If you are on linux you can use libsocketcan with raw frames or a simple CanFestival based app.If you are on windows I think the simplest approach is to use Qt with QtCanBus and raw frames (be aware that this Qt module could be under (L)GPLv3, so if you need to sell/distribute your PC application check it in advance.https://doc.qt.io/qt-5/qtcanbus-backends.htmlAlso see this for some examples:https://www.embeddeduse.com/category/can/

author: IDEngineer
author_rank: Super Contributor
timestamp: August 19, 2019, 04:33:31 pm
content: Thanks for the reply!Quote from: Gabri74 on August 19, 2019, 04:28:30 pmNope, Windows here.QuoteWe have zero experience with Qt, so that's a steep learning curve for this one in-house project. (No distribution problems, we'd only use it in-house so we can build in volume and flash on the production floor to configure for shipments.) I was hoping more for a Windows DLL that could be linked into a custom app we'd write for this purpose in Visual C/C++.

author: MosherIV
author_rank: Super Contributor
timestamp: August 19, 2019, 05:57:36 pm
content: My colleague developed both a python based CAN firmware upgrade tool and a C# one.PeakCAN has support built into the PythonCAN module.The driver is just that, just allows your code to send/receive CAN packets.The real development work comes with the CAN protocol.With a protocol stack, you just create functions which call functions likesdoWrite( cobAdr, *data, datlength, NONEXPIDITED );Then the entire data transmission and error detect is all done by the stack.(This is for CANopen CAN protocol)If you are using a user defined CAN protocol, then you will have to develop the stack yourself.Does that answer your question?

author: Jeroen3
author_rank: Super Contributor
timestamp: August 19, 2019, 06:13:24 pm
content: Many cheap CAN to USB adapters simply create one virtual com port endpoint and cannot handle a busy bus (low packet per second rating). You must set hardware filters.The Leaf light Kvaser can handle (and transmit!) maximum packet rate for CAN bus.* Probably PEAK as well, but last time I checked they still mounted as a virtual com port, which means it's exclusive to one application.Kvasers USB driver is amazing, you can run hundreds apps on one interface, exchange it for the LAN/WiFi version and run the same app.However, many software made by german vendors only support PEAK.Yes, €300 for a CAN to USB might sound expensive, but can you make one including the usb driver for less?Also, if you've put the Kvaser drive to use in app, you can just build a small app for everything you need it for. You can even tie it to labview.I made this example way back. I have now made a kvaser class in Qt, but that is proprietary unfortunately.https://github.com/Jeroen6/QtKvaserWhile I did that Qt announced QtCAN.... but that only supported PEAK in the first version.*Ideal for bootloaders in production programming.

author: IDEngineer
author_rank: Super Contributor
timestamp: August 20, 2019, 02:47:46 am
content: I'll look closer at Kvaser, thanks!Meanwhile, I've found that Peak provides a J2534 pass-through API that appears useful, and callable from a C/C++ application (their examples are in C). It has the ability to set filters, read and write CAN messages, etc. Not sure of its throughput but at least it's low-level enough to support externally defined filters. It even has a way to create a separate thread to transmit a periodic message with 1mS resolution. Since we have an investment in Peak CAN hardware already, I'll probably start there and see how it pans out while researching the Kvaser options.Here's the link to the Peak pass-through library (Win7-10, 32/64 bit):https://www.peak-system.com/fileadmin/media/files/PCAN-PassThru.zip

author: Simon
author_rank: Unknown
timestamp: August 20, 2019, 06:51:28 am
content: I picked Kvaser because they seem to be supported and themselves advertise 3rd party programmes so I sespect that they are more univesally usable than Peak. And having experienced peak software i'll take the chance on something else.

author: IDEngineer
author_rank: Super Contributor
timestamp: August 20, 2019, 07:36:19 pm
content: Have just finished looking at the Kvaser API. I agree, it's very nice and definitely superior (at least in its documentation) to the Peak API. I'm also grateful the DB9 pinouts are compatible on the pins we care about! (Yes, that's supposed to be standardized, but "The nice thing about standards is that there are so many different ones to choose from.")Reading the Kvaser docs, and especially their sample code and comments, is refreshing after the garbage so many other companies put out.But the proof will be in the performance and behavior of the API's when they integrate with our own in-house C/C++ apps for flashing through the bootloader. As I said, we have quite a bit invested in Peak hardware already, so I may take a stab at getting the Peak API to work just to leverage what we already own. Kinda wish we'd gone with Kvaser to start now, though.Thanks for the pointer to Kvaser's API!

author: Totoxa
author_rank: Newbie
timestamp: August 21, 2019, 04:36:18 pm
content: Quote from: MosherIV on August 17, 2019, 06:33:53 pmYou can do the same in windows with BusMaster and in linux with SavvyCAN for free

author: Jeroen3
author_rank: Super Contributor
timestamp: August 21, 2019, 09:03:44 pm
content: Quote from: IDEngineer on August 20, 2019, 07:36:19 pmYour welcome. If you have any questions, I can probably answer them. As I'm working on a kvaser application for the coming weeks again.

author: Gabri74
author_rank: Regular Contributor
timestamp: August 22, 2019, 09:27:22 am
content: Quote from: Totoxa on August 21, 2019, 04:36:18 pmThanksa lotfor SavvyCAN, didn't know it!

author: Ribster
author_rank: Frequent Contributor
timestamp: August 27, 2019, 10:43:33 am
content: Take a look at USBTinhttps://www.fischl.de/usbtin/Friend of mine used it in conjunction with an STM32 which ran OpenCAN. He used the scripting stuff to get load testing out of it.He found some firmware functional bugs with it.

author: k8943
author_rank: Regular Contributor
timestamp: January 26, 2020, 06:00:18 am
content: @Simon which software package did you end up using with your Kvaser?(I'm looking for instant useful upgrade from Microchip Canbus Analyzer, then ONE day might create an app...)

author: Simon
author_rank: Unknown
timestamp: January 26, 2020, 09:24:06 am
content: nothing yet. I need to get a CAN bus working on a chip first.

author: k8943
author_rank: Regular Contributor
timestamp: January 26, 2020, 09:48:12 am
content: I thought CANBUS was going to be complex in terms of libraries etc and so found other ways of doing things. Then realised that with PIC18F26K83 + MCC ("Microchip Chip Configurator" plugin for MPLABX IDE) + a chip like ATA6561 it's actually pretty straightforward. Onwards and upwards.

author: Scrts
author_rank: Frequent Contributor
timestamp: January 26, 2020, 09:20:46 pm
content: Did anyone try Chinese stuff? Do they work with can-utils?Here are a couple of links:https://www.aliexpress.com/item/32992507201.htmlhttps://www.aliexpress.com/item/32870966621.htmlhttps://www.aliexpress.com/item/32878710246.html

author: Gabri74
author_rank: Regular Contributor
timestamp: January 27, 2020, 09:16:55 am
content: Quote from: Scrts on January 26, 2020, 09:20:46 pmI will not suggest to buy a cheap chinese CAN adapter for several reasons:1. If you work with CAN, probably you are interfacing with motors controllers or inverters or industrial buses, an isolation in thoseapplications is really important. You don't want to blew your PC motherboard due to poor isolation...2. They are often clones of other products and steal/modify original vendor USB drivers. Also never install supplied drivers in windows, the risk of installing viruses are too high3. The vast majority of cheap linux compatible CAN adapters use the slcan (serial) interface: they are basically CAN-to-serial adapters bridged over USB, and often can't cope well with high CAN speeds.If you are using linux, I strongly suggest to choose an adapter with official socketcan support.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: January 27, 2020, 05:16:20 pm
content: Quote from: errorprone on August 17, 2019, 04:31:09 pmI can't recommend the Komodo CAN analyzer sold by Total Phase. I have one and it has several issues. For one, the Komodo GUI software is buggy. I've never been able to keep it running for more than a few days. This makes it really difficult to diagnose CAN issues that only show up after days to weeks.Another issue is that the GUI cannot set an arbitrary bit rate. You have to use one of the rates supported by the application. This makes it useless for debugging on a CAN bus that uses a non-standard bit rate.