Skip to content

smolkov/can4rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📟 can4rpc

pipeline status

Water quality monitor can binding jsonrpc

🚧 Work In Progress 🚧

API

protocol:jsonrpc Auf GitHub

Build Status]travis-url Build Status

Documentation

cargo add jsonrpc-core
cargo add jsonrpc-delive

Testing: Read analog1 in01

curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "analog_get_in01", "id":123 }' 127.0.0.1:3030

 Compiling

Requires Rust nightly. To compile using rustup:

$ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
$ rustup toolchain install nightly
$ rustup default nightly
$ cargo build

Be sure to switch back to stable with rustup default stable if that's your preferred toolchain.

To cross-compile for the Raspberry Pi you will need an gcc-multilib-i686-linux-gnu GCC toolchain and Rust component installed. Add the Rust target with rustup target add i686-unknown-linux-gnu. Then you can cross-compile with cargo:

    cargo build --release --target i686-unknown-linux-gnu

target/i686-unknown-linux-gnu/release/wqm-uv

Quick Links

🚀 PCan uber socketcan

[socketcan] crate.

PCan soketcan setup vcan0

Integrating the test into a CI system is non-trivial as it relies on a vcan0 virtual can device existing. Adding one to most linux systems is pretty easy with root access but attaching a vcan device to a container for CI seems difficult to find support for.

To run the tests locally, though, setup should be simple:

sudo modprobe vcan
sudo ip link add vcan0 type vcan
sudo ip link set vcan0 up
cargo test

About

Canbus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published