Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 04-08-2020, 08:19   #1
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
EngineDashboard Data refresh rate?

Hi,

when using the plugin Engine_dashbord itīs possible to show tank levels with incoming NMEA-XDR-Sentences.
I use the network broadcast adress to get the NMEA-packages.
This works but thereīs one point I think about.

When the data transmitting rate is lower then one Sentence every 5 sec. then the instrument falls to zero until the new sentence comes in.

So when I send e.g. every 10 sec. one Datapackage with 50% level the instrument shows 50% then falls to zero then 50% and so on.

A refreshing rate every 5 sec for tank levels seems very short. Is there a possiblity to get a refreshing rate round about once per minute or so?

Thanks and regards

Andreas
Andreas29 is offline   Reply With Quote
Old 04-08-2020, 09:06   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,255
Re: EngineDashboard Data refresh rate?

Andreas..
I haven't been involved at all in the EngineDashboard but a watchdog set to six seconds is normally used in OpenCPN Dashboard and probably copied from there.
There are also a new prolonged watchdog for some SignalK data set to 30 seconds.


But what's the problem for you to send every four or five seconds if the plugin want it like that?
Hakan is offline   Reply With Quote
Old 04-08-2020, 10:39   #3
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

@Hakan: Thanks for your information.

Thereīs no big problem.
But more NMEA-Sentences per second = more traffic in the network and -and this is the more interesting point- I use a Wemos D1 pro mini as transducer and when I send less datapackets via the WiFi the power consumption will be more less.
At the end -if thinks work as I think- Iīll use three or some more of them and each uses ca. 70mA (and in sending burst up to 200 mA). Itīs possible to bring the Wifimodem into a sleep mode then the module needs round 16 mA.

So sending once per minute just reduces the power consumption.

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 04-08-2020, 11:09   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,255
Re: EngineDashboard Data refresh rate?

OK, so then you'll have to convince the plugin maker to change the watchdog. Or rebuild it yourself? I can agree a fuel level would not need a short WD.
Hakan is offline   Reply With Quote
Old 04-08-2020, 11:20   #5
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

in the code in the EngineDashboard/src/dashboard_pi.cpp in Line 393 stands:
if (wxDateTime::Now() > (watchDogTime + wxTimeSpan::Seconds(5))) {

and this is -when I understand the comments in the code- the watchdog function. So changing the 5 to 50 or 60 and then the watchdog waits long enough. I must try this in the next days and rebuild the plugin.

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 04-08-2020, 11:41   #6
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,255
Re: EngineDashboard Data refresh rate?

Andreas..
This is not built as the O-Dashboard where all instruments have it's own watchdog. So yes I agree although I'm not a code master. Make a try but I think it will affect all instruments. Also the RPM meter and a strange effect when you switch the motor off. So nothing to spread around.
Hakan is offline   Reply With Quote
Old 04-08-2020, 19:06   #7
Registered User

Join Date: Mar 2011
Posts: 724
Re: EngineDashboard Data refresh rate?

The instruments are updated on receipt of the respective NMEA 183 sentence keeping in mind whatever latency is incurred during processing.

So for example if your Rudder Angle sensor transmits NMEA 183 sentences at a rate of 1 Hz, the engine dashboard rudder angle gauge will be updated at the same frequency.

If the engine has a NMEA 2000 interface and transmits RPM, Oil Pressure and Water Temperature at a rate of 10Hz, the TwoCan Plugin (another plugin that allows OpenCPN to use NMEA 2000 data), will convert these NMEA 2000 messages to NMEA 183 sentences which in turn will be received by OpenCPN and forwarded to the Engine Dashboard plugin, again at the same frequency but with some latency incurred.

The role of the watch dog timer is to simply zero the instruments if no sentence has been received with 5 seconds. Just like when you turn off the ignition, the fuel tank, oil pressure, water temp gauges etc. return to zero. I'll readily admit that this is a crude/simplistic mechanism and could possibly be improved by having individually configured watch dog timers for each gauge, but as the old saying goes, "you can put lipstick on a pig....". Plus there are other things I would prefer to spend my time on.

In your particular case where you are developing your own sensors using the Wemos D1 interface, its entirely up to you as to what rate you want to send data. Just keep in mind that if you choose a rate slower than 0.2 Hz (once per 5 seconds) the watchdog timer, as it is currently configured will cause the Engine Dashboard to zero its gauges until it receives new values.
stevead is offline   Reply With Quote
Old 04-08-2020, 22:11   #8
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

@Hakan: I agree. This was more a first quickīn dirty solution and like you Iīm not a code master

@stevead: Yes, time is one of he greatest treasures we have (or not)
I saw the code lines and you confirm my guess.
I agree with you, this is a simplistic method to set the gauges to zero if the engineīs shut off.

During my Tests I just send one nmea-XDR-Datastream to OC.
This special XDR-Tank-Level Data and no other nmea-data.

Look this watchdog only for the engine NMEA-Sentences or watch it generally for nmea-Sentences?
Later in the real boat-network there are much more Data-streams transmitting to oc and if this watchdog looks for all sentences I donīt have to send the tank-Level-Data every 5 seconds.
An other possiility is to use the nmea-converter Plugin to send a fake engine-nmea-data-stream so that the watchdog think all is fine

Thank you @stevead for your work and for developing this plugin.

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 05-08-2020, 00:08   #9
Registered User

Join Date: Mar 2011
Posts: 724
Re: EngineDashboard Data refresh rate?

It would actually help if I looked at the code, which I've just done now whilst finalising the changes to support the new OpenCPN v5.2 Plugin Manager and issuing the PR for the metadata xml files.
Quote:
The instruments are updated on receipt of the respective NMEA 183 sentence keeping in mind whatever latency is incurred during processing.
While the instrument values are updated on receipt of the respective sentence, the instruments are only repainted on the screen every second. (This occurs in the same wxTimer loop in which the watchdog value is checked)

Note that the use of a watch dog timer in the Engine Dashboard is independent and distinct to watch dog timers used elsewhere in OpenCPN and in other plugins. If the Engine Dashboard sets a watch dog timer of 5 seconds it has no effect on other components in the system. For me it is just a simple way to zero an instrument if it no longer receives valid data.

Unfortunately I don't have any NMEA 2000 or NMEA 183 sensors on my engine, so I have no idea what data if any is transmitted by an engine oil pressure sensor or tachometer once the engine has been turned off, even though the sensor itself may be powered independently from the engine, for example it may be powered by the NMEA 2000 bus. So I thought it would just be easier to use a watchdog timer to zero an instrument if it stopped receiving data.

If your major concern is network utilisation (and I'm assuming your talking about your WiFi network connecting OpenCPN to your sensor devices), then a tank level sensor transmitting one NMEA 183 sentence every second is hardly going to be noticeable, let alone affect the power consumption of your Wemos D1 interface.

It would be nice to have an individual watch dog timer for each gauge, or at least high (10Hz) & low speed (1Hz) timers, but this is not a high priority for me at the moment.
stevead is offline   Reply With Quote
Old 05-08-2020, 01:23   #10
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

@stevead: Thanks for your explanation. I agree with you, the solution for zeroing the ínstruments will be very easy and I would have done it that way too.

The question now is if the watchdog in the plugin just watch for the specific nmea-sentences used in the enine dashbord plugin or will accept any nmea-sentence send to OC.

Youīre right when you say one wemos is hardly going to be noticeable.
But if I use three (ore more) of them then the difference will be > 3,6 Ah / 24h. So when energy is a point to look for then itīs better to try to reduce the power consumption .

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 05-08-2020, 04:43   #11
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

got an easy "workaround"

With the NMEA-Converter-plugin itīs possible to send virtual NMEA-sentences. When I let send a XDR-NMEA Sentence e.g. Oil-Pressure for the port engine and let do the plugin this every second then I can send the xdr-NMEA-tank-level sentences in a longer interval.
The watchdog noticed the (fake) NMEA-sentence as a real one and donīt set the instruments to zero.
The disadvantage is that the instruments donīt fall to zero if the transducer stops to transmit but this is something I can live with and therefore I can use the watchdogplugin to observe if the tank-level-transducer transmitting data.

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 05-08-2020, 07:14   #12
Registered User

Join Date: Mar 2011
Posts: 724
Re: EngineDashboard Data refresh rate?

Quote:
The question now is if the watchdog in the plugin just watch for the specific nmea-sentences used in the engine dashboard plugin or will accept any nmea-sentence send to OC.
The Engine Dashboard plugin returns the flag WANTS_NMEA_SENTENCES when it is initialised, and the plugin's SetNMEASentence method is invoked for every NMEA 183 sentence that OpenCPN receives.

That method performs a basic inspection of the sentence to obtain the mnemonic but will only parse RPM, RSA and XDR sentences. The watchdog is only set when valid data is received for one of these sentences. The plugin does not process nor set the watchdog for any other NMEA 183 sentence.

It would be nice if OpenCPN performed the filtering of NMEA 183 sentences but c'est la vie.
stevead is offline   Reply With Quote
Old 05-08-2020, 08:32   #13
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,255
Re: EngineDashboard Data refresh rate?

Quote:
Originally Posted by stevead View Post
It would be nice if OpenCPN performed the filtering of NMEA 183 sentences but c'est la vie.
Well every NMEA0183 passing the multplexer can be filtered but I may misunderstand what you're looking for?
Hakan is offline   Reply With Quote
Old 05-08-2020, 11:10   #14
Registered User

Join Date: Dec 2015
Location: Germany, sailing: Northsea
Boat: Friendship 28
Posts: 244
Re: EngineDashboard Data refresh rate?

Hi,

I made this:

Create a XDR-engine-Sentence in the NMEA-Converter-plugin witch I donīt need to visualize with the engine dashboard.
Let the Nmea-converter-plugin send it every 3 sec.
With my Wemos I can now send the real to show xdr-tank-level sentence in a longer and free-of-choice interval.
To see if the wemos transducer is still alive I send also a control-nmea-sentence with the tank-level-sentence (Talker ID AA) witch I can let control from the watchdog-plugin. So when the transducer transmitting interval is e.g. 30 sec I let the watchdog control the NMEA-Data-stream of Talker ID AA for once every 45 to 60 sec.
Works
The tanklevelinstruments were now not set to zero cause the watchdog of the engine-plugin think every thing is fine due to the virtual input.

Regards

Andreas
Andreas29 is offline   Reply With Quote
Old 05-08-2020, 12:48   #15
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,255
Re: EngineDashboard Data refresh rate?

Andreas..
Nice innovative solution to satisfy your needs.
Hakan is offline   Reply With Quote
Reply

Tags
engine


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
oeSENC chart refresh API error Shawanaga OpenCPN 2 11-06-2020 10:00
Saba 50: Any news on a refresh for the Saba 50? Thalas Fountaine Pajot 4 14-01-2019 21:55
Teak Deck Refresh chris95040 Construction, Maintenance & Refit 29 16-10-2014 07:19
Refresh Main page Mirage Gecko The Sailor's Confessional 3 07-03-2014 07:22

Advertise Here


All times are GMT -7. The time now is 19:17.


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.