Giter Club home page Giter Club logo

api-examples's Introduction

CAN bus API examples (Python/MATLAB) | CANedge

This project includes Python and MATLAB examples of how to process MF4 log files with CAN/LIN data from your CANedge data loggers. Most examples focus on the use of our Python API modules (canedge_browser, mdf_iter, can_decoder) for use with the CANedge log file formats (MF4, MFC, MFE, MFM). However, you'll also find other script examples incl. for the asammdf Python API, MATLAB, S3 and more.


Features

For most use cases we recommend to start with the below examples:
- data-processing: List log files, load them and DBC decode the data (local, S3)

For some use cases the below examples may be useful:
- other/asammdf-basics: Load and concatenate MF4 logs, DBC decode them - and save as new MF4 files
- other/matlab-basics: Examples of how to load and use MF4/MAT CAN bus data 
- other/s3-basics: Examples of how to download, upload or list specific objects on your server
- other/s3-events: Using AWS Lambda or MinIO notifications (for event based data processing)
- other/misc: Example of automating the use of the MDF4 converters and misc tools


Installation

  • Install Python 3.7 for Windows (32 bit/64 bit) or Linux (enable 'Add to PATH')
  • Download this project as a zip via the green button and unzip it
  • Open the folder with the requirements.txt file and enter below in your command prompt:
Windows
python -m venv env & env\Scripts\activate & pip install -r requirements.txt
python script_to_run.py
Linux
python -m venv env && source env/bin/activate && pip install -r requirements.txt
python script_to_run.py

If you later need to re-activate the virtual environment, use env\Scripts\activate.


Sample data (MDF4 & DBC)

The various folders include sample log files and DBC files. Once you've tested a script with the sample data, you can replace it with your own.


Usage info

  • Some example folders contain their own README.md files for extra information
  • These example scripts are designed to be minimal and to help you get started - not for production
  • Some S3 scripts use hardcoded credentials to ease testing - for production see e.g. this guide

Which API modules to use?

There are many ways that you can work with the data from your CANedge devices. Most automation use cases involve fetching data from a specific device and time period - and DBC decoding this into a dataframe for further processing. Here, we recommend to look at the examples from the data-processing/ folder. These examples use our custom modules designed for use with the CANedge: The mdf_iter (for loading MDF4 data), the canedge_browser (for fetching specific data locally or from S3) and the can_decoder (for DBC decoding the data). In combination, these modules serve to support most use cases.

If you have needs that are not covered by these modules, you can check out the other examples using the asammdf API, the AWS/MinIO S3 API and our MDF4 converters.

If in doubt, contact us for sparring.


About the CANedge

For details on installation and how to get started, see the documentation:


Contribution & support

Feature suggestions, pull requests or questions are welcome!

You can contact us at CSS Electronics below:

api-examples's People

Contributors

matinf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.