3 posts / 0 new
Last post
Triggermouse
Triggermouse's picture
Is This Possible?

This is what I am trying to do:
- Be able to have the 'black box' every X amount of minutes, contact my own API, and send over data from pre-determined frame ids. Is this possible?

Example: Every 5 minutes data from frame ids 611, 830, and 450 are sent to api.MyApi.com for analysis.

I was looking into the javascript scripting in the docs, but wasn't sure if that was the best way to try to tackle this, or if there is a better way? Any input would be appreciated, thank you!

dexter
dexter's picture
Is This Possible?

Yes.

1. Add a module javascript plugin that hooks onto either a standard ticker event or a custom timed (delayed) event.
2. Let the event handler activate CAN logging with filter set to the frame IDs of interest on first entry (see e.g. "can log start vfs crtd ?").
3. On successive entries, let it…
- deactivate the logging to close the file,
- load the log,
- extract the data needed for your API,
- send the data via HTTP to your API,
- reactivate logging for the next run.

Regards,
Michael

dexter
dexter's picture
Is This Possible?

Second, better option: use the reverse engineering toolkit instead of the logger. Advantage: this doesn't need any file I/O, no start/stop, and data extraction is simple.
Bus/ID filtering works just the same way as with logging, see "re start ?".
Then, on your periodic handler call, simply extract the current frame data from "re stream list", which outputs the frames in JSON syntax (meant for the web UI).

Regards,
Michael

Log in or register to post comments