Welcome to the CanZE app pages

canze-icon-shadingIf you want to learn about your Renault electric vehicle, you’ve come to a good starting point. We will supply you with an app that displays driving stats and lots of interesting information about your car. All you need is a Bluetooth OBDII dongle and an Android device. For a more detailed description of the app see the about or the screenshot page.

The app is also available on Google Play store here.

Dash camera

While looking for some stretched screen, I came up with one of these new dash camera devices (1280×400 pixels). OK, the camera in itself doesn’t really interest me, because I only want to use it to make CanZE run on it, which is actually quite easy to do.

The only thing on that device that I do not like at all, is that the USB connector seams to be used only for power, so I can’t use it as development device out of the box but need to compile and transfer the app package in order to be able to install and run CanZE. 🙁

But at least the PlayStore is available out of the box and all underlying Android settings can be reached easily …

Geek talk: ISO-TP and ELM327 dongles

Micro introduction: A CANbus, which is used to connect all computers in the car, can only carry chunks of 8 bytes plus an ID, called frames. All data used to actually operate the car, such as switch positions, speed, and hundreds of other parameters are stuffed into unique frames and send out freely, almost always at fixed timed intervals. This is why we call them free frames. There is zero standardization among car makers on the meaning of the ID and the bits inside. Commercial dongles are not really designed to pick these up and have a lot of trouble doing so reliably or at all. (hint: “Timeout on ATMA” anyone?)

To actually diagnose the car, far larger “messages” are required. Even a VIN doesn’t fit in one frame, let alone i.e. the data for the voltage heatmap. For this purpose there is a protocol called ISO-TP which allows you to send longer messages. A software layer chops it up in frames, adds some synchrnisation data and sends it on. Exactly the same happens for long answers. ISO-TP formatted messages are almost exclusively of the query-response type. One participant (say the dongle or the dealers diagnostics tool) requests something, a computer on the bus answers. Even entire firmware up- and downloads are performed this way.

Why is this relevant? The ELM327 based dongles have basic support for ISO-TP. It’s a pain to set up, but it works and it’s actually what they are designed to do. The caveat being it only works for receiving long messages. We never gave this a lot of thought as the queries we put to the car always fit one single frame. Until the TPMS requirement came up. Writing the valve ID’s requires sending a long message. We implemented “long message ISO-TP” from the get go in the CanSee DIY dongle, so after tedious debugging, we knew setting TPMS worked, but now we had to tweak the driver for the ELM327 dongles to support long messages.

Luckily we were not the first. This nut was already cracked by Cedric Paille, the hero who made DDT4All. By carefully going through the logs of DDT4All, we could modify our ELM327 driver to now also send long messages.Thank you Cedric! The crazy thing is that if you use a commercial dongle, it does quite a bit of the ISO-TP hard work for receiving frames, but for sending we do most of it in CanZE. This is what actually held up a new CanZE release.

Teaser: we have more things up our sleeves regarding not just the CanSee DIY dongle but also for the good old ELM’s. But first: a few final test and then release. As always, stay tuned.

CanSee dongle v2

Too impatient to wait for the ODB2 cases to arrive, I reused my ELM732 WiFi dongle I didn’t use anyway, to build a second CanSee dongle.

LED’s have been put into a new order and the interior is somewhat cleaner. There is no second transceiver in yet, but a placeholder is present.

So stay tuned 😉

TPMS IDs can now be read and written

In the next release, which we will try to push out really soon, the Tyres screen has been augmented with a section where you can read the IDs of your TPMS valves and write them back. So, if you have a second set of wheels with TPMS valves, simply make sure you know and remember the IDs of the valves, and can write them back in after a change.

At this moment we have no way to let the car reliable learn new valves with unknown IDs, so you need to visit the dealer once more to get to the IDs of your other set of valves, but from then on, you’re done. Also, if you happen to buy after market valves, check the packaging if there is a 6 hex digit ID printed. Might save you a dealer visit.

If you have TPMS, our advice is to read out the IDs as soon as the next release is out and store a screenshot somewhere.

Thanks bjaolsen for the information and Richard for letting me try this on your car.

New material arrived …

New material arrived …

So let’s wait for the ODB2 cases to arrive before the fun can start 😉


DIY dongle build and documentation

While heavily a Work in Progress, Bob has started to put together some decent documentation on the dongle. It’s in the development branch of the firmware on gitlab, look here for odt and pdf versions. Have a peek and maybe you want to go on an order spree.

On the hardware side, as you probably have noticed we’ve progressed from the breadboard to veroboard-and-hot-glued in an OBD2 dongle enclosure. At least our builds are now a bit wife-friendly 😉

On the software side we’re working on a few features such as direct access to the Multimedia CANbus that Bob mentioned in the previous post, It will open up a few possibilities you will really like (more on that later). Also, we’re working on making the thing a bit more secure, but also more friendly for the non-technical user.

And then there is the ton of other things small and large. To name just a few:
– some things need to be slightly changed in CanZE now that is fed with data so much faster
– a setting screen in CanZE for this device
– low level technical stuff to make more things possible

For the techies: implementing sending multi-frame ISO-TP messages is needed. It required a lot of testing and coding and what not. This is how my desk looks around midnight. CANbus sniffer (Arduino DUE with GVRET) under USB control, T-cable with custom RJ-45 pinout, RJ45 splitter, RJ45 coupler with a CAN termination resistor tucked inside, RJ45 power insert contraption with lots of hot glue, the DIY Dongle being monitored over USB ……..

Is anyone experienced in moving this sort of home grown garage build stuff to the level of a decent and efficient PCB design without using a development board, a production run and maybe even fulfillment?

CanSee dongle in DIY mode

My current development dongle already looks somewhat clearer, now that it got it’s case, but under the hood, there is still room for improvement.

The second transceiver has recently be added, still it is not being used right now. So the hardware is present and software development is “under construction”.


Dongle build: from breadboard to veroboard

Here is an example on how I build my dongle prototype. Note that this is not fitted in a real dongle case. It’s slightly too big for it and at the moment this my only ESP32 board and I want it removable. Also, I do like the RJ45 connectors (see this post) I use to hook up to the ZOE’s different CAN buses. In a follow up post I’ll show a more neatly “dongle-ized” evolution, with added LEDs, and maybe even able to access that second CANbus without any replugging.

The development board is plugged into two pin headers. When removed it reveals the DC-DC converter set to about 5.5 volt and the CANbus transceiver.

Dongle firmware

The software consists of a few functional parts.

First, there is the CANbus library. While the ESP32 is around for a while now and there is good CAN support in Espressif’s IDF, the support in the Arduino environment is mediocre at best. For instance, the receiving is implemented using proper FreeRtos queues, but sending a frame is totally unbuffered and without any success/failure feedback. Still, it works.

Then there is a simple I/O system that handles communication on basically a character by character basis to and from the Serial-over-USB, Bluetooth and Wifi (basically a socket connection over TCP/IP, and a local access point). While it takes some tinkering to get the WiFi sockets play nicely, all this stuff is very well supported in the ESP32 tool chain for Arduino. A simple command interpreter handles the commands. The language used is called BobDue for historical reasons.

Free frames on the bus are simply received, stored in an array with one element for each ID. When a frame is requested, the latest value is simply pulled from the array. Note that all this traffic is very volatile and it serves no purpose whatsoever to do complex queuing for any other reason than keeping up with the data speed.

ISO-TP frames are decoded and buffered, but only if they match up with the requested ID. Flow control is handled as is message assembly. We don’t support multi-package frame sending yet. Edit: we now fully support long message sending!

The main loop checks if there is a new frame on the queue and if so, having it processed. Then it checks for new characters from the I/O subsystem. Finally it calls a few ticker functions to send out queued ISO-TP frames and other housekeeping tasks, such as aging the free frame array.

The entire source is reasonably commented C code, and can be found on https://gitlab.com/jeroenmeijer/cansee. Just load the source into PlatformIO, select the board, and upload. This is all a work in progress and at this moment your best bet is the development branch. As soon things settle a bit, we will start doing decent releases with pre-compiled binaries attached.

While developing, tons of new ideas are popping up. Will talk about those later.

Dongle testing (more geek talk)

You might want to have a peek at this “Frankenstein contraption” testing rig. Things have moved on since (more on that in a later post), but this is how projects like this start. Note that I laid it out neatly on my desk. Real life testing is often a lot messier, often smacking all of this, plus a power bank, plus my laptop, plus my phone in my car!

I do all CANbus connections using RJ45 connectors with a specific pin layout. On the breadboard is the ESP32 development board, powered, flashed and debugged through it’s USB cable. I use PlatformIO on top of Atom on Ubuntu, after having recently switched from the Arduino IDE. The dev board is slightly development unfriendly in that it leaves no pin row on one side. Luckily, that side only needs Vcc, so a small green wire pops out under the board.

On the left side is the 3.3 volt CANbus transceiver. powered from the dev board. From here, a short grey cable carries the CANbus. The T in the middle connects the bus components. On the right a short wire to the SAE J1962 plug going to the car, and on the left is my good old GVRET device based on an Arduino Due and the accompanying SavvyCAN desktop software to spy on the bus and see what is going on. This proved invaluable again. At first the wrong bus resistors made the controller refuse sending packets. Later on it confirmed the car computers did fine answering, but there was a bug in the firmware interpreting that.

The silver block is just a connector, but when this is not connected to the car, I can replace it with an identical block with a 60 ohm resistor over the bus terminals to create an independent CANbus-on-my-desk. Note that to test a CANbus device such as the ESP32, you not only need that bus termination resistor, but also at least one other device to set the acknowledge bit of each frame transmitted by your device under test.

Top