Page 1 of 2

Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Sun Oct 18, 2015 7:29 am
by Monroe07
Ok, So as far as I understand, There are 2 types of information on a CAN-BUS.

A type of info you have to query for (send a PID or Request for), and information that is being broadcast automatically or being asked for already by another device on the network.

My question is this;

how do I read (Sniff) and view the information on the bus that's already being sent? I don't want to "send" anything to an ECU, I just want to receive everything on the bus and then sort or "filter" out what I don't want or need. Is that already what the i2c_RPM does? Just show you what you want to see from everything that is being sent on the bus?
If so, How do the opposite? Send a request onto the bus and receive the response?

I'm starting to regret buying this and not going with the Seeed Studio shield in which I can completely customize what I send and filter the information in a much simpler manor.

Re: Reciveing Passive Information on the CAN-BUS (Not Queryi

Posted: Sun Oct 18, 2015 12:20 pm
by stanley
We are working on the sniff mode. Currently this is not yet supported.

Sniffing OBD - Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Wed Jun 14, 2017 12:33 pm
by cottjr
+1 on this request.

In order to use the Freematics ONE for a fleet project I'm working on, it needs to be able to sniff.

Is sniffing possible now? Has this capability become possible since Oct 2015? Can somebody share an update?

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Tue Jun 20, 2017 1:32 pm
by jonathan
I'm working on a custom firmware to sniff CAN data from Tesla vehicles. I'll make a post here once it's finished.

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Wed Jun 21, 2017 6:53 am
by cottjr
Jonathan,

Tesla focused sniffing firmware - sounds great!

What kind of trajectory are you on - days, weeks, months away?

Are you planning to share open source, or sell licenses?

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Mon Jun 26, 2017 1:04 pm
by jonathan
I talked to stanley on facebook about this. He said it's not possible to do sniffing with the STM32 chip and no firmware is available. He advised to get a CAN shield if you want to do sniffing.

We tried setting the chip in to Monitor All mode (by sending the ATMA command and trying to read constantly), but got no results. Here's the code I used in case you're wondering:

bool COBDSPI::init(OBD_PROTOCOLS protocol, HardwareSerial& s) {
s.println();
const char *initcmd[] = {"ATZ\r",
// "ATL1\r",
"ATE0\r",
"ATH0\r",
"ATCRA\r",
// "ATCS\r",
// "ATCFC1\r",
// "ATCM0ff\r"
// "ATS1\r",
// "ATS1\r",
// "ATAL\r",
// "ATMA\r"
};
char buffer[64];

m_state = OBD_DISCONNECTED;
for (unsigned char i = 0; i < sizeof(initcmd) / sizeof(initcmd[0]); i++) {
write(initcmd[i]);
if (receive(buffer, sizeof(buffer), OBD_TIMEOUT_LONG) == 0) {
return false;
}
s.print(initcmd[i]);
s.println(buffer);
}


if (protocol != PROTO_AUTO) {
sprintf_P(buffer, PSTR("ATSP %u\r"), protocol);
write(buffer);
s.print(buffer);

if (receive(buffer, sizeof(buffer), OBD_TIMEOUT_LONG) == 0 && !strstr(buffer, "OK")) {
return false;
}
s.println(buffer);
}
write("ATMA\r");
while(1) {
sprintf(buffer, "reset");
receive(buffer, sizeof(buffer), OBD_TIMEOUT_LONG);
s.print("ATMA");
s.println(buffer);
delay(30);
}
};

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Thu Jun 29, 2017 12:30 am
by cottjr
Hmm - so close...

Well thanks very much for giving this a shot :)

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Mon Nov 27, 2017 5:31 am
by eric
jonathan wrote:
> I talked to stanley on facebook about this. He said it's not possible to do
> sniffing with the STM32 chip and no firmware is available. He advised to
> get a CAN shield if you want to do sniffing.

:o
This simple sniffing to get data which is already on the bus was the main reason i bought the ONE+.
I read "arduino" and "open source" and since i have it working on a bulky shield, i thought this nice newer and faster "ONE+" must be even better!
Very disappointing at the moment to see this limitation.

The EV-Community need such a tool!
Tesla, Daimler, Smart, Renault, Hyundai, etc.

... if i can help. i have a smart and a zoe for testing.

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Tue Nov 28, 2017 11:37 am
by stanley
Technically we can implement API for CAN sniffing for Freematics ONE/ONE+. The related AT commands are already implemented in our OBD-II UART Adapters.

Re: Reciveing Passive Information on the CAN-BUS (Not Querying)

Posted: Fri Dec 01, 2017 11:16 pm
by eric
Hi Stanley,

is there a documentation of the AT-Commands?
Then we can try ourselfe.

...