Download Chargestation Diagnostic Log Files

Introduction

As a network admin, you may need to download diagnostic log files directly from the chargestation. Manufacturers will request these files from time to time to investigate hardware faults and firmware issues. You can use the eDRV APIs to download files from the charging station to an FTP server.

❗️

Manufacturer's Support Recommended

Unfortunately downloading chargestation diagnostic logs over the air is painful and prone to failure. Chargestations often have problems uploading diagnostics files to your FTP servers.

There is not much eDRV can do beyond reporting the error (if sent) by the chargestation. We highly recommend contacting the Manufacturer's support team to help you resolve chargestation diagnostics issues.

FTP Upload URLs

Pleease first, check with your manufacturer what type of FTP upload protocols and URLs are supported. eDRV will send this URL as is to the chargestation.

Common format examples:

Using the API to download chargestation hardware logs

Use Get Diagnostics API to download your charge station diagnostics log file. You can also refer to the following sample code for the request:

const request = require('request');

const options = {
  method: 'POST',
  url: 'https://api.edrv.io/v1.1/chargestations/5fb24edb6434561ds6f31000/get_diagnostics'
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
    Authorization: 'Bearer eDRV_TOKEN'
  },
  body: {
    location: 'ftp://username:[email protected]',
    startTime: '2021-01-13T16:19:50.340Z',
    stopTime: '2021-07-13T16:19:50.340Z',
    meta_data: {sample_key1: 'some text', sample_key2: 1234.56}
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
  /*Handle error if the chargestation refused to honor this request*/
  const cs_response = data.result.command.status;
  /*Save the file name in your application*/
  const file_name = data.result.command.response_data.filename;
  
});

Here a sample response:

{
  "ok": true,
  "result": {
    "command": {
      "owner_type": "user",
      "deleted": false,
      "_id": "62a97252a7b13712eabe8000",
      "owner": "603763d392204c0c84057000",
      "organization": "5e7e6c058a6deccfefdf4000",
      "type": "GetDiagnostics",
      "status": "CSAccepted",
      "chargestation": "618ea8f5549b8266acbac000",
      "data": {
        "location": "ftp://username:[email protected]",
        "startTime": "2021-01-13T16:19:50.340Z",
        "stopTime": "2021-07-13T16:19:50.340Z"
      },
      "createdAt": "2021-06-15T05:46:58.549Z",
      "updatedAt": "2021-06-15T05:46:58.741Z",
      "__v": 0,
      "response_data": {
        "filename": "diag-abcd-20220615T054658018.aes"
      }
    }
  },
  "message": "Created"
}

The response statustypes are:

  • CSAccepted : The chargestation has received the request and has begun processing it
  • CSRejected : The chargestation rejected this request
  • Error : There was an error is sending this request to the chargestation, for e.g. if the communications link is down

Monitoring Chargestation Responses

Once your chargestation has received your request, you can monitor responses via eDRV's logs. Unfortunately, the detail provided in the responses is manufacturer-dependent.

A Successful Upload

A Failed Upload

A Failed UploadA Failed Upload

A Failed Upload

Common causes of file upload failure

The most common causes that the eDRV team has seen across manufacturers are:

  • Malfunction: The chargestation is faulting or malfunctioning and is unable to gather and upload logs
  • Communication Issues: If the link to the chargestation is problematic, it may not be able to upload the file
  • Malformed FTP URL: If your FTP username, password, or URL is incorrect
  • Unsupported FTP Protocol type: Many chargestations do not support more modern FTP protocols such as sFTP and encryption such as TLS. Please check with your manufacturer what type of FTP protocol a chargestation supports for sending files.

Common causes of file upload failure