Full Version: Filters for OpenPlotter Serial APP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Is there any possibility to include a feature to apply filters to the Serial app?
For example, I have a Chinese battery power manager that outputs the data via RS485 with a specific structure that is unreadable for SinalK, with some lines of code I can convert the information to something readable.

Now I´m doing this kind of thing using external hardware like Arduinos or esp that reads serial data and with some code, I translate it to Openplotter readable information (usually NMEA0183 or SignalK data) 

The idea is to use python files with a specific structure to perform the filter. These filter files are stored in a folder and the Serial App search for these files in that folder.
In data --> Filter --> Out data

This is an example of how I correct a GPS sentences of a Cobra Marine MRF77B Radio. The radio outputs the GPS data via NMEA0183 but there are mistakes in the sentences (yes, a commercial radio with bugs....) 

I use a Wemos D1 with micropython to do the filter. I'll not need extra hardware if the serial app can do this.
You could try node -red , don't connect the serial to signalk but straight into node red, a little javascript to fix the data then send to a signalk node .
I like the idea of a place where small and specific pieces of code can be added but I am afraid openplotter-serial is not that place. This serial app is in charge of making stable the system assignment of serial interfaces (udev rules) and making easier some connections between applications and serial sources. There are not any script running in the background connecting to sources and parsing data from them, actually if we do that, some connections will be busy and signal k and other apps will not be able to connect to them.

Being said this, I see a new app here. A place where you can easily add small pieces of code (snippets) that you can choose to run at startup or run at some point using the actions of the openplotter-notifications app. For example in your case you just have to set the serial devices in openplotter-serial, add these serial devices to your script, your script to an specific folder and choose to run them at startup in this new app.

Of course node-red is always a good option for snippets.