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
Connecting NMEA Wind data from NASA Clipper
#63
(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 Cool
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?
Reply


Messages In This Thread
RE: Connecting NMEA Wind data from NASA Clipper - by Smartell - 2018-06-22, 04:50 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)