{ "cells": [ { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy\n", ".. index::\n", " single: Instruments; EngineDJG" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Engine/Energy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_DashT EngineDJG_ Dials are intended for engine and energy data originating typically from NMEA-2000 databus (or its commercial namesakes) of your boat. The data is read from a [Signal K server node](https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:supplementary_software:signalk) by [Signal K In communication instrument](../signalk/signalk.ipynb#Signal-K-In)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">\"_D_\" as dial, \"_JG_\" as [justGage](https://github.com/toorshia/justgage) - thanks for the great dial, folks!" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Introduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Introduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_DashT EngineDJG_ Dials are created using modern web techniques and the resulting application is incorporated in _OpenCPN_ dashboard:\n", "\n", "* A dedicated instrument for Engine and Energy data in Signal K data format\n", " * Gets data from DashT plug-in by subscription\n", "* Data obtained from a single Signal K server node interconnection\n", " * Allowing multiplication of instruments _ad infinitum_\n", " * Instrument is not making data connections, connects only to DashT\n", "* Does not interfere with NMEA-0183 data push toward the \"traditional\" Dashboard instruments\n", " * Your good old instruments receiving their data from OpenCPN will continue to work as before\n", "* HTML5 and JavaScript based\n", " * Plain text customization files provided\n", " * Loading from the same or from a remote computer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/005_DashT_EngineDJG_proto_screenshot.png)" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Installation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Installation/Launch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The EngineDJG gauge does not require any additional installations, all the components are incorporated in the plug-in and ready to use." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Node.js" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Use Node.js" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since you have already a _Signal K server node_ up and running and the network connections all set, we just need to use those connections and use their settings and launch both _Signal K server node_ and an _http-server_ on _Node.js_. This sounds difficult but there is a helper scripts for that, explained below:" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Helper scripts" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Engine Gage script" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Windows**: a button is installed on your desktop, called _Engine Gage_." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Linux**: on command prompt, type `dashtengine` (create a desktop button, if you like)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Both are serving the same purpose: launching a script, which starts the _Signal K server node_ on _Node.js_ (if not yet running) and launching a _http-server_ on port 8080, which is serving _DashT_ with the _EngineDJG_ web instruments: the instruments are executed then on \"mini-browsers\", incorporated in Dashboard instrument panels." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Later on this document, the usage in [feature rich infrastructures](#Rich-infras) will be explained, for now we expect that the instruments are available for _DashT_." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Configuration" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Configuration" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This chapter is addressing the first time configuration - _i.e._ make instruments to learn what data is available in your boat and select the ones you are interested in." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: Configuration can take place only when the instruments receive data from the _Signal K server node_." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Adding new dials" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_DashT EngineDJG_ instruments are compatible with all Dashboard instruments and they can be added in any Dashboard instrument cluster window pane. However, since the number of engine parameters, for example is important it is suggested that you create instruments clusters like for \"Engine\" data and for \"Energy\" data." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The adding of instruments is like adding any other Dashboard instrument in DashT's preferences: scroll all the way down of the list to find the single instrument. Add as many instances of it as you estimate you are going to need to show the data parameters you are interested in." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/010_DashT_EngineDJG_Adding-1.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is suggested than before the configuration the instrument cluster is in \"Horizontal\" mode to allow sometime very long menu list presented during the configuration phase to roll out vertically. Once the instrument cluster window pane is configured, one can change, of course to \"Vertical\" mode if needed." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/015_DashT_EngineDJG_Adding-2.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[How-to video in vimeo.com](https://player.vimeo.com/video/391601592)" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Subscription" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Subscribe to data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once a new DashT EngineDJG instrument has been created it asks from _DashT Signal K In_ streamer what available data paths there are in your boat. It requires a complete list and, depending of your boat's instrumentation this can be a pretty long one... Normally, the inquiry hould be finished in less than 10 seconds, though." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/020_DashT_EngineDJG_loading_all_paths.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once a list of all available data paths has been received, DashT EngineDJG instrument builds a selection menu out of them and invites you to make your selection using the context menu which is activated by a **maintained right click** on the **upper left** hand corner of the instrument." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/025_DashT_EngineDJG_received_all_paths.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the context menu, all available data paths are listed a hierarchical order. The names of the data paths are usually clear enough to understand the nature and the origin of the data. A full list of [Signal K keys](https://github.com/SignalK/specification/blob/master/gitbook-docs/keys.md) is also available." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/030_DashT_EngineDJG_select_avlb_paths-1.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The data path values where the last element is marked in blue means that the DashT installation package has a pre-defined setting for it and it can be shown by simply selecting that data path." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/035_DashT_EngineDJG_select_avlb_paths-2.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Most common data path values have been included in the DashT installation by default for engine and some most obvious data paths for the energy. If the data path is grayed out, it means that it cannot be selected since no data path rule has been defined. This does not mean that the value cannot be shown, it is just that the development and testing has not been able to test it or is not aware of it - there is really a lot of data paths of all sort, such as status data. A way to define your own configuration for data paths is discussed [later in this document](#Add-data-paths)." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Search again" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Search again" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you cannot find a data path you are expecting to find from the menu, you can ask for a quick rescan by selecting any of the grayed-out items from the menu, _i.e._ a menu item which is not in blue color. You may get an alert of a non-existing path, depending of the common configuration file settings. Resulting action is, anyway the same as in [Changing EngineDJG instrument's data path subscription](#Change-Subscription) and the data sources are scanned again for new paths." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: The available data scanning is cumulative and if the data path you are expecting was not available from your data bus within the previous scan's time window frame (in less than 10 seconds), it may have been omitted. Rescan may help. Once the path is recongnized and configured, the subsription to it will be persistent." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Change Display" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Change Display" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can scroll the display types with Ctrl+$\\uparrow$ and Ctrl+$\\downarrow$ (Ctrl-key kept down and press arrow keys up or down): apart the default 180-degree dial type, there is also a 360-degree 'donut' and a simple numerical display type available." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/040_DashT_EngineDJG_display_donut.png) | \n", "[(zoom)](img/045_DashT_EngineDJG_display_simple.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[How-to video in vimeo.com](https://player.vimeo.com/video/391601933)" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Change Subscription" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Change Subscription" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While the EngineDJG is running (_i.e._ data is coming in by an existing subscription a data path from the Signal K streamer) right-click on the upper left corner in order to get the context menu which allows you to stop the data display and force a complete re-initialization of the data path subscription as explained in the previous section." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[How-to video in vimeo.com](https://player.vimeo.com/video/391601955)" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Customization" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Customization" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It goes without saying that nobody else but **you** will be able to find out the particular data sources available in your own boat! _DashT EngineDJG_ reports you all the data paths but the _DashT_ distribution can make but a modest guess what might interest you in the first place. It is likely that we are missing something." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Unlike the most of the _DashT_, which is written in C++/wxWidgets requiring compilation/build etc., the _EngineDJG_ instrument is a HTML5/JavaScript program which means there are plain text files which you can modify, allowing you to customize the data paths displayed according to your requirements." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Modern web development techniques have been used which are resulting in a very compact and thus non-human readable run-time program execution format, but configuration files are provided also in plain text without merging and compression, allowing you to make your own customizations." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### File location" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Defaults are for the input JavaScript files:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Windows**:\n", "```\n", "\\Users\\Public\\DashT\\www\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Linux**:\n", "```\n", "/usr/share/opencpn/plugins/dashboard_tactics_pi/data/instrujs/www/\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In case you have a boat full of electronics, computers and servers alike, you know what you are doing but you may still want to follow the instructions for [feature rich environments](#Rich-infras), in which case the above paths would probably be best known by yourself." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: Make sure to take backups before modifying anything! JavaScript is \"easy\" but does not have any pity to syntax errors: it is a grinding halt without a visible error message..." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Add paths" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Add data paths" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You would need to modify a configuration file named `common.js` - here is an excerpt of the instructions in that file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", " Contribute/report here, please:\n", "```\n", ">https://git.io/JejKQ\n", "```\n", " - with a screenshot and a short description of your installation, thanks!\n", " SignalK Path keys:\n", "```\n", ">https://git.io/JvsYw\n", "```\n", " The Signal K values are always in SI units (like m/s, not knots).\n", " Conversion to a wanted unit is made with multipier/division/offset.\n", " Avoid using floating point values like 0.000000003 in JavaScript!\n", " UTF8 - do _not_ change encoding, cf. degree character. Notepad++ recommended.\n", " Usage example: enginedjg/index.html loads a minimized version, common.min.js\n", " - make a copy of common.min.js by renaming it;\n", " - make a copy of this one with name common.min.js and modify it;\n", " - (no need for compression with this non-executing file!)\n", " - or, modify enginedjg/index.html to load your own file, no problem!\n", " - issues? open the index.html in a browser, hit Shift+Ctrl+I and reload;\n", " * Console gives you the reason why it does not load anymore:\n", " * Look for messages in red, a typo, missing comma?\n", " - note: next update/reinstallation overrides this file, keep backups!\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Typical change that you may want to do is to have different titles for each battery parks, instead of having a `*` wildcard. You would copy-paste-modify the below definition by replacing the wildcard with two (or more) individual records, both with a full data path (Signal K key) name and a title for your liking, and this for as many times your system is reporting about those values being available:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", " {\n", " version : 1,\n", " path : 'electrical.batteries.*.current',\n", " title : 'Battery Current',\n", " symbol : '',\n", " unit : 'Amps',\n", " display : 'dial',\n", " decimals : 1,\n", " minval : -20,\n", " loalert : 0,\n", " hialert : 0,\n", " maxval : 20,\n", " multiplier : 1,\n", " divider : 1,\n", " offset : 0\n", " },\n", "\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Of course, you may want to simply change units in some entries, like from Celsius to Fahrenheit. Just be careful to preserve the UTF-8 degree sign, will you." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The header part of the file contains some common customizations, like turning off the alerts or giving more time for them to set in. One can also increase the debug level in case the EngineDJG HTML/JS code needs to be inspected in an external browser." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; common.js" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: the `common.js` file is **not** used by default but one needs to replace the compressed version of it with this human readable one in `instrujs/index.html`. Follow the instructions in `common.js` for that. If a need arise, do not hesitate to do the change - there is no performance penalty since the file is read only during the startup of instruments. See also " ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Language\n", ".. index::\n", " single: Language; Engine/Energy\n", ".. index::\n", " single: Engine/Energy; Language" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Language file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Unfortunately, it is self service, no community support. Yet! You can participate with your native tongue by submitting your translations here: https://git.io/JejKQ" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Meanwhile, you can just replace the `lang.js` file with yours. Keep a copy of the original, though: **JavaScript does not make any gifts** but goes to a grinding halt for any syntax error (like a missing comma) and none of the DashT EngineDJG instruments will start! There will be no fancy warning message, just a gray background staring at you... - check this [troubleshoot section](#After-config,-all-dead)." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Rich infras" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rich infras" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The instrument is composed of a HTML file and numerous JavaScript files, like any other browser based application. If you do not run a _Node.js_ on your local computer, the configuration task consist of making them available on your boat's network infrastructure. It contains many elements being platform specific, explained in below sections." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One needs to explain _DashT_ where it should fetch the _EngineDJG_ components. This is done in [ini/conf-file](../tweaks/tweaks.ipynb#DashT/WebView)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: one might be tempted to use `file://` protocol. Please note that in Windows, starting from [security update of 2020-01-14](https://support.microsoft.com/en-us/help/4534251/cumulative-security-update-for-internet-explorer) local storage capability, including cookies is disabled for `file://` protocol in the back-end the wxWidgets is using on Windows (IE). Therefore we address below only the usage of `http://` protocol to retrieve files from your files infrastructure to enable persistent EngineDJG configuration settings across platforms. You can set `file://` protocol in ini/conf-file but you would probably need to reconfigure your instrument at every restart. In older operating systems without security updates the `file://` protocol may work but _DashT_ is not addressing those system configurations so you would experience other issues." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Rich Linux" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### pub Linux" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, you have to identify where are the DashT EngineDJG files after the installation and export the directory:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`/usr/share/opencpn/plugins/dashboard_tactics_pi/data/instrujs/`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Apache2 server" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Most of the Linux systems provide Apache2 server by default and even start it by default. Navigate to your Linux box's network IP-address and you will soon find out if this is the case. Otherwise, it is not a big task to get it running but for clarity we presume now that it is already active. You would say:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`sudo ln -s /usr/share/opencpn/plugins/dashboard_tactics_pi/data/instrujs /var/www/html/instrujs`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Check that it works:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE** 1: The IP-address below is an example only, author's Raspberry: use your own" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE** 2: The actual content of the directory changes with more DashT _instrujs_ instruments becoming available" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[(zoom)](img/050_DashT_Apache2_check_instrujs.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### http-server node" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: If you are running a _Signal K server node_ on your local computer, you do not follow these instructions, the helper script explained above is doing all this work for you. Follow these instructions only if your server is located on another computer." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since you already have a _ Signal K server node_ you have thus _Node.js_. If the above Apache2 method seems like an overkill to you, there is this dead simple solution:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`npm install -g http-server`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You would start the service (and can make a shell script for it):\n", "```\n", "http-server /usr/share/opencpn/plugins/dashboard_tactics_pi/data/instrujs/www -p 8080\n", "```\n", "Or from where ever you have put the `instrujs` directory on this server." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Execute the script, leave the http-server running and verify that files are available on the port `8080` (you can modify the port, of course). The verification, like usual with a normal browser, as above with the Apache server - no need to start _OpenCPN_ for that." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The new server and the port need to be described to _DashT_ in [ini/conf-file](../tweaks/tweaks.ipynb#DashT/WebView)." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Rich Windows" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### pub Windows" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: We suppose below that you are running also the _Signal K server node_ on Windows but locally, _i.e._ not where _OpenCPN_ is located. With local-only installation, the helper script is doing all the below work." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In addition to the _Signal K server node_, install also the following server node:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`npm install -g http-server`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You will find the files to share from\n", "```\n", "C:\\Program Files (x86)\\OpenCPN\\plugins\\dashboard_tactics_pi\\data\\instrujs\\www\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You would start the service (and can make a batch or PowerShell script for it):\n", "```\n", "http-server \"C:\\Program Files (x86)\\OpenCPN\\plugins\\dashboard_tactics_pi\\data\\instrujs\\www\" -p 8080\n", "```\n", "Or from where ever you have put the `instrujs` directory on this server." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The new server and the port need to be described to _DashT_ in [ini/conf-file](../tweaks/tweaks.ipynb#DashT/WebView)." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Troubleshooting\n", ".. index::\n", " single: Troubleshooting; Engine/Energy\n", ".. index::\n", " single: Engine/Energy; Troubleshooting" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Troubleshooting" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data is bad" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is always a good idea to go back as close as possible to the data source, which is Signal K server node. What does it say about that data? If the SI unit value it displays in its own plug-ins and log files makes sense to you, then the issue is probably with the multiplier, divider or offset, or all of them used to convert it (see above sections about the customization)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The floating point data which is coming from Signal K server node is given as such to the _DashT EngineDJG_ instrument, but as a string (we are talking to a JavaScript program) in non-scientific notation, in decimal format. For example, if DashT receives 0.24444444, that usually is alright. But a general rule is that values with too many zeros are not advisable in JavaScript. Avoid calculations where any result, including intermediate values would lead to values like 0.0000003 or similar bunch of zeros." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If things need deep understanding of data which is coming in from your boat's databus, maybe the easiest place where you can look at it is the log files of Signal K server node's databus connector. You need to activate them explicilty. The _instrujs_ Developer's Guide in _DashT_ documentation (in the repository) provides some use cases of deep packet analysis but be warned, it is not for faint hearted!" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Engine/Energy; Config kills all" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### After config, all dead" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The good and bad of JavaScript is that as a scripted language it allows you to make as many syntax errors you like. When you are editing, that is... During the development we use TypeScript to avoid this. But when you are editing JavaScript directly, errors are fatal. Since there is no compilation or transpiling, eventual errors are detected only during loading and even worse, sometimes during the run-time when the code execution passes in the faulty section!" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Troubleshooting; Use browser" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Your best friend is your ordinary browser. Point it to the data directory where the EngineDJG `index.html` file is located and see if you can see an empty dial. If you do not see, then hit `Shift+Ctrl+I` (Shift and Ctrl-keys hold down and press key \"I\") to open the developer tools. Select the Console tab to see the quite verbose _DashT InstruJS_ debug messages and hit Ctrl+F5 to reload the page. Usually, the point where the syntax error is located is clearly shown in red color." ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: Browser\n", ".. index::\n", " single: Browser; Internet Explorer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">**NOTE**: Windows owners should not throw away their beloved (?) Internet Explorer. In fact, the wxWidgets WebView back-end library on Windows port is as old as IE8! In that case, having the IE11 is not a bad idea for testing: you would hit key F12 to get the developer tools visible in this case. To reload a page it is F5." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data \"X\" not available" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The _DashT EngineDJG_ dial is configured by selecting from data available on your boat's NMEA-2000 instrumentation bus and referred as Signal K data key. It may occur that after a reconfiguration of _Signal K server node_, or from some other reason a data path (a data source) is not available anymore. If there is a _EngineDJG_ instrument on your Dashboard configured to display that data path, it remains waiting for that data forever, in vain." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The simplest remedy for this is to destroy the instrument and create a new one if needed." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "But supposing that you are attached to this particular instrument position for some reason (!) there is another way which requires that you shut down OpenCPN first:" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. index::\n", " single: UID\n", ".. index::\n", " single: UID; Forget config." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open the OpenCPN _ProgramData/opencpn/opencpn.ini_ file (_~/.opencpn/opencpn.conf_ in Linux) and find the instrument declaration section, easiest by using the dashboard's title for your search. There is a UID-field with a long, arbitrary string for each instrument based on web-techniques. Now, **without altering the total lenght or the format** change one single arbitrary number in the UID-field of the instrument you want to reconfigure and save the file." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When you restart OpenCPN, the instrument has forgotten its configuration and you can reconfigure it again to one of the data paths in your new NMEA-2000 configuration." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2" } }, "nbformat": 4, "nbformat_minor": 4 }