GithubHelp home page GithubHelp logo

serial_can_arduino's Issues

SoftwareSerial library not compatible for >20MHz processors

I am using the Feather M4 Express (ATSAMD51 controller on it) with the Serial CAN board and I am unable to compile the example code due to the error below.

lib/SoftwareSerial/SoftwareSerial.cpp:362:2: error: #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors

How can i get DTC (trouble codes) ?

Hi everyone, i would like to get trouble codes from car, but i have no clue how to do it, can anyone help me?
Thanks in advance.
Sorry for my bad english.

Unable to get running example

Hello,

I have two longan V1.2 micro can boards. I have them simply configured with uno's.

I am using the send and receive examples for testing.

I have changed the pints to 10 and 11 respectively for can tx and rx.

I have a twisted pair of wires connecting CAN_H to CAN_H and CAN_L to CAN_L but I am unable to successfully transmit any data from the send to recv. I added canBus->listen(); to the begin function in order to tell software serial to listen for data on the bus.

Any suggestions?

Serial_CAN_Module.cpp timer_s variable set when it shouldn't

In Serial_CAN_Module.cpp / recv():

In the following lines the return 0 statement will never be reached since time_s is set right before the check.
Probably the timer_s = should be removed since it is also set at the very beginning of recv.

timer_s = millis();
if((millis()-timer_s) > 10)
return 0; // Reading 12 bytes should be faster than 10ms, abort if it takes longer, we loose the partial message in this case

what is the 0x7DF PID code?

I've bought a Serial CAN Bus Module v1.4 and I'm trying to get data from my car OBD port.
I've run the Arduino examples and couldn't get speed and rpm.
I don't know what is the correct PID and how can I use them.
for example, I need to find my car PIDs what is the 0x7DF PID in the examples codes?

sketch/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::exitSettingMode()':

Hi, could you please help me with the error below;

`
Arduino: 1.8.12 (Mac OS X), Board: "Arduino Nano, ATmega328P"

sketch/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::exitSettingMode()':
sketch/Serial_CAN_Module.cpp:172:31: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
int ret = cmdOk("AT+Q\r\n");
^
sketch/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::factorySetting()':
sketch/Serial_CAN_Module.cpp:286:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
if(cmdOk("AT\r\n"))
^
/Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::exitSettingMode()':
/Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp:172:31: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
int ret = cmdOk("AT+Q\r\n");
^
/Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::factorySetting()':
/Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp:286:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
if(cmdOk("AT\r\n"))
^
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of canSerial'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::begin(int, int, unsigned long)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::send(unsigned long, unsigned char, unsigned char, unsigned char, unsigned char const*)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::recv(unsigned long*, unsigned char*)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::clear()'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::cmdOk(char*)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::enterSettingMode()'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::exitSettingMode()'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::canRate(unsigned char)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::baudRate(unsigned char)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of make8zerochar(int, char*, unsigned long)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::setMask(unsigned long*)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::setFilt(unsigned long*)'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::factorySetting()'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function canSerial': (.text+0x0): multiple definition of Serial_CAN::debugMode()'
sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

obd_demo usage

Hello ,

I have OBD-II CAN-BUS Development Kit. I have prepared kit as in the instructions. Compile and upload the code to the arduino.

When I power on my arduino by plugging usb to pc , if obd2 connected to vehicle , serial monitor wont show any message, If obd2 is not connected serial monitor says

15:11:24.153 -> set can rate ok
15:11:24.856 -> set mask ok
15:11:27.341 -> set filt ok
15:11:27.341 -> begin

after it says begin i plug obd2 socket to the vehicle (opel astra 2013 sedan )
when i send
15:27:54.128 -> SEND PID: 0xC
15:27:54.175 ->
15:27:54.175 -> ------------------------------------------------------------------
15:27:54.175 -> Get Data From id: 0x7E8
15:27:54.175 ->
15:28:05.368 -> SEND PID: 0xD
15:28:05.415 ->
15:28:05.415 -> ------------------------------------------------------------------
15:28:05.415 -> Get Data From id: 0x7E8
15:28:05.415 ->
15:28:12.399 -> SEND PID: 0x5
15:28:12.446 ->
15:28:12.446 -> ------------------------------------------------------------------
15:28:12.446 -> Get Data From id: 0x7E8
15:28:12.446 ->

It show me these responses. How can it get speed , rpm values ?

And why should i need to unplug obd2 connector to make connection well.

CAN Bus dev kit issue with code examples - perhaps baudrate

Hello,

I have recently ordered an OBD II CAN bus dev kit, along with an Arduino Uno. After assembling it I have encountered some issues with this associated repository. For context, I have it connected to my Vauxhall Corsa C (2005), which I have checked is full CAN bus. I am using the Arduino IDE too.

This is the kit: https://coolcomponents.co.uk/products/obd-ii-can-bus-development-kit?currency=GBP&variant=14053842518077&utm_medium=cpc&utm_source=google&utm_campaign=Google%20Shopping&gclid=CjwKCAjw0qOIBhBhEiwAyvVcfzNDx3rhWIP5s0Sm54Jer5jDSxRrLzALLirqVBqXPdg-PCjtGTRekhoCJvIQAvD_BwE

I have been testing the obd_demo example and I believe I have encountered a communication rate issue of some kind (baud rate related perhaps). How should the rates be setup?

At the moment, the output is inconsistent and usually has many question marks.

Thanks,

Flynn

error "set can rate fail"

Hello,

I connect the serial CAN bus on an arduino mega 2560 as described in the file recv.ino but I get the message "set can rate fail". I just wanted to test the code without already reading a CAN-bussystem. What is the cause of this message?

Thanks in advance,
Bart

Extra bytes break library

Hi.

I am using this library and the serial CAN module to talk to a race car dashboard that supports custom CAN in and out.

This works 95% of the time, but sometimes the data stream contains extra bytes (anywhere between 3 and 7) that don't make sense to me.
In theory we can just discard those extra bytes, and skip to the beginning of the next CAN message. In practice what happens is this library gets out of sync and starts sending back CAN messages which are offset in the byte stream.

example:

normal message:

0x0 0x0 0x0 0xA1 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8

I receive the above in a loop, no problem. Then all of the sudden this arrives:

0xC1 0xA4 0x3 0x5

(this is an example, can be any random sequence and the number of bytes also varies)

followed by:

0x0 0x0 0x0 0xA1 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8

What happens in the library. It builds the following CAN command:

0xC1 0xA4 0x3 0x5 0x0 0x0 0x0 0xA1 0x1 0x2 0x3 0x4

and sends it back to the caller. Of course I can't do anything with that as I don't understand the command. From there on the entire CAN stream is offset 4 bytes and I never get a correct command again.

What I did to fix this is to check that when reading a sequence of bytes that the first 4 are 0x0 0x0 0x0 0xA1 and the last 2 are 0x7 0x8, but this of course only works because I know that the input data will always start with this and that the last 2 bytes are 2 fixed values. This is in no way a generic solution for the 'out of sync' problem.

Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.