GithubHelp home page GithubHelp logo

togglebit / arduinodue_obd_freerunningcan Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 23.0 197 KB

These classes have been built with free-running CAN and OBDII data acq in mind

License: GNU Lesser General Public License v2.1

C++ 100.00%

arduinodue_obd_freerunningcan's People

Contributors

adamvoss avatar collin80 avatar togglebit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinodue_obd_freerunningcan's Issues

attempting to build using 1.6.8

I attempted with the library folder named CAN, can, and OBD2, all with the same result. It's almost as if it's not allowing the custom variant.h file to load...

Arduino: 1.6.8 (Windows 10), Board: "Arduino Due (Programming Port)"

In file included from C:\Users\Nathan\Documents\Arduino\libraries\OBD2/OBD2.h:18:0,

             from C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino:1:

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:121:5: error: 'UINT32' does not name a type

 UINT32 ID;      

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:132:9: error: 'UINT8' does not name a type

     UINT8 b[8];

     ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:136:13: error: 'UINT32' does not name a type

         UINT32 lowerPayload;

         ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:137:13: error: 'UINT32' does not name a type

         UINT32 upperPayload;

         ^

In file included from C:\Users\Nathan\Documents\Arduino\libraries\OBD2/OBD2.h:18:0,

             from C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino:1:

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:239:5: error: 'UINT32' does not name a type

 UINT32 getTimeSlice(bool max);

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:267:5: error: 'UINT32' does not name a type

 UINT32 getTxCtr();

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:274:5: error: 'UINT32' does not name a type

 UINT32 getRxCtr();

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:291:5: error: 'UINT32' does not name a type

 UINT32 count, prevCount, ticks, usTicks;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:296:5: error: 'UINT16' does not name a type

 UINT16 _1mSCntr, _10mSCntr, _100mSCntr, _200mSCntr, _1000mSCntr, _queryCntr;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:301:5: error: 'UINT32' does not name a type

 UINT32 usTsliceEnd, usTslice, usTsliceMax;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:316:5: error: 'UINT8' does not name a type

 UINT8 msgCntRx;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:317:5: error: 'UINT8' does not name a type

 UINT8 msgCntTx;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:318:5: error: 'UINT8' does not name a type

 UINT8 msgCntQuery;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:323:5: error: 'UINT8' does not name a type

 UINT8 queryIndex;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:328:5: error: 'UINT32' does not name a type

 UINT32 RxCtr;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:329:5: error: 'UINT32' does not name a type

 UINT32 TxCtr;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:338:5: error: 'UINT32' does not name a type

 UINT32 MAM_mask;

 ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/CAN_Acquisition.h:339:5: error: 'UINT32' does not name a type

 UINT32 MID_mask;                                                     

 ^

In file included from C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino:1:0:

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/OBD2.h:145:2: error: 'UINT32' does not name a type

UINT32 getIntData();

^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2/OBD2.h:223:9: error: 'UINT8' does not name a type

static UINT8 listIdx;

     ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino: In function 'void setup()':

CAN_BoardTest:36: error: 'class cCANFrame' has no member named 'ID'

 RAW_CAN_Frame1.ID    = 0x100;

                ^

CAN_BoardTest:38: error: 'class cCANFrame' has no member named 'ID'

 RAW_CAN_Frame2.ID    = 0x101;

                ^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino: At global scope:

CAN_BoardTest:56: error: 'UINT8' does not name a type

UINT8 i,CAN0_rxCtr,CAN1_rxCtr;

^

CAN_BoardTest:57: error: 'UINT32' does not name a type

UINT32 maxTime;

^

CAN_BoardTest:58: error: 'UINT8' does not name a type

UINT8 passFail;

^

C:\Users\Nathan\Documents\Arduino\libraries\OBD2\CAN_BoardTest\CAN_BoardTest.ino: In function 'void loop()':

CAN_BoardTest:63: error: 'passFail' was not declared in this scope

 passFail =  true;

 ^

CAN_BoardTest:66: error: 'CAN0_rxCtr' was not declared in this scope

 if (CAN0_rxCtr != CANport0.getRxCtr())

     ^

CAN_BoardTest:66: error: 'class cAcquireCAN' has no member named 'getRxCtr'

 if (CAN0_rxCtr != CANport0.getRxCtr())

                            ^

CAN_BoardTest:77: error: 'CAN0_rxCtr' was not declared in this scope

 CAN0_rxCtr = CANport0.getRxCtr();

 ^

CAN_BoardTest:77: error: 'class cAcquireCAN' has no member named 'getRxCtr'

 CAN0_rxCtr = CANport0.getRxCtr();

                       ^

CAN_BoardTest:80: error: 'CAN1_rxCtr' was not declared in this scope

 if (CAN1_rxCtr != CANport1.getRxCtr())

     ^

CAN_BoardTest:80: error: 'class cAcquireCAN' has no member named 'getRxCtr'

 if (CAN1_rxCtr != CANport1.getRxCtr())

                            ^

CAN_BoardTest:91: error: 'CAN1_rxCtr' was not declared in this scope

 CAN1_rxCtr = CANport1.getRxCtr();

 ^

CAN_BoardTest:91: error: 'class cAcquireCAN' has no member named 'getRxCtr'

 CAN1_rxCtr = CANport1.getRxCtr();

                       ^

exit status 1
'class cCANFrame' has no member named 'ID'

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

issues with AUTOBAUD

Hi, it seems the AUTOBAUD setting is causing serious problems when using the TIMER_2mS, but sooner or later also the POLLING mode (if combined with a more complex processes). I spent many hours trying to find out why my sketch freezes, also the communication through SerialUSB port itself, and why I have to manually erase the controller to upload a new sketch. While the OBD_Example_3.ino worked with the TIMER_2mS mode, the standard OBD2_11bit_ID example did not, when I modified it in the same way. Finally, I found out that the crucial difference is the use of AUTOBAUD - if used in the OBD_Example_3.ino, it freezes too. I suppose it requires too much time at every call - I thought it only detects the speed when the bus if first initialized.

I Need help!!

Hello I would like to ask you if this code works with "sn65hvd230" CAN transciever and if so does that work on a Citroen or any french car manufacturer. Thanks in advance

Other OBD2 Modes? (i.e. Mode 09 - Request vehicle information)

Wondering how to get access to other modes? Specifically, looking for VIN, found at Mode 9: Request vehicle information.

According to Wikipedia, VIN is:

Mode 9
PID 02
Data bytes returned = 17-20
17-char VIN, ASCII-encoded and left-padded with null chars (0x00) if needed to.

Something like this in OBD2.h ?

enum OBD_PID
{

	ENGINE_LOAD  = 0x04,
	COOLANT_TEMP = 0x05,
	ENGINE_RPM   = 0x0C,
	SPEED        = 0x0D,
	ENGINE_IAT   = 0x0F,
	ENGINE_MAF   = 0x10,
	THROTTLE_POS = 0x11,
	FUEL_FLOW    = 0x5E,
	VIN          = 0x02
};

/**
 * 
 * This enum represents the size of the OBD2 signal in bits (8,16,32) per OBD2 protocol
 */
enum OBD_PID_SIZE
{
	_8BITS  = 1,
	_16BITS = 2,
	_32BITS = 4,
	_160BITS = 20
};

/**
 * 
 * This enum represents the desired mode of the signal requested from the OBD2 port
 */
enum OBD_MODE_REQ
{
	CURRENT  = 1,
	FREEZE   = 2,
	REQUEST  = 9

};

and this line in the sketch:

cOBDParameter OBD_VIN(        "VIN "          , " #"      ,  VIN         , _160BITS,   false ,  REQUEST,  1,    0,  &CANport0, false);

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.