Any experience with Leonardo Can Bus board made by Hobbytronics uk?

Hello,

I just got the Leonardo Can Bus board from hobbytronics - did not find much info about it on the net - am I the only one bought it?

My opinion so far:
Well, it is a compact device and there are some videos showing that people are using it. How they make it work, it is another matter.
On the company webpage there is a link to an example software - the link goes to a github page, the page has some codes there, but no library which could be downloaded.
Furthermore, there is no info on the PIns used on the board to set it up in any CAN libraries...

It seems to me that they had an arduino board and some leanardo shield, they put the two together to a compact board - then they did not bother documenting how the arduino and the shield has been connected.

at my current state, iam just about the discard the whole thing and get a leonardo shield from China with proper documentation instead.

This page?

There is a link to a library; I haven't followed it.

@Tiborx8, What made you think that your question has anything to do with the Website and Forum section which is clearly stated to be for "Improvements for the web system, applications to moderator, spam, etc."? I have suggested to the Moderator to move it to the Project Guidance section.

This sort of carelessness makes unnecessary work for the Moderators.

Please read How to get the best out of the Forum

...R

Sorry for my mistake.

sterretje:
This page?

There is a link to a library; I haven’t followed it.

there is a link to a github page, but there is no valid library there, as I see.

Tiborx8:
they did not bother documenting how the arduino and the shield has been connected.

The page in @sterretje 's link seems to include a schematic of the module; I’m not sure there exists better documentation than that.

Tiborx8:
there is a link to a github page, but there is no valid library there, as I see.

Define what you mean by valid. Have you tried it? What is your actual issue?

In my limited experience, HT manufactured stuff is decent enough from the aspect of the hardware. If you get something with proprietary (ie. closed source) firmware and run into bugs, you will struggle. I believe the individual who designed at least one of their modules has since moved on, so the chances of getting bug fixes is slim. Shouldn’t be an issue with this particular module though.

arduarn:
The page in @sterretje 's link seems to include a schematic of the module; I'm not sure there exists better documentation than that.

Define what you mean by valid. Have you tried it? What is your actual issue?

In my limited experience, HT manufactured stuff is decent enough from the aspect of the hardware. If you get something with proprietary (ie. closed source) firmware and run into bugs, you will struggle. I believe the individual who designed at least one of their modules has since moved on, so the chances of getting bug fixes is slim. Shouldn't be an issue with this particular module though.

Well - there is a library. However, they indicate that I need the pins - except that there is no precise instruction which line needs to be changed (there are two almost identical pin lines). the clock rate is also not correct (the device has 10 Mhz, in the file there is 16 Mhz, as I recall. Furthermore, the board as I connect to the USB port does not show up in the COm - but it may be a bug in the IDE. all in all, three problems took away most of my spare time today.

Tiborx8:
Well - there is a library. However, they indicate that I need the pins - except that there is no precise instruction which line needs to be changed (there are two almost identical pin lines).

Since you haven’t provided precise information on the pins in question I doubt anyone can help.

Tiborx8:
the clock rate is also not correct (the device has 10 Mhz, in the file there is 16 Mhz, as I recall.

I see the sales page indicating a 10MHz SPI capability, but I doubt that is relevant at this stage. Maybe you are digging too deep and getting confused?

Tiborx8:
Furthermore, the board as I connect to the USB port does not show up in the COm - but it may be a bug in the IDE.

Maybe need the driver installed?

Tiborx8:
all in all, three problems took away most of my spare time today.

Get used to it… :disappointed_relieved:

The reviews on the sales page also include one with information on using Sparkfun’s library.
HT do respond to email, so worst case scenario you can try them. Allow for the current circumstances though.

Here is a 'precise" pin description...
"Example Programs

First download and install the Arduino CAN-BUS library. The example programs from this library are designed for the Sparkfun Arduino Can-Bus shield which has slightly different pin connections, so the example programs won't work without modification.
The MCP2515 CAN BUS chip uses SPI for communication with the microcontroller and the Chip Select pin needs to be set correctly.
In the example programs, the chip select pin needs to be changed to 17. I.e.
const int SPI_CS_PIN = 17;"
just a few thoughts..

  1. a professional company - so, how come that they cannot make an example library, instead of giving not precise suggestions what to change in another library
  2. This is a can bust shield. 99.999% of the buyers are going to use it to receive and send can bus messages. Than why they don`t install it to the board - especially as they state before that each boards are tested. How? With a blinking light code?

Tiborx8:
First download and install the Arduino CAN-BUS library.
...
In the example programs, the chip select pin needs to be changed to 17. I.e.
const int SPI_CS_PIN = 17;"

Well unfortunately I think they have got their libraries mixed up; I reckon the library that those intructions refer to is the other one mentioned from Seeed.

Tiborx8:

  1. a professional company - so, how come that they cannot make an example library, instead of giving not precise suggestions what to change in another library

I always read the documentation before purchase. Caveat emptor.

Tiborx8:

  1. This is a can bust shield. 99.999% of the buyers are going to use it to receive and send can bus messages. Than why they don`t install it to the board - especially as they state before that each boards are tested. How? With a blinking light code?

Sure thing. What messages are 99.999% of buyers going to send, to what hardware, in what order, at what times, in response to what received messages?
Without a sketch to customise it to a particular application such a module is worthless. Burning a bare library to it achieves nothing.

Over and out.

arduarn:
Well unfortunately I think they have got their libraries mixed up; I reckon the library that those intructions refer to is the other one mentioned from Seeed.
I always read the documentation before purchase. Caveat emptor.
Sure thing. What messages are 99.999% of buyers going to send, to what hardware, in what order, at what times, in response to what received messages?
Without a sketch to customise it to a particular application such a module is worthless. Burning a bare library to it achieves nothing.

Over and out.

99.999% uses the can bus sniffer to read messages from the can system used in automobile industry. What message you recieve there is practically unknown - that is the game itself to receive them and figure out which one id the beam, which one is rolling up the window. You test this info by resendig the received messages. If you go to libraries and type in the keyword CAN, you find several libraries all doing the same, with same user options.

I think tbh that you need to do a lot of research with this type of board and have some knowledge of Can bus and the chips used to work out how to use it. This is more complex in that it includes an on board Leonardo with fixed wiring ( I don’t like Leonardos anyway as the com port, being a software port moves around a lot ).

I looked at a variety of these shields and in the end bought the simpler

Which works at a more basic level and suited my first in roads into Can bus , needs no libraries and works ok - even so needing a bit of research to understand what the examples did and get some readings .
I’m sure the board you have works and can be used with the info they provide , just needs a lot of background knowledge .

Well,

of course, i am not a professional about can messsages - I am an amator enthusiat with a lot of previous thinking and reading/watching about the subject - more or less the kind of guy these boards are meant.

I am also sure that the board is working - but not with the library they provided as an example and not upon the info they provided on their page.

i am going to send it back to the company together with a negative comment.
I am currently building a low energy heating system into electric cars - I have a lot of orders from sevarl facebook groups. If I make a heating and send out without providing proper material explaining the installation, than I am just cheating - and this is exactly what hobbytronics uk does.

If you buy a pair of trousers without labe on how to wash, you wash them first and they are ruined - is it your fault not making your background study (in chinese) about the material? I don`t think so and the regulators seem to agree with me.

Hi everyone, Hobbytronics here. We're looking into this issue, and if there are any problems with the documentation we will try to get it updated. Apologies for the issue.

I purchased one of these boards again from HobbyTronics. I’m struggling to get the sample project which after contacting HobbyTronics was sent the source code, but I am struggling to get it to compile:

I’ve also ordered a SparkFun ODBII to DB9 Cable.

The libraries I have installed:
107-Arduino-MCP2515
MCP_CAN_lib-master
SparkFun_CAN-Bus_Arduino_Library-master
CAN_BUS_Shield-master

All these are installed in ~/Documents/Arduino/libraries

This is the sketch:

/***************************************************************************
 * 
  Hobbytronics Leonardo CAN-BUS board

  Send Test Data to other nodes
  
  Leonardo CAN BUS product page  http://www.hobbytronics.co.uk/leonardo-canbus
   
  Hobbytronics.co.uk
****************************************************************************/
#include <mcp_can.h>
#include <SPI.h>

int led = 23;

MCP_CAN CAN0(17);           // Set CS to pin 17

void setup() {
   Serial1.begin(9600);
   Serial1.print("Can Test..\r\n");
   // init can bus, baudrate: 500k
   if(CAN0.begin(CAN_500KBPS) == CAN_OK) Serial1.print("can init ok!!\r\n");
   else Serial1.print("Can init fail!!\r\n");
   pinMode(led, OUTPUT);
}

unsigned char stmp[8] = {0, 1, 2, 3, 4, 5, 6, 7};
void loop() {
   // send data:  id = 0x00, standard frame, data len = 8, stmp: data buf
   digitalWrite(led, HIGH);   // turn the LED on   
   CAN0.sendMsgBuf(0x00, 0, 8, stmp);  
   delay(100);
   digitalWrite(led, LOW);   // turn the LED off  
   delay(900);                       // send data every second
}

When I use the Verify option I get:

Leonardo_CanBus_test_send:17:16: error: no matching function for call to 'MCP_CAN::MCP_CAN(int)'
 MCP_CAN CAN0(17);           // Set CS to pin 17
                ^
In file included from /Users/sy/Documents/Arduino/Leonardo_CanBus_test_send/Leonardo_CanBus_test_send.ino:12:0:
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note: candidate: MCP_CAN::MCP_CAN()
 class MCP_CAN
       ^~~~~~~
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note:   candidate expects 0 arguments, 1 provided
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note: candidate: constexpr MCP_CAN::MCP_CAN(const MCP_CAN&)
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note:   no known conversion for argument 1 from 'int' to 'const MCP_CAN&'
Multiple libraries were found for "mcp_can.h"
 Used: /Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master
 Not used: /Users/sy/Documents/Arduino/libraries/CAN_BUS_Shield-master
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note: candidate: constexpr MCP_CAN::MCP_CAN(MCP_CAN&&)
/Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master/mcp_can.h:28:7: note:   no known conversion for argument 1 from 'int' to 'MCP_CAN&&'
exit status 1
no matching function for call to 'MCP_CAN::MCP_CAN(int)'

SPlatten:
I'm struggling to get the sample project which after contacting HobbyTronics was sent the source code, but I am struggling to get it to compile:
...
The libraries I have installed:
...
MCP_CAN_lib-master
SparkFun_CAN-Bus_Arduino_Library-master
CAN_BUS_Shield-master
...

Multiple libraries were found for "mcp_can.h"

Used: /Users/sy/Documents/Arduino/libraries/MCP_CAN_lib-master
Not used: /Users/sy/Documents/Arduino/libraries/CAN_BUS_Shield-master

The problem seems to be that you have multiple libraries installed and the Arduino tool chain doesn't know which one to choose, so picks the wrong one. Pity the example sketch doesn't state its prerequisites in a comment at the beginning of the sketch.

I think the library you need is this one from reeedstudio. I suggest, for the avoidance of doubt, you delete MCP_CAN_lib-master, SparkFun_CAN-Bus_Arduino_Library-master and CAN_BUS_Shield-master from your libraries folder. Then install just the one mentioned from reeedstudio and see if there is any improvement.

Thank you, I removed the CAN libraries from my libraries folder and downloaded from your link, it now compiles with no warnings or errors.

Thanks again!