 |
|
07-01-2016, 16:52
|
#1
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
MWV sentences not working in dashboard
I have a Nasa NMEA wind sensor - Accessories: NASA Marine Instruments
Connected to opencpn I can see these sentences coming in the nmea debug window.
Code:
$WIMWV,27,R,00,N,A*0C
$YXXDR,C,22,C*49
$WIMWV,27,R,00,N,A*0C
$YXXDR,C,22,C*49
$WIMWV,27,R,00,N,A*0C
$YXXDR,C,22,C*49
In the dashboard, however, I can't get anything showing with any of the apparent wind or true wind instruments.
I must be doing something wrong, or is the data badly formatted?
Any ideas? VDR file attached
nasa_sensor.txt.pdf
TIA
|
|
|
07-01-2016, 17:43
|
#2
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Think I *might* have found the issue - google came up with some example MWV sentences which worked when played back through the VDR ..
$WIMWV,200.0,R,11.0,N,A*11
Almost the same but the degrees and windspeed are to 1 decimal place.
The nasa is just integers without the trailing ".0"
That's annoying, but not the end of the world as it will be going through an arduino anyway which should be able to add those in on the way.
|
|
|
08-01-2016, 00:36
|
#3
|
|
Registered User
Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,731
|
Re: MWV sentences not working in dashboard
conachair..
Very good. Many thanks for sharing the info about the Nasa wind sensor. I've that one on my list for a possible replacement. The prize is not bad. Now I know what to do if I go for that one.
Håkan
|
|
|
08-01-2016, 01:55
|
#4
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
If anyone knows an easy way to add ".0" to the data I'm all ears
First thoughts are to take the sentences apart with the arduino tinygps++ custom object then sticking them together again after adding the ".0" where required.
Assuming that is the problem....
TIA
|
|
|
08-01-2016, 02:17
|
#5
|
|
Marine Service Provider
Join Date: May 2013
Location: Norway
Posts: 724
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by conachair
If anyone knows an easy way to add ".0" to the data I'm all ears
First thoughts are to take the sentences apart with the arduino tinygps++ custom object then sticking them together again after adding the ".0" where required.
Assuming that is the problem....
TIA
|
Maybe the NMEA converter plugin will do the job ??
Plugins for OpenCPN 4.1 | Official OpenCPN Homepage
|
|
|
08-01-2016, 04:07
|
#6
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by petter5
|
Thanks, I hadn't thought of that one.
Close, it works "statically", if I use the repeat each second option with a fixed "old" sentence, the NMEA converter adds the extra ".0"'s automatically but doesn't seem to want to make a new MWV sentence from itself.
|
|
|
08-01-2016, 05:20
|
#7
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Update - the data coming out of the nasa unit seems to have the wrong checksums. The decimal point was a red herring.
$WIMWV,27,R,00,N,A*0C should be...
$WIMWV,27,R,00,N,A*26
So looks like it definitely needs some processing before being useful.
|
|
|
08-01-2016, 06:03
|
#8
|
|
Registered User
Join Date: Jun 2015
Posts: 379
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by conachair
If anyone knows an easy way to add ".0" to the data I'm all ears
First thoughts are to take the sentences apart with the arduino tinygps++ custom object then sticking them together again after adding the ".0" where required.
Assuming that is the problem....
TIA
|
Too bad It's not the problem. How old is your instrument (still under warranty)? It's a known issue with some nasa Clipper Wind Sytem, at least since 2007.
Your instrument is computing the checksum with the '*' included and it's wrong...
For example replace
$WIMWV,32,R,00,N,A*08
with
$WIMWV,32,R,00,N,A*22
and it works, 22 is 8 XOR '*' in hexa
BTW there's no wind speed in your capture, is it normal?
options setting 'Control Checksum' doesn't help, dashboard plugin always computes and uses checksum.
|
|
|
08-01-2016, 07:06
|
#9
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by did-g
Too bad It's not the problem. How old is your instrument (still under warranty)? It's a known issue with some nasa Clipper Wind Sytem, at least since 2007.
|
Good few years old now, and in fairness is designed to work with their own display. I've a soft spot for nasa but they are cheap and cheerful so can't really complain much.
Quote:
Your instrument is computing the checksum with the '*' included and it's wrong...
For example replace
$WIMWV,32,R,00,N,A*08
with
$WIMWV,32,R,00,N,A*22
and it works, 22 is 8 XOR '*' in hexa
|
Well spotted!!!
Quote:
|
BTW there's no wind speed in your capture, is it normal?
|
Is when the sensor is sitting on the chart table, but definitely not outside
Quote:
|
options setting 'Control Checksum' doesn't help, dashboard plugin always computes and uses checksum.
|
Ah, I had a quick play with that and wondered why it wouldn't work turned off, thanks.
I wrote a quick arduino sketch with the correct checksum and all seems well with the dashboard when reading that data, so end of the day no great drama, the feed would go though an arduino anyway after the display so a few lines of code should make it well behaved again.
Quote:
/*
This example code is in the public domain.
*/
String NMEA0Deg="WIMWV,0,R,00,N,A";
String NMEA90Deg="WIMWV,90,R,05,N,A";
String NMEA180Deg="WIMWV,180,R,10,N,A";
String NMEA270Deg="WIMWV,270,R,15,N,A";
int CheckSum;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(4800);
}
// the loop routine runs over and over again forever:
void loop() {
CheckSum=checkSum(NMEA0Deg);
String NMEA0DegOut="$" + NMEA0Deg + "*" + String(CheckSum, HEX);
Serial.println(NMEA0DegOut);
delay(1000);
CheckSum=checkSum(NMEA90Deg);
String NMEA90DegOut="$" + NMEA90Deg + "*" + String(CheckSum, HEX);
Serial.println(NMEA90DegOut);
delay(1000);
CheckSum=checkSum(NMEA180Deg);
String NMEA180DegOut="$" + NMEA180Deg + "*" + String(CheckSum, HEX);
Serial.println(NMEA180DegOut);
delay(1000);
CheckSum=checkSum(NMEA270Deg);
String NMEA270DegOut="$" + NMEA270Deg + "*" + String(CheckSum, HEX);
Serial.println(NMEA270DegOut);
delay(1000);
}
//-----------------
char checkSum(String theseChars) {
char check = 0;
// iterate over the string, XOR each byte with the total sum:
for (int c = 0; c < theseChars.length(); c++) {
check = char(check ^ theseChars.charAt(c));
}
// return the result
return check;
}
|
|
|
|
09-12-2017, 22:39
|
#10
|
|
Registered User
Join Date: Dec 2017
Posts: 1
|
Re: MWV sentences not working in dashboard
Hi, got a similar problem trying to feed an NMEA WMV from an Arduino into a NASA Meteoman. It was just not responding. I was trying to emulate the NASA wind sensor output (3wire) to see if the problem was in the Meteoman before climbing the mast.
In the end I found out I had to 'invert' the TX signal to get it to work.
Now I have to climb the mast and find why the wind sensor is not working.
//**************************************************
#include <SoftwareSerial.h> CR = 13 LF = 10
SoftwareSerial altSerial(8, 9, 1); // RX=8, TX=9, Invert=YES
// ***************
String sensordata1 ="$WIMWV,316,R,6.8,N,A*37";
String sensordata2 ="$YXXDR,C,26,C*4D";
String sensordata3 ="$WIMWV,247,R,14.1,N,A*08";
String sensordata4 ="$YXXDR,C,26,C*4D";
String sensordata5 ="$WIMWV,250,R,20.9,N,A*01";
String sensordata6 ="$YXXDR,C,26,C*4D";
String sensordata7 ="$WIMWV,282,R,24.7,N,A*04";
String sensordata8 ="$YXXDR,C,26,C*4D";
String sensordata9 ="$WIMWV,321,R,26.3,N,A*0A";
String sensordata10 ="$YXXDR,C,26,C*4D";
/* =============================================*/
void setup() {
/* ============================================ */
altSerial.begin(4800);
delay(1000);
while (!altSerial) {
; // wait for serial port to connect. Needed for native USB port only
}
}
/* ============================================ */
void loop(){
/* ============================================ */
while (altSerial.available() <= 0)
{
altSerial.println(sensordata1);
altSerial.println(sensordata2);
altSerial.println(sensordata3);
altSerial.println(sensordata4);
altSerial.println(sensordata5);
altSerial.println(sensordata6);
altSerial.println(sensordata7);
altSerial.println(sensordata8);
altSerial.println(sensordata9);
altSerial.println(sensordata10);
}
}
|
|
|
10-12-2017, 02:00
|
#11
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by mwau032
In the end I found out I had to 'invert' the TX signal to get it to work
|
That's because the arduino serial works on TTL which is different to rs232 NMEA 0183 which the nasa works on, there are other differences but inverted logic is one.
Better off with a rs232/ttl adaptor from eBay which will look after voltage differences as well.
Same listening to the NASA sensor, the voltages it uses might not work with the arduino software serial library straight onto a pin, might even blow the pin if you are unlucky.
Also, I have an older nasa wind sensor which sends the wrong nmea checksum, it works going into the meteoman but some other kit might not be so forgiving. I have a bit of arduino code somewhere to replace the checksum with a correct one , I'll post later if I can find it.(edit - found it, it's 2 posts up  )
|
|
|
15-12-2017, 04:51
|
#12
|
|
Registered User
Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 18,478
|
Re: MWV sentences not working in dashboard
Conachair:
Update - the data coming out of the nasa unit seems to have the wrong checksums. The decimal point was a red herring.
You took the $ and checksum *26 off when you calculated the checksum?
Bdcat recently reminded me of this!
Nmeaconverter should work.
|
|
|
15-12-2017, 06:19
|
#13
|
|
cruiser
Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
|
Re: MWV sentences not working in dashboard
Quote:
Originally Posted by rgleason
You took the $ and checksum *26 off when you calculated the checksum?
Bdcat recently reminded me of this!
Nmeaconverter should work.
|
Yep, checksum is correct coming out, assuming that's the right code I found stashed away in dropbox, looks OK.
Code:
// replace a wrong nmea checksum with a good one.
String nmeaGood;
String nmeaBad;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 4800 bits per second:
//serial1 is available on the mega board
Serial.begin(4800);
Serial1.begin(4800);
}
// the loop routine runs over and over again forever:
void loop() {
if(Serial1.available())
{
char c= Serial1.read();
if( c=='\n') // if char is new line then it's the end of a sentence so do something
{
nmeaBad=nmeaBad + '\n'; // put back the missing linefeed before parsing
parseNmea(nmeaBad);
nmeaBad=""; // empty the string
}
else // else fill up the straing with nmea sentence
nmeaBad+=c;
}
//End of loop
}
//-----------------
void parseNmea(String nmeaBad)
{
//Serial.print(nmeaBad);
nmeaGood=nmeaBad.substring(1, nmeaBad.indexOf("*")); //cut of the leading "$" and the bad checksum
int CheckSum=(checkSum(nmeaGood)); //create a good checksum
nmeaGood="$"+nmeaGood+ "*" + String(CheckSum, HEX); // make the good nmea string
Serial.println(nmeaGood);
}
//---
char checkSum(String theseChars) {
char check = 0;
// iterate over the string, XOR each byte with the total sum:
for (int c = 0; c < theseChars.length(); c++) {
check = char(check ^ theseChars.charAt(c));
}
// return the result
return check;
}
|
|
|
16-12-2017, 12:21
|
#14
|
|
Registered User
Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 18,478
|
Re: MWV sentences not working in dashboard
That's a nice piece of code. I suppose if nmeaconverter had the ability to calculate checksums and correct them, some expert users would advise that that is a very bad thing to do. The entire reason the checksum is there, is to get bad data kicked out.
|
|
|
11-09-2019, 04:57
|
#15
|
|
Registered User
Join Date: Jun 2018
Location: NZ/Aus
Boat: Lightwave 45
Posts: 300
|
Re: MWV sentences not working in dashboard
Is there any update on the usability of the these Nasa marine units by OpenCPN?
They have a wireless masthead unit that talks to a "data box" which puts out nmea 183.
Is it possible to run this through a USB serial adapter and into OpenCPN?
Tim
|
|
|
 |
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
Recent Discussions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vendor Spotlight |
|
No Threads to Display.
|
|