jgeisler0303 / can2mqtt Goto Github PK
View Code? Open in Web Editor NEWCAN bus to MQTT bridge with extensive parametrization for translation between CAN message and MQTT topic and payload string
License: GNU General Public License v3.0
CAN bus to MQTT bridge with extensive parametrization for translation between CAN message and MQTT topic and payload string
License: GNU General Public License v3.0
Hi jgeisler0303,
my incomming MQTT message couldn't be parsed:
2017-03-01 22:07:56,499 ERROR:Error translating mqtt message "601,2B,10,17,00,00,02,00,00" from topic "/CANopen/ID1_PHB" via transmitter transmitter_0: Error collecting values: 'cand_id'
My transmitter section look like this:
transmitters: [
{
subscriptions: "/CANopen/ID1_PHB",
canid: "can_id",
pack_template: "BBBBBBBBB",
var_names: ["cand_id", "val0", "val1", "val2", "val3", "val4", "val5", "val6", "val7"],
topic_template: "",
payload_template: "{can_id:d},{val0:d},{val1:d},{val2:d},{val3:d},{val4:d},{val5:d},{val
},
]
May be you can give me a hint about this?
Thank you
Olaf
PS: Receivers side is working well.
Hello jgeisler0303,
after several days the transmitter (mqtt -> can) fails and does not leave any hint within the logs (debug mode). The receiver part is still working fine. Stop/start the application. solves the problem
What do you think could be the problem?
Thank you
Olaf
Dear jgeisler0303,
when there is a mqtt tramit telegram to can-bus the last byte is fix 0x00.
e.g.
mqtt command:
mosquitto_pub -t '/CANopen/ID1_RxPDO1' -m '0x201,0xFF,0xFF,0xFF,0x55'
candump result:
can0 201 [4] FF FF FF 00
it should be:
can0 201 [4] FF FF FF 55
my configuration:
transmitters: [
{
subscriptions: "/CANopen/ID1_RxPDO1",
canid: "cob_id",
pack_template: "BBBB",
var_names: ["val1", "val2", "val3", "val4"],
topic_template: "",
payload_template: "{cob_id:d},{val1:d},{val2:d},{val3:d},{val4:d}"
},
Please can you check this?
Best regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.