SignalK / signalk-server

An implementation of a Signal K central server for boats.
http://signalk.org
Apache License 2.0
322 stars 156 forks source link

log2sk command is broken #1585

Closed xbgmsharp closed 1 year ago

xbgmsharp commented 1 year ago
$ ./bin/log2sk /logs/skserver-raw_2019-09-21T12.log 
/usr/lib/node_modules/signalk-server/lib/pipedproviders.js:41
        const onPropertyValues = (name, cb) => app.propertyValues.onPropertyValues(name, cb);
                                                                  ^

TypeError: Cannot read properties of undefined (reading 'onPropertyValues')
    at Object.onPropertyValues (/usr/lib/node_modules/signalk-server/lib/pipedproviders.js:41:67)
    at new N2kMapper (/usr/lib/node_modules/signalk-server/node_modules/@signalk/n2k-signalk/n2kMapper.js:25:18)
    at new ToSignalK (/usr/lib/node_modules/signalk-server/node_modules/@signalk/streams/n2k-signalk.js:38:20)
    at new Splitter (/usr/lib/node_modules/signalk-server/node_modules/@signalk/streams/autodetect.js:75:22)
    at new DeMultiplexer (/usr/lib/node_modules/signalk-server/node_modules/@signalk/streams/autodetect.js:55:19)
    at Object.Multiplexed (/usr/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:223:30)
    at new Simple (/usr/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:84:33)
    at createPipeElement (/usr/lib/node_modules/signalk-server/lib/pipedproviders.js:75:16)
    at /usr/lib/node_modules/signalk-server/lib/pipedproviders.js:48:30
    at Array.reduce (<anonymous>)

Node.js v18.16.0
xbgmsharp commented 1 year ago

I probably miss something, how can we replay a signalk raw server log? Using the latest signalk-server version, the problem still persist.

tkurki commented 1 year ago

You need to configure your server with a File Stream data connection with file type Multiplexed Log and filename. If a relative file path does not work try with absolute.

I just noticed a problem with the playback though - it does not work if the first line of the file is data from a plugin - the file type detection fails if the second semicolon-delimited field of the line is not a single character.

Let me know how it goes.

xbgmsharp commented 1 year ago

Thanks for the feedback. I can now replay a SK log file using a new Multiplexed Log connection. I was expecting to be automated using log2sk. As temporally workaround, I removed the first 2 column of the SK raw log file to get a valid NMEA file.

tkurki commented 1 year ago

Yep, that works for 0183 data, but you lose the timestamps and the ability to play back in original rate.