Thanks Mark, 

I had to implement VEHICLE_POLL_TYPE_OBDIIGROUP section of the code in the vehicle.c... and I had to correct some of the code.
I thought the moduleid was the requesting one while the rmoduleid was the response one ... Talk about context ;)

Nikolay
 



On Monday, June 22, 2015 3:12 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:


The Ampera is still using the old polling logic. The poling code is within the vehicle_voltampera module itself.

The Leaf is using the new centralised polling logic (in vehicle.h and vehicle.c). This is the new recommend way of doing this, as the vehicle.{h,c} code will do the polling for you - all you need to do is setup the appropriate structure.

The new structure is:

typedef struct
{
  unsigned int moduleid;
  unsigned int rmoduleid;
  unsigned char type;
  unsigned int pid;
  unsigned int polltime[VEHICLE_POLL_NSTATES];
} vehicle_pid_t;

and the following polling types are currently supported:

#define VEHICLE_POLL_TYPE_NONE          0x00
#define VEHICLE_POLL_TYPE_OBDIICURRENT  0x01
#define VEHICLE_POLL_TYPE_OBDIIVEHICLE  0x09
#define VEHICLE_POLL_TYPE_OBDIIGROUP    0x21
#define VEHICLE_POLL_TYPE_OBDIIEXTENDED 0x22

The moduleid is the replying module id, the rmoduleid is the id to use for the request.

Regards, Mark.

On 21 Jun, 2015, at 9:44 pm, Nikolay Shishkov <nshishkov@yahoo.com> wrote:

Hi , 

I am trying to make nissan leaf work with normal cable - on the CARCAN.

I am trying to figure out the polling mechanism and I have trouble understanding what the different parameters in the configurations are. 

In the ampera file I can see:
rom struct
{
unsigned int moduleid;
unsigned char polltime;
unsigned int pid;
} vehicle_voltampera_polls[]
=
{
{ 0x07E0, 10, 0x000D },
{ 0x07E4, 10, 0x4369 },
{ 0x07E4, 10, 0x4368 },
{ 0x07E4, 10, 0x801f },
{ 0x07E4, 10, 0x801e },
{ 0x07E4, 10, 0x434f },
{ 0x07E4, 10, 0x1c43 },
{ 0x07E4, 10, 0x8334 },
{ 0x07E1, 100, 0x2487 },
{ 0x0000, 0, 0x0000 }
};

While in the nissan leaf file I can see the following:

rom vehicle_pid_t vehicle_nissanleaf_polls[]
=
{
{ 0x797, 0x79a, VEHICLE_POLL_TYPE_OBDIICURRENT, 0x0d, { 10, 10, 0 } }, // Speed
{ 0x797, 0x79a, VEHICLE_POLL_TYPE_OBDIIVEHICLE, 0x02, { 10, 10, 0 } }, // VIN
{ 0, 0, 0x00, 0x00, { 0, 0, 0 } }
};

I can kind of guess some of it. 
I also found an old e-mail from Mark that describes a structure similar to the one in the nissan leaf file, but the leaf has one extra parameter - I think it is the return message can Id. 

Any info/advice is appreciated!

Nikolay
_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev


_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev