Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 13-02-2022, 03:21   #1
Registered User

Join Date: Feb 2022
Posts: 8
Angry No Temperature in Dashboard

Hello,


I hope someone may know what I'm doing wrong.


I'm running OpenCPN 5.6.0 on Windows 10. Sorry for that.


Ive build an Baro/Temp Sensor based on an Arduino Nano with the help of https://github.com/dolabriform/nanobaro_bmp280


The Device is attached via USB and connented in OpenCPN.
The NMEA Monitor shows Temp and Baro.


I've configured the Dashboard,




but only the the Baro Value is shown.
The Temp is empty.


Whats wrong?


Thanks for your input.

Best Regards


Skipjohnsen
skipjohnsen is offline   Reply With Quote
Old 13-02-2022, 14:56   #2
Registered User

Join Date: Mar 2011
Posts: 722
Re: No Temperature in Dashboard

If your review the source code for the OpenCPN Dashboard plugin you will notice that it does not use the same NMEA 183 sentences or NMEA 193 XDR transducer names that you provide.
For air temperature:
Code:
// XDR Airtemp
          if ((m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("C") &&
               m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                   _T("TempAir")) ||
              m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                  _T("ENV_OUTAIR_T") ||
              m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                  _T("ENV_OUTSIDE_T")) {
            if (mPriATMP >= 2) {
              mPriATMP = 2;
              SendSentenceToAllInstruments(
                  OCPN_DBP_STC_ATMP, toUsrTemp_Plugin(xdrdata, g_iDashTempUnit),
                  getUsrTempUnit_Plugin(g_iDashTempUnit));
              mATMP_Watchdog = no_nav_watchdog_timeout_ticks;
            }
          }
or
Code:
else if (m_NMEA0183.LastSentenceIDReceived ==
               _T("MTA")) {  // Air temperature
      if (mPriATMP >= 3) {
        if (m_NMEA0183.Parse()) {
          mPriATMP = 3;
          SendSentenceToAllInstruments(
              OCPN_DBP_STC_ATMP,
              toUsrTemp_Plugin(m_NMEA0183.Mta.Temperature, g_iDashTempUnit),
              getUsrTempUnit_Plugin(g_iDashTempUnit));
          mATMP_Watchdog = gps_watchdog_timeout_ticks;
        }
      }
    }
For Barometric Pressure:
Code:
else if (m_NMEA0183.LastSentenceIDReceived ==
               _T("MDA")) {  // Barometric pressure
      if (m_NMEA0183.Parse()) {
        // TODO make posibilyti to select between Bar or InchHg
        /*
         double   m_NMEA0183.Mda.Pressure;
         wxString m_NMEA0183.Mda.UnitOfMeasurement;
         */
        if (m_NMEA0183.Mda.Pressure > .8 && m_NMEA0183.Mda.Pressure < 1.1) {
          SendSentenceToAllInstruments(
              OCPN_DBP_STC_MDA, m_NMEA0183.Mda.Pressure * 1000,
              _T("hPa"));  // Convert to hpa befor sending to instruments.
          mMDA_Watchdog = no_nav_watchdog_timeout_ticks;
For barometric pressure XDR sentences the plugin seems not to care about the transducer name:
Code:
 if (m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("P")) {
		  if (m_NMEA0183.Xdr.TransducerInfo[i].UnitOfMeasurement == _T("B")) {
			  xdrdata *= 1000;
				  SendSentenceToAllInstruments(OCPN_DBP_STC_MDA, xdrdata,
					  _T("hPa"));
				  mMDA_Watchdog = no_nav_watchdog_timeout_ticks;
		  }
With respect to environmental sensors,the dashboard plugin is a dog's breakfast using obsolete NMEA 183 sentences (MDA and MTA) and incorrect NMEA 183 XDR sentence transducer names ("TempAir", "ENV_OUTAIR_T" and "ENV_OUTSIDE_T" instead of "Air"). I guess some of this is historical (precedes XDR standardization) or workarounds to support other sensors that use non-standard proprietary names.

Your solution is to change your temperature transducer names to those that match the plugin's. Suggest you also submit a flyspray bug report to request additional support for the correct NMEA 183 v4.11 XDR transducer names by the plugin.
stevead is offline   Reply With Quote
Old 14-02-2022, 03:24   #3
Registered User

Join Date: Feb 2022
Posts: 8
Re: No Temperature in Dashboard

Quote:
Originally Posted by stevead View Post
If your review the source code for the OpenCPN Dashboard plugin you will notice that it does not use the same NMEA 183 sentences or NMEA 193 XDR transducer names that you provide.
For air temperature:
Code:
// XDR Airtemp
          if ((m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("C") &&
               m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                   _T("TempAir")) ||
              m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                  _T("ENV_OUTAIR_T") ||
              m_NMEA0183.Xdr.TransducerInfo[i].TransducerName ==
                  _T("ENV_OUTSIDE_T")) {
            if (mPriATMP >= 2) {
              mPriATMP = 2;
              SendSentenceToAllInstruments(
                  OCPN_DBP_STC_ATMP, toUsrTemp_Plugin(xdrdata, g_iDashTempUnit),
                  getUsrTempUnit_Plugin(g_iDashTempUnit));
              mATMP_Watchdog = no_nav_watchdog_timeout_ticks;
            }
          }
or
Code:
else if (m_NMEA0183.LastSentenceIDReceived ==
               _T("MTA")) {  // Air temperature
      if (mPriATMP >= 3) {
        if (m_NMEA0183.Parse()) {
          mPriATMP = 3;
          SendSentenceToAllInstruments(
              OCPN_DBP_STC_ATMP,
              toUsrTemp_Plugin(m_NMEA0183.Mta.Temperature, g_iDashTempUnit),
              getUsrTempUnit_Plugin(g_iDashTempUnit));
          mATMP_Watchdog = gps_watchdog_timeout_ticks;
        }
      }
    }
For Barometric Pressure:
Code:
else if (m_NMEA0183.LastSentenceIDReceived ==
               _T("MDA")) {  // Barometric pressure
      if (m_NMEA0183.Parse()) {
        // TODO make posibilyti to select between Bar or InchHg
        /*
         double   m_NMEA0183.Mda.Pressure;
         wxString m_NMEA0183.Mda.UnitOfMeasurement;
         */
        if (m_NMEA0183.Mda.Pressure > .8 && m_NMEA0183.Mda.Pressure < 1.1) {
          SendSentenceToAllInstruments(
              OCPN_DBP_STC_MDA, m_NMEA0183.Mda.Pressure * 1000,
              _T("hPa"));  // Convert to hpa befor sending to instruments.
          mMDA_Watchdog = no_nav_watchdog_timeout_ticks;
For barometric pressure XDR sentences the plugin seems not to care about the transducer name:
Code:
 if (m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("P")) {
		  if (m_NMEA0183.Xdr.TransducerInfo[i].UnitOfMeasurement == _T("B")) {
			  xdrdata *= 1000;
				  SendSentenceToAllInstruments(OCPN_DBP_STC_MDA, xdrdata,
					  _T("hPa"));
				  mMDA_Watchdog = no_nav_watchdog_timeout_ticks;
		  }
With respect to environmental sensors,the dashboard plugin is a dog's breakfast using obsolete NMEA 183 sentences (MDA and MTA) and incorrect NMEA 183 XDR sentence transducer names ("TempAir", "ENV_OUTAIR_T" and "ENV_OUTSIDE_T" instead of "Air"). I guess some of this is historical (precedes XDR standardization) or workarounds to support other sensors that use non-standard proprietary names.

Your solution is to change your temperature transducer names to those that match the plugin's. Suggest you also submit a flyspray bug report to request additional support for the correct NMEA 183 v4.11 XDR transducer names by the plugin.
Thanks @stevead for the quick answer,


If I'm going to tune my NMEA output to name the transduce like TempAir it should be fine?


Or could you please provide me a correct NMEA sentence?


Thanks in advance.


Skipjohnsen
skipjohnsen is offline   Reply With Quote
Old 14-02-2022, 05:15   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

@stevead
I'm looking in IEC 61162-1 v 5.0 and can't find any list of "official" "Transducer ID". Only a list of "Transducer types", see below.
The XDR sentence is somewhat of a "bastard" where different instrument suppliers use "there own" transducer ID creating a lot trouble.
Do you happen to have access to any "official" list of "Transducer ID"?


BTW: Supporting outdated NMEA0183 messages won't be a harm would it? Cruiser's can still have old instruments in boats using OCPN? The standard's term "obsolete" would mainly target supplier's manufacturing new instruments?
Attached Thumbnails
Click image for larger version

Name:	XDR types.png
Views:	48
Size:	214.0 KB
ID:	252928  
Hakan is online now   Reply With Quote
Old 14-02-2022, 17:31   #5
Registered User

Join Date: Mar 2011
Posts: 722
Re: No Temperature in Dashboard

Hi Hakan,

Re: Official List of XDR transducer names, I discovered this NMEA 0183 v4.11 presentation a while ago which I used as the basis for the transducer names in the Engine Dashboard.

From my understanding most of the gateway vendors (Actisense, Shipmodul, Maretron) support these transducer naming conventions. However I don't know what transducer names are now supported by sensor vendors such as Airmar, Nasa Marine etc. for sea or air temperature and barometric pressure .

I guess the question is whether the Dashboard plugin (or the Tactics Dashboard) should use the standard transducer names and drop support for deprecated NMEA 183 sentences and non-standard/proprietary transducer names.
stevead is offline   Reply With Quote
Old 15-02-2022, 00:03   #6
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

Steven..
Very good link, thanks.
The author of the linked report has some good ideas to try to clean up the use of the XDR sentence. Hopefully instrument makers will follow that where possible.
For our Dashboard there are not so much we can get use of since there are no multiple instruments for the same kind of data. Like "Pressure" where Dashboard have one instrument for air pressure and none for oil pressure. I think your Engine Dashboard will serve better here.
But reading the report my thoughts are we would add some more conditions for OCPN Dashboard XDR parser.
We may add "Air" to the list of ID for the temperature instrument.
For pressure we now use conditions Type = P and Unit = B nothing else. (No ID), Should we add the condition ID = "Baro" as well to not interfere with various motor pressures?

And various designations for several equal data for e.g. two motors we can't use. So for example rudder angle we can use only ID = "Rudder" and of course not "Rudder#X"

Thoughts... How do we come to an agreement for OCPN?
Hakan is online now   Reply With Quote
Old 15-02-2022, 02:23   #7
Registered User

Join Date: Feb 2022
Posts: 8
Re: No Temperature in Dashboard

Steven, Hakan,


Thanks for the replies so far.


My conclusion is to to nothing in the moment and wait for your final conclusiuon how to handle the Air Temperature.


Or, are there anyother suggestions from your side?



Best Regards


Skipjohnsen.
skipjohnsen is offline   Reply With Quote
Old 15-02-2022, 03:07   #8
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

Shipjohnsen..
Sorry for all more or less basic discussions instead of a clear answer to your question.

So to adapt to present OCPN Dashboard code change your XDR sentence like this:
Change the word "TEMP" to either of the supported IDs:
"TempAir" or "ENV_OUTAIR_T" or "ENV_OUTSIDE_T"

The barometer pressure will work as it is?

Good luck
Håkan
Hakan is online now   Reply With Quote
Old 19-02-2022, 03:42   #9
Registered User

Join Date: Feb 2022
Posts: 8
Re: No Temperature in Dashboard

Thanks to Hakan and stevead for your great support.
I have adjusted the arduino sketch line

from s = ",C," + String(temp) + ",C,TEMP";

to s = ",C," + String(temp) + ",C,ENV_OUTAIR_T";


now the Dashboard runs like a charm


Best Regards
Skipjohnsen

skipjohnsen is offline   Reply With Quote
Old 26-02-2022, 02:36   #10
Registered User

Join Date: Feb 2022
Posts: 8
Re: No Temperature in Dashboard

Hi,

I'm experimenting with a bme280 and an Arduino Nano for usage with OpenCPN and adjusted the NanoBaro mentioned above to print NMEA0183 sentences with Values for Pressure. Temperature and Humidity.


The code isn't ready and nice but somehow working.
If interested please have a look:
https://github.com/roaxth/NanoBaro-b...dy-for-OpenCPN


Feedback and improvements are highly appreciated.


Best Regards
skipjohnsen is offline   Reply With Quote
Old 27-02-2022, 00:29   #11
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

ship...
Most receiving devices need a checksum to the NMEA0183 sentence.
There are many ways to do that. Here's one example.
Here is the "nmea" a global variable instead of a return function.
(I don't remember the originator of this checksum calculator. Many thanks to the author if recognized.)

Code:
void NMEA_AIQ() {
  // Ask the device for a updated VSD
  nmea = "$ECAIQ";
  nmea += ',';
  nmea += "VSD";       //1. Request to return a VSD sentence
  nmea += '*';
  char c[3];
  sprintf (c, "%02X", checksum(nmea));
  nmea += String(c);
  nmea += "\r\n";
  //return; // nmea;
}

// Calculates the Checksum for the NMEA string
unsigned char checksum(String theseChars) {
  char check = 0;
  // iterate over the string between $ and *, XOR each byte with the total sum:
  for (int c = 1; c < theseChars.length() -1 && theseChars.charAt(c) != '*'; c++) {
    check = char(check ^= theseChars.charAt(c));
  } 
  // return the result
  return check;
}
Hakan is online now   Reply With Quote
Old 01-03-2022, 00:32   #12
Registered User

Join Date: Feb 2022
Posts: 8
Re: No Temperature in Dashboard

Hello Hakan,


I thought CRC is included in my code.
At the end of each line there should be the CRC.


Or am I wrong?



That's my output:


09:27:31.485 -> $WIXDR,C,23.75,C,ENV_OUTAIR_T,P,1.02001,B,BARO,H,3 5.55,P,HUMIDITY*69
09:27:41.518 -> $WIXDR,C,23.69,C,ENV_OUTAIR_T,P,1.01998,B,BARO,H,3 5.51,P,HUMIDITY*6A
09:27:51.550 -> $WIXDR,C,23.64,C,ENV_OUTAIR_T,P,1.02003,B,BARO,H,3 5.70,P,HUMIDITY*6C
09:28:01.543 -> $WIXDR,C,23.60,C,ENV_OUTAIR_T,P,1.02003,B,BARO,H,3 5.68,P,HUMIDITY*61
09:28:11.569 -> $WIXDR,C,23.55,C,ENV_OUTAIR_T,P,1.02003,B,BARO,H,3 6.14,P,HUMIDITY*6F
09:28:21.619 -> $WIXDR,C,23.50,C,ENV_OUTAIR_T,P,1.02003,B,BARO,H,3 6.27,P,HUMIDITY*6A



Thanks for your support.
skipjohnsen is offline   Reply With Quote
Old 01-03-2022, 00:38   #13
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

No, very good.
I may have missed that in your code. Sorry
Hakan is online now   Reply With Quote
Old 24-03-2022, 04:54   #14
Registered User

Join Date: Feb 2019
Location: Cartagena, Spain
Boat: Furia 372 - 11.20m
Posts: 348
Re: No Temperature in Dashboard

Quote:
Originally Posted by stevead View Post
For barometric pressure XDR sentences the plugin seems not to care about the transducer name:
Code:
 if (m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("P")) {
		  if (m_NMEA0183.Xdr.TransducerInfo[i].UnitOfMeasurement == _T("B")) {
			  xdrdata *= 1000;
				  SendSentenceToAllInstruments(OCPN_DBP_STC_MDA, xdrdata,
					  _T("hPa"));
				  mMDA_Watchdog = no_nav_watchdog_timeout_ticks;
		  }
With respect to environmental sensors,the dashboard plugin is a dog's breakfast using obsolete NMEA 183 sentences (MDA and MTA) and incorrect NMEA 183 XDR sentence transducer names ("TempAir", "ENV_OUTAIR_T" and "ENV_OUTSIDE_T" instead of "Air"). I guess some of this is historical (precedes XDR standardization) or workarounds to support other sensors that use non-standard proprietary names.
Recently, XDR for atmospheric pressure has been a defining problem for me. I had to untranslate engine oil pressure from n2k because O didn't distinguish between the two. This gateway has a BME280 transducer that also supplies Ambient Temperature, Atmospheric Pressure and Relative Humidity.

The ID "TempAir" does not correspond to the norm either, as you say. Many years ago now, I had to put it like this exclusively for O users.

Many manufacturers use MDA for everything. It is a pity that O only takes atmospheric pressure. I think it would take little to take everything and prioritize its values ​​in the face of the mess we have with XDR.
Tehani is offline   Reply With Quote
Old 24-03-2022, 09:15   #15
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,247
Re: No Temperature in Dashboard

For outside air temperature OCPN Dashboard(DB) use a priority (the lower the better) as:
  1. "environment.outside.temperature" (SK)
  2. XDR: Type: C, Name: TempAir || ENV_OUTAIR_T || ENV_OUTSIDE_T
  3. MTA: Air temperature
  4. MDA: Air temperature
For outside air pressure OCPN Dashboard(DB) use these sentences without priority:
  • environment.outside.pressure (SK)
  • XDR: Type: P
  • MDA: Barometric pressure
So if you produce a XDR with type "P" it will be parsed by DB as air pressure, that's correct.
That's how it is for now.
Hakan is online now   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: DashBoard SethDart OpenCPN 646 01-07-2024 11:36
Temperature through NMEA XDR, Dashboard PI omnia OpenCPN 7 31-03-2017 23:38

Advertise Here


All times are GMT -7. The time now is 09:05.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.