GithubHelp home page GithubHelp logo

c3re / can2mqtt Goto Github PK

View Code? Open in Web Editor NEW
78.0 10.0 22.0 259 KB

CAN-Bus <-> MQTT-Bridge: bidirectional, configurable and extendable

License: MIT License

Go 93.59% Shell 6.41%
mqtt can-bus bridge mqtt-topics bus converter socketcan linux golang can

can2mqtt's People

Contributors

apo32 avatar beepernet avatar dependabot[bot] avatar mxmxchere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

can2mqtt's Issues

Optional Unidirectional Mode

In some cases (for example if you just want to extract data from a car or a heater) you may want to disable the bidirectional mode of can2mqtt and to restrict the data flow in only one direction.

CAN ID get broken if large

I have the following Line in my csv:
2349007619,none,eg/foo

On invocation I get:

"
main: the following CAN-MQTT pairs have been extracted:
main: CAN-ID conversion mode MQTT-topicmain: 2147483647 none eg/foo
canbushandler: received CAN-Frame: (ID:2349007619). Locking mutex
canbushandler: mutex was locked successfully.
canbushandler: ID:2349007619 was not subscribed. /dev/nulled that frame...
canbushandler: unlocked mutex.
"

It looks like a int32 -> uint32 conversion problem.

english translation

because the project is on github and is world readable i want it to be documented in english so as many people as possible are (re)use it

running issue

I try running on raspberry pi and I got an error:

mqtthandler: Oh no an error occured...
panic: Not Authorised

goruntime 1 [running]:
github.comc3re/can2mqtt.mqttStart(0x29fa8a, 0x14)
/home/openhabian/go_projects/src/github.com/c3re/can2mqtt/mqtthandling.go:22 +0x35c
github.com/c3re/can2mqtt.Start()
/home/openhabian/go_projects/src/github.com/c3re/can2mqtt/main.go:66 +0x6c
main.main()
/home/openhabian/go_projects/src/github.com/c3re/can2mqtt/can2mqtt/main.go:33 +0x298

Custom convertmode without recompiling

The idea is to have an configurable convert-mode that does not require re-compiling of the application. For example:

Having a second config-file which can contain custom-convertmodes written in a small, feature-restricted language (research needed here, probably CEL). The additional convertmodes can then be used in the csv-file as usual

Evaluate non-cgo can-bus lib

Currently can2mqtt uses github.com/brendoncarroll/go-can to deal with socketcan. A disadvantage of that is that cgo is used. This has some disadvantages:

  1. all the great memory safety is gone
  2. builds rely upon files placed in the filesystem out of the scope that go oversees (also see #23 )

Try out https://github.com/brutella/can as a replacement. It seems that it does not use cgo.

MQTT authentication

Would it be possible to add support for MQTT servers that require a username and password?

convert from MQTT to CAN

Hi
Is there a simple way to convert from MQTT to CAN? (The opposite of this package)

Thanks,
Adel

Reload feature

I want it to be possible to reload the config via a POSIX Signal like SIGUSR1

Setup instructions for a raspberry Pi

although this is not strictly can2mqtt related, it might be worth adding instructions how to setup a canbus interface on a raspberry. So that it is usable with can2mqtt.

better standardization of the single methods

my next task, or maybe the task of someone else who wants to participate is to clearly define and divide tasks for the different functions. currently some functions with the same name (e.g. convert2CAN and convert2MQTT) do different things. sometimes a function does only the plain conversion and another time the function is executing the conversion and the sending of the message

metrics/statistics

Maybe (just an idea) can2mqtt could expose an (optional) metrics endpoint that can be scraped by prometheus with stats about:

  • uptime
  • bytes transfered
  • messages/sec (split up in can and mqtt)
  • conversion errors

clean commandline arguments

I want the commandline arguments to be well documented and interchangeable. Right now all the options have to appear in one specific order. i want that to be unnecessary

Add conversion default mode

Add a mode where all unmentioned IDs in the can2mqtt.csv are filled up with a default line such as
ID,none,can2mqtt/ID

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.