linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ODB-II Interfaces and Linux CAN?
@ 2012-04-27  9:46 Sven Geggus
  2012-04-27  9:59 ` Marc Kleine-Budde
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Geggus @ 2012-04-27  9:46 UTC (permalink / raw)
  To: linux-can

Hello,

cheap ODB-II Interfaces claiming to support CAN (at least up to 500 kbps)
are available for less than 20 Euros now.

Here is one of them:
http://www.autodia.de/produkte/autodia-e327/technische-daten

Will this already work with socketcan or would it be possible to implement
support?

Sven

-- 
"If you don't make lower-resolution mapping data publicly
available, there will be people with their cars and GPS
devices, driving around with their laptops" (Tim Berners-Lee)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ODB-II Interfaces and Linux CAN?
  2012-04-27  9:46 ODB-II Interfaces and Linux CAN? Sven Geggus
@ 2012-04-27  9:59 ` Marc Kleine-Budde
  2012-04-27 11:50   ` Sven Geggus
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2012-04-27  9:59 UTC (permalink / raw)
  To: Sven Geggus; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

On 04/27/2012 11:46 AM, Sven Geggus wrote:
> Hello,
> 
> cheap ODB-II Interfaces claiming to support CAN (at least up to 500 kbps)
> are available for less than 20 Euros now.
> 
> Here is one of them:
> http://www.autodia.de/produkte/autodia-e327/technische-daten

nice :)

> Will this already work with socketcan or would it be possible to implement
> support?

The webpage talks about a "327 Chip" when searching for it, I find:
http://www.blafusel.de/obd/obd2elm327.html
http://www.elmelectronics.com/DSheets/ELM327DS.pdf

This chip converts ODB (and CAN seems to be part of ODB) to serial. The
question is how the 327 in the autodia-e327 is converted to USB. They
probably use a standard USB-Serial converter chip. There is support for
serial attached CAN adapters in mainline (IIRC), but I think it talks a
different protocol. So if it's possible the send and receive CAN
messages with the 327 it should be possible to hack a driver that can
send/receive some CAN messages.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ODB-II Interfaces and Linux CAN?
  2012-04-27  9:59 ` Marc Kleine-Budde
@ 2012-04-27 11:50   ` Sven Geggus
  2012-04-27 13:00     ` Marc Kleine-Budde
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Geggus @ 2012-04-27 11:50 UTC (permalink / raw)
  To: linux-can

Marc Kleine-Budde <mkl@pengutronix.de> wrote:

> The webpage talks about a "327 Chip" when searching for it, I find:
> http://www.blafusel.de/obd/obd2elm327.html
> http://www.elmelectronics.com/DSheets/ELM327DS.pdf

Jepp this includes a description of the serial protocol.

> This chip converts ODB (and CAN seems to be part of ODB) to serial. The
> question is how the 327 in the autodia-e327 is converted to USB. They
> probably use a standard USB-Serial converter chip. 

They almost certaily do.

> There is support for serial attached CAN adapters in mainline (IIRC), but
> I think it talks a different protocol.

You are talking about slcan.c right?

Probably I should just get me one of these cheap Interfaces.

Sven

-- 
Unix is simple and coherent, but it takes a genius – or at any rate a
programmer – to understand and appreciate the simplicity
(Dennis M. Ritchie)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ODB-II Interfaces and Linux CAN?
  2012-04-27 11:50   ` Sven Geggus
@ 2012-04-27 13:00     ` Marc Kleine-Budde
  2012-04-27 17:40       ` Oliver Hartkopp
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2012-04-27 13:00 UTC (permalink / raw)
  To: Sven Geggus; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

On 04/27/2012 01:50 PM, Sven Geggus wrote:
> Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> 
>> The webpage talks about a "327 Chip" when searching for it, I find:
>> http://www.blafusel.de/obd/obd2elm327.html
>> http://www.elmelectronics.com/DSheets/ELM327DS.pdf
> 
> Jepp this includes a description of the serial protocol.

>> This chip converts ODB (and CAN seems to be part of ODB) to serial. The
>> question is how the 327 in the autodia-e327 is converted to USB. They
>> probably use a standard USB-Serial converter chip. 
> 
> They almost certaily do.
> 
>> There is support for serial attached CAN adapters in mainline (IIRC), but
>> I think it talks a different protocol.
> 
> You are talking about slcan.c right?

Yes.

> Probably I should just get me one of these cheap Interfaces.

These serial CAN converters are probably quite slow, I haven't used any.
Maybe Oliver can comment on them.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ODB-II Interfaces and Linux CAN?
  2012-04-27 13:00     ` Marc Kleine-Budde
@ 2012-04-27 17:40       ` Oliver Hartkopp
  0 siblings, 0 replies; 5+ messages in thread
From: Oliver Hartkopp @ 2012-04-27 17:40 UTC (permalink / raw)
  To: Sven Geggus; +Cc: Marc Kleine-Budde, linux-can

On 27.04.2012 15:00, Marc Kleine-Budde wrote:

> On 04/27/2012 01:50 PM, Sven Geggus wrote:
>> Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>>
>>> The webpage talks about a "327 Chip" when searching for it, I find:
>>> http://www.blafusel.de/obd/obd2elm327.html
>>> http://www.elmelectronics.com/DSheets/ELM327DS.pdf
>>
>> Jepp this includes a description of the serial protocol.
> 


Yes. It looks like that not only CAN diagnosis and transport protocols like
j1939 and iso-tp are supported to transfer their PDUs but also it is possible
to process bare CAN frames.

Implementing e.g. the iso-tp protocol inside the ELM327 chip hides the timing
requirements from the diagnosis application on the PC side. So the PC
application can be pretty simple - only processing PDUs without knowing all
the transport protocol details.

>>> This chip converts ODB (and CAN seems to be part of ODB) to serial. The
>>> question is how the 327 in the autodia-e327 is converted to USB. They
>>> probably use a standard USB-Serial converter chip. 
>>
>> They almost certaily do.
>>
>>> There is support for serial attached CAN adapters in mainline (IIRC), but
>>> I think it talks a different protocol.
>>
>> You are talking about slcan.c right?
> 
> Yes.
> 
>> Probably I should just get me one of these cheap Interfaces.


Good idea. Supporting all devices on earth is Greg K-Hs mission. So why not
bringing the ELM327 to life for SocketCAN? :-)

> These serial CAN converters are probably quite slow, I haven't used any.
> Maybe Oliver can comment on them.


Indeed there are many of them out there - as you can see in the Kconfig entry:

http://lxr.linux.no/#linux+v3.3.3/drivers/net/can/Kconfig#L21

The ASCII protocol is pretty simple and there's no kind of feedback or error
reporting - it's not my favourite CAN hardware ...

There are only incoming and outgoing ASCII streams which are converted to
struct can_frames in the slcan.c driver.

The slcan encapsulation format is described here:

http://lxr.linux.no/#linux+v3.3.3/drivers/net/can/slcan.c#L100

Before the simple stream conversion in slcan.c can take place the SLCAN
adapter needs to be initialized, and the bitrate needs to be set.

https://gitorious.org/linux-can/can-misc/blobs/master/slcan/SLCAN-API.pdf

This is done by e.g. slcan_attach tool.

Don't know how to setup the ELM327 to bring it into this mode - but if you get
one you may keep me informed.

Regards,
Oliver

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-27 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27  9:46 ODB-II Interfaces and Linux CAN? Sven Geggus
2012-04-27  9:59 ` Marc Kleine-Budde
2012-04-27 11:50   ` Sven Geggus
2012-04-27 13:00     ` Marc Kleine-Budde
2012-04-27 17:40       ` Oliver Hartkopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).