Posts: 51
Threads: 4
Joined: Jul 2017
Reputation:
0
2018-06-21, 11:00 PM
(This post was last modified: 2018-06-22, 08:15 AM by Smartell.)
I have a Freeboard somewhere and that has nmea seatalk conversion using an arduino so the code exists (never tried it though). I think that rob42 on github knows more.
/M
Posts: 1,169
Threads: 98
Joined: Mar 2016
Reputation:
69
2018-06-22, 12:33 PM
(This post was last modified: 2018-06-22, 12:36 PM by PaddyB.)
Just a quick one sort of relavent - I've just got an esp sending data from a nasa compass straight to signalk using the tinygps++ library , software serial and and EspSigk with a rs232/ttl adaptor powered from the esp 3.3v pin - I'll leave it on all day to see if it breaks
With HDG selected in the conver to NMEA plugin the data shows up in Opecnn dashboard and gets automatically entered into the logbook.
Turned off the security to allow the data in , but think Sbender is going to sort this -
https://signalk-dev.slack.com/archives/C...1013000074
rough and ready code >
Code: #include <TinyGPS++.h>
#include "EspSigK.h"
#include <SoftwareSerial.h>
#define BAUD_RATE 115200
#define BAUD_RATE2 4800
SoftwareSerial ss(5, 12, false, 256);
const String hostname = "openplotter"; //Hostname for network discovery
const String ssid = "openplotter"; //SSID to connect to
const String ssidPass = "12345678"; // Password for wifi
EspSigK sigK(hostname, ssid, ssidPass); // create the object
// The TinyGPS++ object
TinyGPSPlus nasa;
TinyGPSCustom mag(nasa, "HCHDG", 1); // $GPGSA sentence, 15th element
void setup() {
Serial.begin(115200);
ss.begin(4800);
sigK.setPrintDebugSerial(true); // default false, causes debug messages to be printed to Serial (connecting etc)
sigK.setPrintDeltaSerial(true); // default false, prints deltas to Serial.
//sigK.setServerHost("10.10.10.1"); // Optional. Sets the ip of the SignalKServer to connect to. If not set we try to discover server with mDNS
//sigK.setServerPort(80); // If manually setting host, this sets the port for the signalK Server (default 80);
sigK.begin(); // Start everything. Connect to wifi, setup services, etc...
}
void loop() {
while (ss.available() > 0){
nasa.encode(ss.read());
}
//Two ways to send deltas, you can do this to send multiple values in the same value.
float randNumber1 = atof(mag.value() );
randNumber1 = randNumber1 * 3.14/180;
sigK.addDeltaValue("navigation.headingMagnetic",randNumber1 );
sigK.sendDelta();
//Or send a single value
//sigK.sendDelta("some.signalk.path2", 3.413);
//try and use this delay function instead of built-in delay()
//this function will continue handling connections etc instead of blocking
sigK.safeDelay(1000);
//if you don't use delays (or the delay function above) call this one every
//loop in order to handle http/websocket connections etc...
//sigK.handle();
}
Posts: 51
Threads: 4
Joined: Jul 2017
Reputation:
0
(2018-06-22, 12:33 PM)PaddyB Wrote: Just a quick one sort of relavent - I've just got an esp sending data from a nasa compass straight to signalk using the tinygps++ library , software serial and and EspSigk with a rs232/ttl adaptor powered from the esp 3.3v pin - I'll leave it on all day to see if it breaks
With HDG selected in the conver to NMEA plugin the data shows up in Opecnn dashboard and gets automatically entered into the logbook.
Turned off the security to allow the data in , but think Sbender is going to sort this -
https://signalk-dev.slack.com/archives/C...1013000074
rough and ready code >
Code: #include <TinyGPS++.h>
#include "EspSigK.h"
#include <SoftwareSerial.h>
#define BAUD_RATE 115200
#define BAUD_RATE2 4800
SoftwareSerial ss(5, 12, false, 256);
const String hostname = "openplotter"; //Hostname for network discovery
const String ssid = "openplotter"; //SSID to connect to
const String ssidPass = "12345678"; // Password for wifi
EspSigK sigK(hostname, ssid, ssidPass); // create the object
// The TinyGPS++ object
TinyGPSPlus nasa;
TinyGPSCustom mag(nasa, "HCHDG", 1); // $GPGSA sentence, 15th element
void setup() {
Serial.begin(115200);
ss.begin(4800);
sigK.setPrintDebugSerial(true); // default false, causes debug messages to be printed to Serial (connecting etc)
sigK.setPrintDeltaSerial(true); // default false, prints deltas to Serial.
//sigK.setServerHost("10.10.10.1"); // Optional. Sets the ip of the SignalKServer to connect to. If not set we try to discover server with mDNS
//sigK.setServerPort(80); // If manually setting host, this sets the port for the signalK Server (default 80);
sigK.begin(); // Start everything. Connect to wifi, setup services, etc...
}
void loop() {
while (ss.available() > 0){
nasa.encode(ss.read());
}
//Two ways to send deltas, you can do this to send multiple values in the same value.
float randNumber1 = atof(mag.value() );
randNumber1 = randNumber1 * 3.14/180;
sigK.addDeltaValue("navigation.headingMagnetic",randNumber1 );
sigK.sendDelta();
//Or send a single value
//sigK.sendDelta("some.signalk.path2", 3.413);
//try and use this delay function instead of built-in delay()
//this function will continue handling connections etc instead of blocking
sigK.safeDelay(1000);
//if you don't use delays (or the delay function above) call this one every
//loop in order to handle http/websocket connections etc...
//sigK.handle();
}
Doing this wireless? ...wireless Nmea?
Posts: 1,169
Threads: 98
Joined: Mar 2016
Reputation:
69
(2018-06-22, 04:50 PM)Smartell Wrote: Doing this wireless? ...wireless Nmea?
Taking the NMEA data from a nasa compass and sending it to openplotter as Signalk.
Posts: 2,836
Threads: 60
Joined: Mar 2016
Reputation:
267
I guess this post is relevant for this.
https://groups.google.com/forum/#!topic/...LN2K52LN5M
There are 2 solutions on for kplex and one for signal k
Posts: 51
Threads: 4
Joined: Jul 2017
Reputation:
0
(2018-06-26, 06:14 PM)Sailoog Wrote: I guess this post is relevant for this.
https://groups.google.com/forum/#!topic/...LN2K52LN5M
There are 2 solutions on for kplex and one for signal k
Hi,
Yes, i posted my question also in that group and it seems people are helpful there too. I will test it on my setup this weekend.
Appreciate your support!
/Micael
Posts: 51
Threads: 4
Joined: Jul 2017
Reputation:
0
Now i have the NASA mast unit feeds working also without the Node Red setup. I checked the answers to my post generated in the Kplex Google group (any nudging there Paddy?) and i tried adding strict=0 in my config file and it worked like a charm (after some cleaning up after earlier efforts)
I have been bitten by Node Red though and will probably fiddle around a lot with that - incredibly powerful!
So...SeaTalk, modifying SailGauge w larger numbers so i can read it, moving everything into a seaworhy box...and i am done.
Well, not done, i guess you will never be done with something like this..."i will be back"
Thanks!
Posts: 800
Threads: 46
Joined: Jun 2017
Reputation:
25
"i tried adding strict=0 in my config file"
where is the config file located?
Posts: 51
Threads: 4
Joined: Jul 2017
Reputation:
0
(2018-06-30, 04:24 PM)jim321 Wrote: "i tried adding strict=0 in my config file"
where is the config file located?
Click on the "Advanced" tab above and then you will see the definition blocks in the config file. add strict=no somewhere in- the serial input you have defined for your device
/M
Posts: 800
Threads: 46
Joined: Jun 2017
Reputation:
25
Thanks
in v.1.0.X its Kplex tab. that screen shot must be v.0.1.X
i put it at the end..
|