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

Inquiry and support for Freematics products
Monroe07
Posts: 4
Joined: Sun Oct 11, 2015 10:40 am

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

Post 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.
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

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

Post by stanley »

We are working on the sniff mode. Currently this is not yet supported.
cottjr
Posts: 10
Joined: Sat Jun 03, 2017 8:08 am

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

Post 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?
jonathan
Posts: 18
Joined: Thu Feb 04, 2016 1:25 pm

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

Post 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.
cottjr
Posts: 10
Joined: Sat Jun 03, 2017 8:08 am

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

Post 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?
jonathan
Posts: 18
Joined: Thu Feb 04, 2016 1:25 pm

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

Post 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);
}
};
cottjr
Posts: 10
Joined: Sat Jun 03, 2017 8:08 am

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

Post by cottjr »

Hmm - so close...

Well thanks very much for giving this a shot :)
eric
Posts: 7
Joined: Sun Nov 26, 2017 10:11 am

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

Post 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.
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

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

Post 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.
eric
Posts: 7
Joined: Sun Nov 26, 2017 10:11 am

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

Post by eric »

Hi Stanley,

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

...
Post Reply