Pages: 1 [2]
Author Topic: USBtin experiences?  (Read 2493 times)
woj
Sr. Member
****

Karma: +20/-1
Offline Offline

Posts: 384


« Reply #15 on: July 04, 2018, 02:02:18 PM »

Drop us a link once this ESP32 device of yours is more available Wink

Kvaser might be Swedish, I am not, only happen to live here at the moment. Just checked this product you quoted, looks very solid piece of hardware, just the price is probably more than my complete spending on the Flex Fuel development so far.

And what is going on with the post and duties is currently crazy here, it is not about postage time, but the totally choked duty collection system and post's inability to deal with it. Seriously, this is beyond Monty Python level... Wink

Logged
minDark
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


« Reply #16 on: October 24, 2018, 07:53:43 AM »

Hi all! An alternative option could be this: https://www.macchina.cc/. It has 2 CAN inetrfaces, SWCAN, K-Line an J1850, and also one optional ESP32 module for WiFi.
Logged
woj
Sr. Member
****

Karma: +20/-1
Offline Offline

Posts: 384


« Reply #17 on: December 17, 2018, 03:43:04 PM »

So for the better part of last week I engaged into developing an slcan protocol for the integrated Leonardo-CAN device I mentioned earlier (and that I have already fully working otherwise). I first used a ready Arduino project for this some good soul made, but then had to optimize things for speed and I ended up essentially rewriting the whole thing. All this so that I can use / test serial based socket CAN interface for my flasher. It now works and it seems I have hit the serial throughput limit (the device happily connects at 2Mbaud, but it seems the real speed is never higher than 115200). I think we already established that the slcan protocol is wasteful - two characters for each byte to be transmitted, not to mention continuous sending of extended CAN ids with each frame. All in all I got it down to 1:54 for complete flash of my 850k file vs. the 1:19 when I do it with my own waste-less serial protocol. The math also tells me I won't do better than ~1:50 over 115200 baud with slcan.

To the point, motivated by the canable device mentioned earlier that works either in slcan mode, or as a native socket CAN device with candlelight firmware faking gs_usb CAN device, and dealing with the Leonardo's 32u4 chip that supposedly has native USB capability, I am inclined to try the same on the Leonardo-CAN. There are some native USB examples for the hardware capable Arduinos, but the problem is I know total JS about native USB programming (so far), so I am not even sure if that's possible. I was wondering whether somebody has any experience that would help, or simply would like to help develop this. The stuff I did for slcan I plan to release sooner or later.

Logged
woj
Sr. Member
****

Karma: +20/-1
Offline Offline

Posts: 384


« Reply #18 on: December 25, 2018, 10:18:59 AM »

It is doable, I now have a skeleton code that makes a proper CAN-USB device out of my Arduino, makes it recognisable as a gs_usb device on Linux, and I can now receive fake CAN messages with candump generated at the Arduino end. Now what remains is to interface it neatly with the MPC_CAN library, seems to be a piece of cake to finish this.

The bad news is that it required reprogramming the Arduino core, cannot be done as a PluggableUSB library. In practice the core now reads one of the board pins to decide if it wants to be a gs_usb device or the regular Leonardo/ACM device. That is not super elegant, but working. The other alternative is to write a custom Linux kernel module, I looked into this too, but that outgrew me for the moment.
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.028 seconds with 17 queries. (Pretty URLs adds 0s, 0q)