Warning: lots of data.
Well I broke down and installed wireshark to see what was happening.
A snippet of my reduced testcase based on the Arduino example.
rpm = 1;
kpa = 2;
clt = 3;
spd = 4;
SendCANFramesToSerial();
delay(1000);
}
void SendCANFramesToSerial()
{
byte buf[8];
// build & send CAN frames to RealDash.
// a CAN frame payload is always 8 bytes containing data in a manner
// described by the RealDash custom channel description XML file
// all multibyte values are handled as little endian by default.
// endianess of the values can be specified in XML file if it is required to use big endian values
// build 1st CAN frame, RPM, MAP, CLT, TPS (just example data)
memcpy(buf, &rpm, 2);
memcpy(buf + 2, &kpa, 2);
memcpy(buf + 4, &clt, 2);
//memcpy(buf + 6, &tps, 2);
memcpy(buf + 6, &spd, 2);
// write first CAN frame to serial
SendCANFrameToSerial(3200, buf);
I see that with the rp2040 (broken) the header and data are shown by wireshark as “Leftover Capture Data”: data that it doesn’t know what to do with.
Header Packet: You can see the data on the last line of 44332211
Frame 149: 31 bytes on wire (248 bits), 31 bytes captured (248 bits) on interface \\.\USBPcap1, id 0
USB URB
[Source: 1.21.2]
[Destination: host]
USBPcap pseudoheader length: 27
IRP ID: 0xffff8c86d87e2aa0
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
IRP information: 0x01, Direction: PDO -> FDO
URB bus id: 1
Device address: 21
Endpoint: 0x82, Direction: IN
URB transfer type: URB_BULK (0x03)
Packet Data Length: 4
[Request in: 148]
[Time from request: 0.999383000 seconds]
[bInterfaceClass: CDC-Data (0x0a)]
Leftover Capture Data: 44332211
Data Packet last line shows the data. 4 packets with increasing values 1,2,3,4 with a frameID of 3200
Frame 361: 39 bytes on wire (312 bits), 39 bytes captured (312 bits) on interface \\.\USBPcap1, id 0
USB URB
[Source: 1.21.2]
[Destination: host]
USBPcap pseudoheader length: 27
IRP ID: 0xffff8c86d87e2aa0
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
IRP information: 0x01, Direction: PDO -> FDO
URB bus id: 1
Device address: 21
Endpoint: 0x82, Direction: IN
URB transfer type: URB_BULK (0x03)
Packet Data Length: 12
[Request in: 360]
[Time from request: 0.000959000 seconds]
[bInterfaceClass: CDC-Data (0x0a)]
Leftover Capture Data: 800c00000100020003000400
I then hooked up my esp32 (that does work with realdash) and get completely different data. Same sketch, but with esp32 instead. No leftover data. And it works.
Frame 506: 28 bytes on wire (224 bits), 28 bytes captured (224 bits) on interface \\.\USBPcap1, id 0
USB URB
[Source: 1.26.1]
[Destination: host]
USBPcap pseudoheader length: 27
IRP ID: 0xffff8c86cdcdf010
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
IRP information: 0x01, Direction: PDO -> FDO
URB bus id: 1
Device address: 26
Endpoint: 0x81, Direction: IN
URB transfer type: URB_BULK (0x03)
Packet Data Length: 1
[Request in: 505]
[Time from request: 0.000059000 seconds]
[bInterfaceClass: Vendor Specific (0xff)]
Leftover Capture Data: 00
I’m hoping someone can help guide me on what next steps should be. From my reading there shouldn’t be any Leftover Capture Data.
thanks
david