Thursday 20 April 2017

Show live data from can bus on webpage with visualization

I want to use a linux device like a BananaPi with a socketcan-compatible can-controller to connect to a automotive can-bus and show its data in realtime on a webpage, which should be hosted on the Pi. The data should be listed as hex-values and visualized via graphs (the different signals, for example the current speed).

After some research I discovered node-can and I could get managed to show the can-messages as a list on a webpage. But I noticed, that the messages come with a quite huge delay (~2 secs) when there is a huge busload (I sent can messages in a 1 ms period). The same delay occurs, if I use the following minimalistic example:

var can = require('socketcan');

var channel = can.createRawChannel("can1", true); 

channel.addListener("onMessage", function(msg) { console.log(msg); } );

channel.start();

I am absolutely new in this topic but I think, that nodejs isn't the best choice to realize this project?

Are there any other (better) methods to realize such a system?

I could imagine something like a C-backend, for example based on candump (with this program no delay occurs at the same busload), and a frontend realized with javascript, html and css. But I have no idea how to get those different single programs together. Could you give me a keyword so I have a starting point for further research (websocket?!)?

I also thought about writing the can frames in a sql database and grab them from the database for the webpage-gui but I have no idea, if/how this works and if this is fast enough....

Thanks in advance!



via misterx

No comments:

Post a Comment