This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New user, some questions...
#1
Hello,

So, until now, I have OPv1.2 running on RPi.
I have one bidirectional NMEA0183 for a Garmin Echomap, 38400bps, which provide GPS signal to SK (kplex) and expect some other signals for water depth, air temperature, air pressure and so on, from various sensors managed by SK.
I also have a secondary output NMEA0183 which have to send GPS and related data (which is coming from Garmin) to an Icom VHF, 4800bps. The required data is passing just as expected, no problems.
I also have two I2C temperature sensors, one for environment.water.temperature and the second one for environment.outside.temperature

Using signalk-to-nmea0183 plugin i can send the environment.water.pressure to kplex and then to the Garmin output by checking the MTW sentence. 
The problem is the Garmin recognize only MDA (for air temperature) sentence which is missing from signalk-to-nmea0183 plugin. 
I tried to use MTA and XDR(TempAir) sentences but these sentences are not recognized.
There are any reasons not to have this kind of sentences in signalk-to-nmea0183 plugin? 
Also, if MDA can be added into signalk-to-nmea0183 plugin, can I have some hints how to do this?
I think I have to make a new MDA.js file but for now I donlt have enough knowledge and I don't want to mess something around... Smile

I also have to specify I encounter a strange problem, at least I think is a problem...
In kplex i have the default "system UDP input, port 10110" but no data it's coming. As far as I know I think I should have there the data from signalk (data from I2C sensors). 
To solve this "issue" I had to add another network (I named it "sk") in kplex, "TCP, input, localhost, port 10110" with filter for passing only the required data (**DBT,**MTA,**MTW,**XDR,**MDA).
Also, I had to set the "signalk TCP out port 30330" not to send back the data from this "sk" network back to signalk (*****%sk)

It seems to be working but I still think I should have it all these signalk data in the "system UDP input, port 10110"
I also checked with external clients and I have all data on RPi's IP_address 192.168.1.91:10110
Only kplex does not have it on the default "system UDP input, port 10110" network. 
Is it normal?

Thank you for your time and sorry for my long post,
Seb


Attached Files Image(s)
   
- SV Haimana
Reply
#2
Hello again

I made 2 files, MDAair.js and MDAwater.js, placed in /usr/lib/node_modules/signalk-server/node_modules/@signalk/signalk-to-nmea0183/sentences folder

the MDAair.js is sending the environment.outside.temperature and the MDAwater.js is sending the environment.water.temperature

MDAair.js file I made look like this:

Code:
// NMEA0183 Encoder $IIMDA,29.95,I,1.01,B,19.8,C,17.0,C,68.0,,16.7,C,,,,,,,,*3F
const nmea = require('../nmea.js')
module.exports = function (app) {
 return {
   title: 'MDA - Outside Air Temperature - by sebba',
   keys: ['environment.outside.temperature'],
   f: function (temperature) {
     var celcius = (temperature) - 273.15
     return nmea.toSentence([
       '$IIMDA',
       ,
       'I',
       ,
       'B',
       celcius.toFixed(2),
       'C'
     ])
   }
 }
}

and MDAwater.js looks like this:
Code:
// NMEA0183 Encoder $IIMDA,29.95,I,1.01,B,19.8,C,17.0,C,68.0,,16.7,C,,,,,,,,*3F
const nmea = require('../nmea.js')
module.exports = function (app) {
 return {
   title: 'MDA - Water Temperature - by sebba',
   keys: ['environment.water.temperature'],
   f: function (temperature) {
     var celcius = (temperature) - 273.15
     return nmea.toSentence([
       '$IIMDA',
       ,
       'I',
       ,
       'B',
       ,
       'C',
       celcius.toFixed(2),
       'C'
     ])
   }
 }
}

It seems to be working... but I'm not still sure if this is the best way to do it.
I had to have 2 different files because I don't know how to add different temperature sources in the same sentence
I also so similar approach for relative/true wind sentences so I hope is OK.
I'll try to add the barometric data also.

Can I have some feedback, to know if this is the right way to work with this?

Thanks,
Seb
- SV Haimana
Reply
#3
You might find node-red is a bit easier, available as a signalk app in the app store.
This is for random wind direction, outputs UDP over port 10112 so you need to create a server connection for nmea0183/UDP port 10112 >

Code:
[{"id":"bf02070e.166bf8","type":"inject","z":"f792bbef.555918","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":340,"wires":[["c66ee625.6bcd28"]]},{"id":"c66ee625.6bcd28","type":"random","z":"f792bbef.555918","name":"","low":"1","high":"10","inte":"true","property":"payload","x":120,"y":400,"wires":[["4f4e9fcd.f86bb"]]},{"id":"4f4e9fcd.f86bb","type":"function","z":"f792bbef.555918","name":"RandomWindDirection","func":"// msg.payload = \"$WIMWV,270.0,R,15.0,N,A*36\\r\\n\";\nvar temp = msg.payload * 36;\n// $ERRPM,E,1,2000,,,,*2\n\nmsg.temp = \"WIMWV,\" + temp + \",R,15.0,N,A\";\n\nvar nmea = msg.temp;\nvar checksum = 0; \n\nfor(var i = 0; i < nmea.length; i++) { \n  checksum = checksum ^ nmea.charCodeAt(i); \n}\nchecksum = checksum.toString(16);    //convert to hex\nnmea = '$' + nmea + '*' + checksum;  //make the full nmea sentence again\n\nmessage =  nmea + '\\r\\n';\n\n\nmsg.payload  = message;\nreturn msg;\n\n","outputs":1,"noerr":0,"x":300,"y":400,"wires":[["9749b954.a12318","8a03fcb3.c1274"]]},{"id":"9749b954.a12318","type":"debug","z":"f792bbef.555918","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":370,"y":340,"wires":[]},{"id":"8a03fcb3.c1274","type":"udp out","z":"f792bbef.555918","name":"","addr":"127.0.0.1","iface":"","port":"10112","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":540,"y":400,"wires":[]}]

Copy then in the node-red editor press ctrl & i to insert. 

Or the SKSIm app is very good for testing.
Reply
#4
Thanks for your input, i'll give a try ASAP, I have to familiarize with node-red first...
For now, my .js sentences files seems to do the job as required, even I have to make more files for different data (pressure, watertemp, airtemp and so on...)

Also, i still have that question about the kplex default "system UDP input, port 10110" which does not show data. Is it normal?
- SV Haimana
Reply
#5
(2020-01-25, 03:41 PM)sebba Wrote: Thanks for your input, i'll give a try ASAP, I have to familiarize with node-red first...
For now, my .js sentences files seems to do the job as required, even I have to make more files for different data (pressure, watertemp, airtemp and so on...)

Also, i still have that question about the kplex default "system UDP input, port 10110" which does not show data. Is it normal?

Sorry, can't help with Kplex, I think most people are now on OP V2, signalk does the multiplexing. Might be worth thinking of switching over to V2.
Reply
#6
Thanks, no problem, I'll try to figure out somehow...

I tried to do multiplexing in signalk (OPv2) but I was not able to have a proper in/out management for serial connections (NMEA0183)
I (will) need more bidirectional USB/NMEA connections with different speeds and proper filtering and I was unable to obtain this in signalk without kplex (OPv2). Maybe I still have to dig to find proper documentation for that.
This is the reason I'm working with v1.2

Best regards,
Seb
- SV Haimana
Reply
#7
(2020-01-25, 05:49 PM)sebba Wrote: Thanks, no problem, I'll try to figure out somehow...

I tried to do multiplexing in signalk (OPv2) but I was not able to have a proper in/out management for serial connections (NMEA0183)
I (will) need more bidirectional USB/NMEA connections with different speeds and proper filtering and I was unable to obtain this in signalk without kplex (OPv2). Maybe I still have to dig to find proper documentation for that.
This is the reason I'm working with v1.2

Best regards,
Seb

Serial can be done in openplotter serial app or just straight into signalk (server|connections)
As many as you want Smile
Though I haven't tried outputting serial yet.

[Image: dvgaVbu.png]
Reply
#8
Thank you very much for your help

In OPv2 SK Inputs are not a problem, everything is clear but i cannot find a proper documentation for filtering and output or bidirectional connections in signalk, something like I can do in OP v1.2/kplex.
Also, the SK nmea0183-to-nmea0183 plugin does not work for me, each time I want to enable it returns the errors described here: https://github.com/vokkim/nmea0183-to-nmea0183/issues/2

Regards,
Seb
- SV Haimana
Reply
#9
What is it you want to send? - To where & from where?
Might be node -red makes the most sense but hard to say much without knowing a bit more about what it is you're trying to do. Smile
Reply
#10
I don't have a diagram yet, I started just with the devices what I already have it and I intend to connect other device into the future (like AIS transponder and maybe more)
For now, I need to have the following:

1. Bidirectional NMEA0183/38400bps for Garmin Echomap chartplotter which will provide GPS and active route data for Raymarine Type 150 autopilot course computer and Icom VHF with DSC (and, of course what other devices will need this data).
Same Garmin will need sentences from various sources like: Raymarine AP course computer, DSC sentences from VHF, generic navigation data like depth, water temperature, outside air temperature and so on from Raymarine sensors (from a Seatalk-to-NMEA adapter) and also, into the future, the AIS data from the AIS transponder (I think will be through NMEA2000, not yet operational)

2. Output NMEA0183/4800bps for Icom VHF. Have to provide the GPS sentences from Garmin. Filter for allow only needed sentences for Icom is required.
I'm not sure yet, but I think the VHF should be able to provide DSC related data to Garmin, so, in this case, this connection should be bidirectional, too.

3. Bidirectional NMEA0183/4800bps for Raymarine AP course computer. It should output data from Garmin chartplotter and provide data back to Garmin (for running AP in Track mode) and other additional data like heading.

As far as I understand OP/SK/kplex, proper filtering rules of sentences is mandatory. And also settings for serial connections (in/out/both, like kplex do).
Maybe there are other ways to do that but, for now, this is how I had some success, using kplex/SK under OP v1.2 Smile

I will try to take a look at node-red also, if you say will help with this.

Thank you.
Seb
- SV Haimana
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)