Coder Social home page Coder Social logo

picana's Introduction

Picana

CANBus Communications tools and libraries for diagnosis and visualization

A WIP collection of libraries and materials to aid when working with CAN communications

picana_native

Rust library usable via FFI

Provides an interface with functions that aid in setup and use of a can interface or dump! Features include:

  1. Loading a dump file and reading canframes!
  2. Connecting to a local CAN interface

Communication is async to a dart client

picana_dart

Communicates with the ffi interface using Ports

NB: Ensure Submodules are initialized before building and apply any relevant patches i.e

git submodule update --init
cd ./nix && git apply ../nix_patch.diff 
cd ./socketcan-rs && git apply ../socketcan-libc.diff

Building

To build the project you would require (Tested on Linux - x64):

  1. A valid Dart SDK(> version 2.7.0)
  2. Cargo - to compile rust sources
  3. Can-utils package and access to VCAN interface for testing
  • To build the shared library
cd ./picana_native
BINDGEN_DART_SDK_PATH=... cargo build --release
cd ..
  • To test the shared library - copy it out to the picana dart directory
  1. Get latest dependencies
cp ./picana_native/target/release/libpicana.so ./picana_dart/
cd ./picana_dart
pub upgrade
  1. Start the CAN interface
sudo modprobe vcan
sudo ip link add vcan0 type vcan
sudo ip link add vcan1 type vcan
sudo ip link set vcan0 up
sudo ip link set vcan1 up
  1. Run the main example to test
pub run bin/main.dart

Open a new shell and you can send can messages via cansend to the virtual can interface and a handler should handle the messages e.g

cansend vcan0 6b1#ffff0000
cansend vcan1 6b1#ffff0000

You should see the messages been printed out to original console running the program!

##TODO:

-> Use as a library in other packages!!

picana's People

Contributors

kituyiharry avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

picana's Issues

Progress

Hey!

Wanted to ask about the repository. I am working on a project and now I am trying to Stream data from Rust to Dart and couldn't find a way to do so. I saw your repository but wasn't able to run it, so wanted to ask if you know a way to Stream CAN data from Rust to Dart in 2021?

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.