Coder Social home page Coder Social logo

Comments (21)

tkurki avatar tkurki commented on August 21, 2024

Add the adapted file as an attachment here and let's see?

And please provide some background about the sentences and the equipment that is producing the data. And some example input data would be great.

from nmea0183-signalk.

cedschmidt-lab avatar cedschmidt-lab commented on August 21, 2024

Hi tkurki,
The new sentences are defined as:

$PPSMF",int, float, float, float, float, float, float
float, float, float, boolean, boolean, float, float* Cheksum
Example of built sentence:
$PPSMF,1,0.8,0.0,-0.2,5.9,0,0,1.3,1.6,1,0,1.3,1.3*6A

and

$INDYN,float,float,float,float,float,float,float,float,float,float* Cheksum
Example of built sentence:
$INDYN,47.76573414,-3.35083872,0.2,128.0,5.700,-1.700,0.000,1.000,0.000,0.000*69

I can push the addapted file later when I'm back home. They come from a SBG Imu system and I would like to be able to use them in a node-red flow.

I really want to learn and do the job myself but I'm stuck in what to do with the new DYN.js and SMF.js files.

Many thanks,

from nmea0183-signalk.

joabakk avatar joabakk commented on August 21, 2024

Hi @cedschmidt-lab ,

This looks to be a proprietary sentence, so it could be of value for others as well. If you installed the server globally with npm, you should be able to find the relevant file under something like /Users/joachim/.nvm/versions/node/v10.19.0/lib/node_modules/signalk-server/node_modules/@signalk. This is my path (with nvm), but you can try to search for nmea0183-signalk. The correct placement in this repo would be signalk-parser-nmea0183/hooks/proprietary/

from nmea0183-signalk.

tkurki avatar tkurki commented on August 21, 2024

Once you put the XXX.js file into the hooks directory you need to add it to https://github.com/SignalK/signalk-parser-nmea0183/blob/master/hooks/index.js

from nmea0183-signalk.

cedschmidt-lab avatar cedschmidt-lab commented on August 21, 2024

Hi guys,

Thanks for your help. I attach the file version I am now trying to implement. Hopefully I can debug this week-end and keep you updated.
BGB.txt
Best

from nmea0183-signalk.

tkurki avatar tkurki commented on August 21, 2024

Is this issue still ongoing?

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Hi,
I have a problem with a the implementation of a new sentences. I no understand the using of JS sample code. I created a new sentence definition as SWF.js and added this in the hooks folder. After them I added the sentence name in index.js. When I restart the SignalK server nothing is imported. Here my code:

SWF.js

'use strict'

 const utils = require('@signalk/nmea0183-utilities')

 /*
  * SWF - Sea Water Flow cooling system
  *
  *        0  1  2  3
  *        |  |  |  |
  * $--SWF,L,0,x.0,A*hh<CR><LF>
  *
  * Field Number:
  *   0.    Unit in liters
  *   1.    Engine ID
  *   2.    Flow value
  *   3.    Checksum
  *
  */

module.exports = function (input) {
  const { id, sentence, parts, tags } = input

  const delta = {
    updates: [
      {
        source: tags.source,
        timestamp: tags.timestamp,
        values: [
          {
            path: 'sensors.engine_${parts[1]}.SeaWaterFlow',
            value: utils.float(parts[2])
          }
        ]
      }
    ],
  }

  return delta
}

from nmea0183-signalk.

tkurki avatar tkurki commented on August 21, 2024

The code looks good to me. Where in the filesystem did you make the changes?

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Hi Teppo, I made the changes in the folder hooks:

/usr/lib/node_modules/signalk-server/node_modules/@signalk/nmea0183-signalk/hooks

and as a test also in:

/usr/lib/node_modules/signalk-server/node_modules/@signalk/nmea0183-signalk/hooks/propritary

Both is not working. I need a special file type or end character of file? Is it possible to logging the NMEA0183 parser?

And this is my sentence: $PESWF,L,0,0.0,A*44
Or I need the full name of sentence for parsing (PESWF)?

Norbert

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Problem is solved. I need the full name of sentence for filename by custom sentence otherwise can the parser not parsing. With filename PESWF.js it is working.

Thanks for you support.

Question: Can I add any custom sentences from open-boat-projects.org in your repository? We made self any NMEA0183 devices.

Norbert

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Other question: How can I define a unit for custom sentences? I need liters per hour and temperature. Is it possible to define any unit?

from nmea0183-signalk.

tkurki avatar tkurki commented on August 21, 2024

DId I understand you correctly that you've defined several custom NMEA0183 sentences and you'd like to add support for them? Interesting. Can you provide a list of what you have?

In general Signal K paths don't start with sensor - the path describes what the data is, not that it came from a sensor. Source information is for linking the data update to a certain sensor. To be more in line with the SK Specification I suggest something like propulsion.<id>.coolingWater.rate - I'm thinking about having also inTemperature and .outTemperature there.

https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#how-to-add-missing-units-and-static-data

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

I made self several devices:
https://open-boat-projects.org/en/diy-windsensor/
https://open-boat-projects.org/en/diy-motordiagnose/
https://open-boat-projects.org/en/diy-vordeckkamera/
https://open-boat-projects.org/en/i2c-module-zur-bootsautomation/

Here any other devices from other hobbyists:
https://open-boat-projects.org/en/diy-ultraschall-fuellstandsmessung/
https://open-boat-projects.org/en/diy-kielsensor/

For some devices we still have to do NMEA0183 implementations. Ok, I see the SK Specification. I change the paths unison to the specification. I would create new directories for the respective devices under proprietary.

I tray to add under meta a description an a unit. But it was not working. I colt not see the informations in the data browser.

from nmea0183-signalk.

tkurki avatar tkurki commented on August 21, 2024

No need to mark something as "propietary". There are paths that are in the specification and paths not in the specification, that's it. Then we can add them to the specification over time and things like units & name & description will be there out of the box.

Have you considered sending data as Signal K over UDP broadcast? Then all you'd need to configure on the server is a single incoming UDP Signal K connection. This way you'd not need to add anything to the nmea0183 parser when you add something new. The server can convert to NMEA0183 as needed.

from nmea0183-signalk.

joabakk avatar joabakk commented on August 21, 2024

I would like to add that proprietary are official sentences from nmea 0183 spec. the sentences starting with $P are made by members of the nmea. Although the probability is small, there may be conflicts with existing undocumented sentences.
If you do need to make your own sentences as nmea, you could also consider XDE.

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

I mean with proprietary that I create new folder under proprietary for new devices. I know the UDP broadcast. I'm not a friend from UDP broadcast because all receiver must decode the messages and only for one receiver is the massage. We would like to implement also a function for direct sending to SignalK. We have than two possibilities to send the data.

$P... is defined for proprietary custom sentences. I see no problem with the implementation. The most commercial devices using the fix defined sentences. XDE is not my favorite because the definition is to complex and the correct parsing is to complicate. Normally define the name XDE the type of data and the data structure is fix. By XDE is the structure from each sentence different and the content defined the data type. That makes very complicate to decode.

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

I have a problem with the unit definition in a parsing script. I use this:

module.exports = function (input) {
  const { id, sentence, parts, tags } = input

  const inValue = utils.float(parts[2])
  const checkValue = function(inputValue){
      return inputValue === -127 ? '-' : inputValue
    }

  const delta = {
    updates: [
      {
        source: tags.source,
        timestamp: tags.timestamp,
        values: [
          {
            path: 'propulsion.engine_' + parts[1] + '.SeaWaterTemp',
            value: utils.transform(checkValue(inValue), 'C', 'K', 'F'),
            meta: {
              description: '1Wire Sea water temperature in [°C]',
              units: 'C'
            }
          }
        ]
      }
    ],
  }

  return delta
}

and I missing the description and the unit in the data browser. What is wrong?

from nmea0183-signalk.

sbender9 avatar sbender9 commented on August 21, 2024

Check out meta deltas here: https://github.com/SignalK/specification/blob/meta-deltas/gitbook-docs/data_model.md

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Thanks, I see the differences.

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

I'm not sure. Is this the correct implementation? I need to declare the meta date for missing units.

module.exports = function (input) {
  const { id, sentence, parts, tags } = input

  const delta = {
    updates: [
      {
        source: tags.source,
        timestamp: tags.timestamp,
        meta: [
          {
            path: 'propulsion.engine_' + parts[1] + '.CoolingWaterFlow',
            value: {
              description: 'Cooling water flow in [l/min]',
              units: 'l/min'
             }
          }
        ],   
        values: [
          {
            path: 'propulsion.engine_' + parts[1] + '.CoolingWaterFlow',
            value: utils.float(parts[2])
          }
        ]
      }
    ],
  }

  return delta
}

from nmea0183-signalk.

norbert-walter avatar norbert-walter commented on August 21, 2024

Is solved. The declaration is now correct. Thaks

from nmea0183-signalk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.