Carloop demo program

The easiest way to get started with Carloop is to use the demo program included in the library.

The demo program will print the battery voltage, number of CAN messages and GPS position to the USB serial port.

To use it connect a Particle Photon or Particle Electron into your Carloop. Then go to the Particle Build online code editor. Go to the library section (bookmark icon), search for Carloop and click “Use this example”.

The demo program is made with the carloop-library

1 Like

Maybe it is easier if we add some screenshots to go along with it.

Step 1: Create a new Particle App

Step 2: Add the Carloop library to your app

Step 3: Click on Include in App

Step 4: You are done!

I got these errors.

carloop/carloop.h:20:38: error: ‘CAN_D1_D2’ was not declared in this scope
static constexpr auto CAN_PINS = CAN_D1_D2;

carloop/carloop.h:51:5: error: ‘CANChannel’ does not name a type
CANChannel &can();

carloop/carloop.h:68:5: error: ‘CANChannel’ does not name a type
CANChannel canDriver;

It looks like you might be using an older version of Particle’s firmware. Try changing your target device’s firmware to version 0.4.9 or later to be able to use CAN. In order to do so:

  1. Go to environment.

  2. Click on the Devices icon:

  3. Click on your device (Electron or Photon) and select 0.4.9 or later in the dropdown:

1 Like

Thank you, I was on 0.4.8

Great to hear. I’ll also add that to the ‘Getting Started with Carloop’ topic.

1 Like

I’m finally getting started with this :slight_smile: and when I click devices, it asks for a device ID. Where do I get that? Using the particle app, it tries to look for a Photon-XXX wifi ssid, but mine has a DUO-YWTS ssid. Is mine obsolete?

New here. I followed the instructions for the demo app but unfortunately, I did not get any feedback from either a Photon or the Electron 3G. I tested with a Mercedes Benz w2003 and a Toyota Hilux D4D 2015 model.

I then went head and tried can-utils on a linux laptop as well but got nothing in the console when sniffing for packets.

Any pointers what to try next?

Thank you


Hey Katongo, have you confirmed that pins 6 &14 have CAN bus traffic on the OBD-II port? In other words, if you take a multimeter lead to one of them and the other lead to ground, what voltage are you getting?

If you are in fact on a CAN bus, you should see some traffic. However, there are some vehicle ECUs that only broadcast upon a “request” CAN message first. Here is a thread that will guide you on how to send those request messages: How to Request VIN - Software - Carloop Community

Hey @RJRJ,
It looks like you have a Redbear Duo. Those are a bit different to get setup. Have you checked the Particle documentation and forums?

@alanm, I will check on that and give feedback soon. Many thanks.

Hi @alanm,

I tested pins 6 and 14 using a multimeter and on both the reading was zero (0).

I will now proceed to test with the demo app and report back.

Thank you.