Create maps for Garmin devices

Garmin GPSmap526 (Garmin)

Garmin is one of the few commercial manufacturers that also allow the use of public free maps on their devices. This makes it possible to also provide older devices with up-to-date map material when support has expired. Garmin offers a variety of navigation devices that can be used on-road for street navigation as well as off-road for tracking. Some device series support marine applications, sometimes also in parallel operation with road navigation. In the following it will be shown how open source cards can be used in such devices for marine operation.

Supported Devices

Not all Garmin devices are suitable for marine use. In the linked list on Open Street Map some devices are listed. The list is not complete and only shows a few devices. The list provided by Garmin looks like this:

  • GPSMAP 276Cx
  • GPSMAP 62/64/65/66/78/79/86 series
  • Colorado series

It is also possible to operate pure street navigation devices with open source marine charts:

Fig.: Garmin Nüvi 1390 and Nüvi 30 (Garmin)

  • Garmin Drive Series
  • Garmin Nuvi series

With these devices, however, a limited map display is to be expected, since certain marine layers are not supported. In principle, the marine maps are more suitable than the road maps supplied. This is quite sufficient for simple indoor applications. There are some providers who offer specialized maps for these devices, in which the information from missing layers has been integrated into other layers. The big advantage of street navigation devices is that older 5″ models can be purchased quite cheaply in the used market and are suitable for operation in sunlight. In addition, they offer dual operation by selecting the respective card and can be used quite universally. The practical suction cup mount for the windscreen can be used just as well on the boat.

map generation

Map generation for marine applications is done via the website bbbikes.org. This is an online map service with which you can create any maps for Garmin and other devices yourself. The following maps can be generated via the map service:

  • road maps
  • bike maps
  • hiking maps
  • elevation maps
  • naval charts

Open source maps serve as the database OpenStreetMap, covering all world regions. The base maps can be combined with different layers for the respective applications.

Select map format

First up is the website bbbikes.org called and under format the sea map format Garmin OpenSeaMap (UTF8) selected.

Choose base map

The next step is to select the base map that is to serve as the background. To do this, click on the small plus sign on the right-hand side and select OSM Mapnik out.

Select map area

Now the map area can be selected. First is about the button here provided and adjusted a rectangle. In a further step about Add points to the polygon changed the rectangle so that it covers all areas that you want to drive on.

Notice: Be as economical as possible with the area selection and only select areas that really interest you. A rectangular selection should be avoided, since unnecessary information is often included in the map that you ultimately do not need for navigation. You save valuable storage space and the device has to process less data and therefore runs much more smoothly.

generate map

Before you can create the map, you still have to assign a name for the map and enter your e-mail. After that, the map generation can be started via the button extract be triggered. You will then receive information about the duration of the map creation and will be informed of the completion with an email and a download link. Please help keep the free service going by making a reasonable donation.

The download link leads to a ZIP file that you can download to your computer.

Save map in device

The easiest way to transfer the downloaded maps is via the USB socket on the Garmin device. Follow these steps:

  1. Connect the Garmin device to the computer and wait until the drives of the Garmin device are visible in the file manager
  2. zip file*.zip unpack
  3. file gmapsupp.img into existing directory xxx:\Garmins copy
  4. Disconnect USB connection (device then restarts)
  5. Select loaded map under Tools -> Settings -> Map -> About select (deselect road map)

With some devices, the map can be loaded into the internal memory, but is not available for selection there. The cards are then integrated into the device via an SD card. Then proceed as follows:

  1. Format SD card with Fat32 (max. 32 GB)
  2. directory Garmin in the root directory of the SD card
  3. zip file*.zip unpack
  4. file gmapsupp.img into existing directory xxx:\Garmins copy to SD card
  5. Insert the SD card into the Garmin device and start the device
  6. Select loaded map under Tools -> Settings -> Map -> About select (deselect road map)

Switching the map may be slightly different on some Garmin devices due to the different menu structure. In general, a configuration page can be found under the Map section, where the settings can be made. Marine maps and road maps can also be used simultaneously on some devices. This loads the CPU bar significantly more due to the simultaneous processing of several maps.

Fig.: Map configuration page

Fig.: Map selection with OSM map (above)

Fig.: OSM map medium zoom level Garmin Nüvi 1390 (road navigation device)

Fig.: OSM map highest zoom level

Fig.: OSM map on GPSmap 620 (Marine compatible Garmin device)

As can be seen in the last image, the marine maps are more detailed and better displayed on marine devices than on road navigation devices.

Adapted maps for road navigation devices

On the website waterways.cz ready-made marine charts for the European waterways can be downloaded. Then you save yourself the card creation.

For road navigation devices, two specially created maps are provided here that have moved some information to other layers:

For some Garmin devices that can also display KML data, there are special ones KML overlays that can be integrated.

Troubleshooting

The loaded map does not work in the device memory

If the downloaded map does not work directly in the device memory and is not selectable, try the map on an SD card in the directory \ Garmin save and use them in the SD card slot of the device. On older Garmin devices, only maps with the file name Gmapsupp.img accepted. Then change the file name.

If marine charts are over 2GB, some devices will not be able to display them. Then reduce the map sections.

Some current marine devices of the latest generation no longer offer the option of displaying old maps (Bluechart). OSM maps can no longer be used on these devices.

Why can't I use several individual files at the same time?

Older devices only accept a single map file in the directory \Garmin. If you want to use several different map areas at the same time, you can use the gmaptool combine into one file. Newer devices, on the other hand, can handle multiple files. Then use added numbers in the filename: Gmapsuppx.img

Why can't I use the road map and the marine map at the same time?

Some simple Garnmin devices with a weak processor only allow one card to be selected for performance reasons. With more powerful devices, several cards can be selected at the same time.

Why is my device sluggish and maps have holes?

Depending on the device model, the device memory may no longer be sufficient for very large maps (from 1...2 GB) and the map is only partially displayed. The high amount of data puts an excessive load on the processor. Divide the map into smaller areas across multiple files. In this way, they reduce the amount of data that the processor has to process and the device reacts more smoothly. Reduce the map area to the area you actually use for navigation. With the polygon function, only areas with water surfaces and their adjacent surroundings can be selected very specifically.

Why are no navaids displayed in road navigation devices?

Road navigation devices do not use the navaid layers. Therefore, these characters cannot be displayed on the map. There is one map service which puts some navaids on layers that can also be displayed by road navigation devices. Alternatively, they switch to a Garmin model that can also display the marine layer.

Further information

https://extract.bbbike.org/

https://www.bootstechnik.de/2017/05/24/seekarten/

https://wiki.openstreetmap.org/wiki/DE:OpenSeaMap_and_Garmin_nautical_chart_plotter#Ger%C3%A4teliste

https://www.gmaptool.eu/en/content/gmaptool

 

Create offline maps with MOBAC

Fig.: Mobile Atlas Creator (MOBAC)

mobile A.tlas Creator (MOBAC) is a Java open source program that provides offline maps for various navigation devices. As a source for an offline map, Mobile Atlas Creator can use a large number of different online maps, such as OpenStreetMap-based maps and other online map providers. In addition to pure navigation charts for vehicles on land, charts for watercraft are also offered.

The online maps are generated from vector data and contain a large amount of individual information. Depending on the zoom level of the map, a different amount of information is displayed. Overview maps at low zoom levels contain less detail than detailed maps at high zoom levels. The zoom levels are divided into different layers (0...18). Each layer is provided with its own map material in the form of many small picture tiles (256 x 256 pixels), which are also referred to as tiles. For example, the fonts and other information are adapted to the respective resolution so that they are reasonably legible. A map consists of a set of layers with different zoom levels, and each layer in turn contains a set of image tiles that cover the map area. Overview maps with a lower zoom level get by with fewer image tiles than detailed maps with a high zoom level. Especially at the highest zoom levels, a lot of image tiles are required, which also takes up significantly more storage space. At the end you get a raster map consisting of many image tiles in the form of PNG images that were generated from vector data.

Fig. Zoom level pyramid with tiles

With MOBAC you can have offline map material produced in different zoom levels and for different sea areas. Different card types are supported. The following shows how to use MOBAC offline maps in GEMF format for AVnav created. In order to simplify the configuration of MOBAC, a map definition is provided that contains special and useful default settings for map creation.

map creation

What is needed

  • the Mobile Atlas Creator (download)
  • Java Runtime Environment version 11 for operating system
  • The card definition
  • Settings in MOBAC
  • Internet connection to download the map material

After the MOBAC has been downloaded and installed, some changes still need to be made.

  • The provided map definition wb-osm.xml from the ZIP into the MOBAC ./mapsources Copy directory
  • In the file SETTINGS.XML in the main directory of the installation the entry for change.
code
"Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"

configuration

As a map we choose now WB OpenSeaMap out.

 

In the area AtlasContent Now let's click on NEW and choose osmdroid GEMF as target format.

First we want to create a small overview map as a test. For this we choose Zoom levels 8, 10, 12 out. For more detailed maps later the  Zoom levels 8, 10, 12, 14, 16 to be chosen. There is no nautical chart material available for zoom levels less than 8 and greater than 16. So that the sea chart does not take up too much memory, it is sufficient to select every second zoom level.

Now we choose from the main menu Selection -> Selection Mode -> Rectangle out.

Navigate to the appropriate section on the map and set the zoom level so that the desired area is visible.

Here I did that for the Netherlands.

Now use the mouse to mark the rectangle for the map section, define a name and then click on Add selection. For the first tests, the map area should not be too large, as the map may require a lot of storage space.

For later, more detailed maps, the polygon selection be used. In this way, you can better adapt the map data to the actual conditions and do not have to download an unnecessarily large amount of data. This is particularly interesting for rivers and coastal regions. The polygon selection limits the maps to areas that are actually navigated and saves the server capacities that are provided voluntarily and free of charge, but have to be paid for in real life. Therefore, be economical with the creation of maps and only create the maps that you actually need.

Now you can take the card with you Create Atlas to be created.

A dialog box opens in which the progress is displayed. After all required tiles have been loaded, the map is created.

In the end it looks like this for my example. About the button Open Atlas Folder you come directly to the generated map.

The map can now be copied 1:1 to the AvNav system.

Magnetic compass for SignalK

Fig.: HWT901B-RS232 9-axis sensor

The Chinese company WIT motion sells various sensor modules on the Internet. In addition to 3-axis, 6-axis and 9-axis modules, pure magnetometers are also offered in a wide variety of designs. A large number of interfaces are supported such as:

  • TTL
  • RS232
  • Modbus
  • Bluetooth
  • WiFi

A particularly interesting sensor is the HWT901B-RS232. This is a 9-axis sensor as a military variant with the following properties:

  • 3-axis acceleration sensor
  • 3-axis gyrometer
  • 3-axis magnetometer
  • BMP280 environmental sensor (temperature, air pressure, humidity)
  • 32Bit CPU for 9-axis sensor fusion
  • Accuracy roll, pitch: 0.05°
  • Accuracy heading: approx. +/-5° (1 sigma)
  • 5…36V supply voltage
  • 40mA power consumption
  • RS232 interface 9600Bd 8N1 (adjustable)
  • Kit includes a USB/serial adapter
  • Binary data format (hex values)
  • 1…20Hz data rate (adjustable)
    • Roll, Pitch, Yawl, Heading
    • long-term stable readings
  • Waterproof aluminum housing IP68
  • Extensive Windows configuration software (from Win7 upwards)
  • Good comprehensible documentation

USB/serial adapter

To connect the HWT901B-RS232 SignalK To be able to use either a serial interface or a USB interface of the Raspi is used. The supplied USB/serial adapter is not easy to use if you use the plug contacts already attached to the sensor, as they can quickly slip off the adapter. But that is sufficient for the first test. It is most helpful later in the boat operation if you solder the cables directly to the connectors of the USB/serial adapter and protect the exposed circuit board with a large shrink tube or insulating tape against accidental short circuits. Alternatively, the adapter can also be accommodated in its own small housing.

Important: RX from sensor must be connected to TX of adapter and TX of sensor to RX of adapter.

Fig.: Serial connection (Wit-Motion)

Fig.: USB/serial adapter with connectors

Fig.: Directly soldered cables

Calibration of the sensor

The HWT901B-RS232 internally calculates the Euler angles with a 32-bit CPU via sensor fusion. In sensor fusion, the measurement data from the acceleration sensor, gyrometer and magnetometer are calculated into a set of three angles that can be used to describe the orientation of a solid body in three-dimensional space. As a result of the sensor fusion, roll, pitch and heading are output as sensor readings. In order for the sensor fusion to work correctly, all individual sensors of the HWT901B-RS232 must be calibrated. The manufacturer offers Windows configuration software for this purpose. With this software, the correction parameters of the respective sensors from the acceleration sensor, gyrometer and magnetometer in all 3 axes are determined by special movements when the sensor is removed and stored permanently in the sensor after calibration. This calibration is called initial calibration. The second step is to install the sensor in the boat. The heading offset and the deviation table are then determined in the installed state. The sensor is then fully calibrated. The initial calibration only has to be carried out once, while the determination of the deviation table always has to be carried out if the installation location of the sensor in the boat has changed or if major inaccuracies have arisen over time.

Initial calibration

For initial calibration, the sensor is removed and connected to a Windows PC via USB. After that the configuration software MiniIMU.exe called.

Fig.: MiniIMU

The Windows PC should be not connected to the internet otherwise the configuration software will be automatically updated in a faulty version. The calibration takes place under Config in 3 steps:

  • Calibration of the acceleration sensor (in a horizontal, stable position)
  • Calibration of the gyrometer (in a horizontal, steady position)
  • Calibration magnetometer (in the form of 3-dimensional movements)

The acceleration sensor and the gyrometer are calibrated in a horizontal, stable position. The sensor must be aligned exactly horizontally and must not be moved. This works best on a flat tabletop. The calibration should not be carried out in the boat.

Great care must be taken when calibrating the magnetometer. In the end, negligence significantly worsens the quality of the magnetic direction value (heading). It must be ensured that there are no metal parts or interfering magnetic fields within a radius of approx. 1 meter. The sensor connection cable is quite short and must be used close to the Windows PC. Keep as far away as possible and stay away from speakers. Small loudspeakers with extremely strong magnets are built into laptops in particular, which you often don't think of. These interference fields can severely affect the calibration of the magnetometer and make it impossible. The best calibration results are obtained with the Elliptical Calibration achieved. To do this, the sensor is moved freely in the hand at a height of 50 cm from the tabletop in all 3 axes so that elliptical point clouds are created for the 3 spatial planes XY, XZ and YZ, the edges of which are sharply defined as in the picture see.

Fig. Correct calibration of the magnetometer

During calibration, the sensor always has to be rotated slightly differently in space until the edges of the ellipse are evenly marked with measuring points. The calibration progress can be monitored quite well via the live graphics. If individual measuring points appear clearly outside the edge of the ellipse, this is a sign that the calibration did not run correctly and that interference fields are present. It takes about 3 to 5 minutes to collect enough measuring points. The calibration of the magnetometer can also be repeated later in the boat if necessary. However, the calibration of the accelerometer and the gyrometer must never be carried out in the boat.

Setting the transmission format

In order for the data to be recognized correctly by the SignalK plug-in, the sensor must be set so that only angle data is sent. Only the 'Angle' record will do this under Config activated. To be on the safe side, the plugin automatically resets this setting every time it is started. All other values are left at the default values. The default baud rate of 9600 is sufficient for up to 50 data records per second (output rate: 50Hz) and must not be changed.

Fig.: Broadcast formats

Integration into SignalK

The sensor can easily be integrated into SignalK via the plugin signalk-hwt901b-imu include The supplied USB/serial adapter is used for this and the sensor is connected to the Raspi via USB. In the configuration of the plug-in, the appropriate USB device is selected and the desired transfer rate is set.

Fig.: SignalK plugin for HWT901B-RS232

The 'Return Rate' transmission rate determines how many measurements per second should be transmitted to SignalK. The heading offset can be adjusted to set the installation direction of the sensor in relation to the bow. The acceleration sensor as well as roll and pitch can also be directly calibrated or set to zero via the plug-in. However, this is only advisable if the boat is in an absolutely quiet position.

Determination of the heading offset and the deviation table

The last step of the calibration takes place when the sensor is permanently installed in the boat. The following things should be considered during installation in order to achieve the best results:

  • Place the sensor away from:
    • metal parts
    • power lines
    • Magnetic interference fields such as loudspeakers or mechanical compasses
  • Attachment in the middle of the boat
  • Attachment if possible in the pivot point of the boat
  • If possible, horizontal or vertical installation (no inclined installation)

An ideal installation location would be the cabin ceiling behind the mast at the ship's pivot point or on the forward bulkhead in the boat. Whether the installation location of the sensor was selected correctly can only be determined after the deviation table has been determined. The location of the sensor may have to be changed again and the calibration repeated.

The deviation table can be created in different ways. You always need a GPS receiver as a heading reference, such as a cell phone with a corresponding app that can display the heading.

The deviation table is either determined manually by driving courses in 20° steps over a distance of approx. 100m and assigning the measured value from the sensor. The boat should have a speed of at least 2..3 knots so that the GPS receiver outputs reliable heading values. The data rate from the magnetic sensor and from the GPS sensor should be identical to avoid problems with the evaluation. A data rate of 1 Hz is sufficient for data recording. In addition, the speed should be as constant as possible. The determined data can be recorded in an Excel spreadsheet and later calculated.

Another variant would be to continuously save the heading values of the sensor and the GPS receiver while driving and to subsequently calculate the recorded values in an Excel spreadsheet. To do this, you would drive the boat 2 circles to the right and 2 circles to the left. The circles should have a diameter of approx. 200 m and the speed of the boat should be constant at 2...3 knots. The data should be discarded for short, quick turns, since the GPS sensor is somewhat slower than the magnetic sensor. This method gives the best results because there are measured values for all direction values. If you use SignalK, you can activate the plugin for the InfluxDB database and have the data recorded there. With Grafana, the measurement results can then be monitored and assessed during the test drive.

Fig.: Representation of the measured values in Grafana

At the end, the recorded values are used to create a table and a diagram in which the deviations of the magnetic sensor are plotted against the reference values from the GPS sensor. It is also very helpful to record the heading values of both sensors in a diagram.

Fig.: Magnetic deviation from GPS (uncorrected)

Fig.: Magnetic compass and GPS compass heading (uncorrected)

If possible, you should get a straight line in the diagram that has no bumps. Large bumps are a sign of interference fields or metal parts around the sensor. The deviations should not be more than +/-20°. If the values are higher, a different installation location for the magnetic sensor is recommended. On steel boats it may be necessary to mount the magnetic sensor outside the hull.

heading offset

The heading offset can be seen in the following diagram. It is the angle difference across all angle values versus the GPS value. The misalignment is referred to as the heading offset and is given in values of up to +/-180°. This value is set in the plugin signalk-hwt901b-imu under Heading Offset registered.

Fig.: Heading Offset uncorrected

deviation table

In order to be able to correct the sensor raw data from the HWT901B-RS232, we use the SignalK plugin Calibration. With the plugin, any sensor values can be corrected by creating a correction table. The measured value and the value that you want to receive as the corrected value are always entered. However, it must be ensured that the values are entered as radians (multiples of PI). Degrees cannot be used because SignalK internally uses ISO units and uses all angle data as radians. Under Path In our case, the SignalK-Path for the magnetic sensor is entered. as Source WT.1 must be specified. Contrary to the plugin description, the value for Period must be left blank, otherwise the measured values will not be corrected correctly. Apparently the plugin is faulty at this point.

Fig.: Deviations table in the calibration plugin

Calibration check

After the HWT901B-RS232 magnetic sensor has been calibrated, the measurement results can be checked again. For this purpose, the same measured values are recorded as when determining the deviation table. The errors should be less than +/-5° at the end. If this is not the case, the complete calibration should be repeated and, if necessary, a new location for the sensor in the boat should be selected.

Fig.: Magnetic deviation from GPS (corrected)

Fig.: Magnetic compass and GPS compass heading (corrected)

Sail Instrument Plugin for AVnav

The idea of this AVnav plugin is to display an instrument that contains all the basic information needed for sailing. With the possibility of showing this display directly on the map at the boat position, the sailor has all the information at a glance. The laylines give you the quickest bearing to a waypoint upwind, and when displayed on the chart you can follow those lines.

If you want to know what laylines are, you can find some information here:

https://www.blauwasser.de/navigation/app-sailsteer-bandg

https://www.bandg.com/de-de/blog/sailsteer-with-mark-chisnell/

Fig: Sail Instrument Plugin for AV nav

The inspiration for the instrument is based on B&G's Sailsteer instrument. There is a project on GitHub for the Sail Instrument where you can find all the important information about the plugin.

https://github.com/kdschmidt1/Sail_Instrument

 

 

Anchor light automatic with Shelly 1

Fig. Shelly 1

Anyone who anchors is obliged to set an anchor light so that you can be recognized on the open water surface in the dark. Typically, the light is switched on manually at dusk and off again at sunrise. There is no problem switching it on. But you often forget to switch it off and the anchor light is then permanently on and consumes electricity unnecessarily.

With a Shelly 1, an automatic anchor light can be built that can switch the anchor light on and off independently. To do this, the Shelly obtains the time from the Internet and calculates the sunrise and sunset times and switches the anchor light accordingly. For this to work, the following conditions must be met:

  • Shelly V1 or V3 with original firmware
  • Permanent WiFi connection to the internet via port WiFi or mobile internet router to get the current time
  • Permanent power supply of the Shelly 1 with 12V (0.08W stand-by relay off, 0.2W relay on)
  • Connection of the switching contact from the Shelly with the switch for the anchor light (parallel connection)

The project is aimed at laypeople with little experience. The Shelly does not have to be modified or rebuilt for this. It is used as purchased and the main work is to configure the Shelly and connect it to the boat's electrical system. No major modifications will be made to the existing electrical system and an existing switch for the anchor light can continue to be used as before. The instructions presented here only work for the Shelly 1 V1 and V3. The Shelly 1 V2 cannot be used because the switch contact is not potential-free.

Basically, the Shelly can be used in two operating modes. Once with a cloud connection and once without a cloud connection. A cloud connection is not necessary for our project and the automatic anchor light also works without it. If you want to control or switch the anchor light from home via the Internet, you can also use the cloud. If you enjoy it, you can also use the Shelly1 via the cloud Control Amazon Alexa or Google Home with voice commands. The following description shows how to prepare the Shelly for the automatic anchor light.

Set Shelly to 12V supply

When delivered, the voltage selector is set to 230V AC. We have to set the jumper to the position for 12V according to the picture and supply the Shelly with 12V via N and L. But watch out! N is not equal to ground but 12V, whereas L is ground. On average, the Shelly consumes only 0.08W when the relay is not activated. However, this only works if the latest firmware V1.11.8 or newer installed and Eco mode activated.

Fig: Meaning of the pin headers

 

Fig: Assignment of the supply voltages for 12V

 

Bring Shelly 1 into your own network

How this works in detail is explained in ShellyDocumentation sufficiently well described. A static IP address does not have to be assigned. The field can remain disabled. If a usable port WiFi is available, you can use its login details. In order to be able to use the automatic anchor light regardless of location, we recommend connecting to the Internet via a mobile UMTS or LTE router. Alternatively, a disused mobile phone can also be used in hotspot mode.

 

Fig: Start page

Fig: Internet & Security page

Danger! You have to be careful when entering the network parameters. If you entered the WiFi SSID or password incorrectly, you will lock yourself out and no longer be able to connect to Shelly. A hard reset to factory settings is only possible via a cumbersome procedure. To do this, you have to switch the power supply off and on again and then press the switch at the SW input 5 times within one minute. The right timing is a matter of luck and requires several attempts to be successful. In the worst case, the Shelly can no longer be activated and you have to flash the firmware again. How to do that is in this one Flash guide described.

After the Shelly is in the network with Internet access, you should update the firmware, since the Shelly has been on the market for a long time and some models with old firmware are still available. The latest firmware offers some more functionalities and has been corrected for errors. The firmware update can be found at Settings ->Firmware update make.

Fig: Firmware update

Set the source of the system time

By default, the time is automatically fetched from the Internet and the correct time zone is set, provided there is an Internet connection. At the top right of the start page you can check whether the system time is set correctly. If this is not the case, you can go to Settings -> Time Zone and Geo Location make the necessary settings.

Fig. Setting the source of the system time

The Shelly does not require a permanent internet connection to update the time. It is sufficient to fetch the system time from the Internet once after the start. A port WLAN is completely sufficient. The time continues to run in Shelly even without internet. However, you should be careful not to switch off the Shelly without an Internet connection, otherwise the time cannot be fetched when you restart and the switching function can no longer be carried out correctly.

Set switching function

Via the configuration page Weekly schedule the switching function for the anchor light can be set. A timer is added for switching on and off and fixed times are set, or you can also use the sunrise and sunset times as a source. This is very practical, as the switching times are automatically adjusted to the actual position of the sun. If you want, you can change the switching times individually with an offset.

Fig: Set switching functions for sunset and sunrise

Fig: Settings for sunset

Fig: Setting for sunrise

Automatic anchor light circuit

Depending on the type of Internet access for the Shelly, you must either connect the power supply of the Shelly directly to the main switch or you can use a group switch on the control panel such as the refrigerator switch. The Shelly's potential-free switching contact is switched on the control panel in parallel with the switch for the anchor light. You can switch the anchor light either via the Shelly or directly via the switch on the control panel, whereby the switch on the control panel always has priority and can override the switching status of the Shelly. There is a problem though, when the Shelly has the anchor light on, you can't turn it off with the switch on the control panel. Either you then de-energize the Shelly or deactivate the switching states in the Shelly.

Fig: Automatic anchor light circuit

Additional information

A few other functions on board can be automated in a similar way, such as heating, ventilation, battery charging or bilge drainage. Anyone who has activated the cloud connection can then also control all functions remotely via the Internet and, if necessary, be informed by e-mail. For the Shelly 1 can be found at Thingiverse 3D printing templates for a DIN rail holder. In this way, the installation can be carried out professionally in a sub-installation.

Fig: DIN rail holder for Shelly 1 with temperature addon module

Here is some additional information about Shelly:

 

 

Lilygo T-Watch 2020 with connection to SignalK

Fig. Lilygo T-Watch 2020 (Lilygo)

 

Jan Dytrych has started a software project to be able to display data from SignalK and receive alarms with a smart watch. Not just any common clock under Android is used as a smart watch. He uses the smart watch Liligo T Watch 2020. The special feature of this clock is that it has an ESP32 installed as a processor and can be programmed via the Arduino IDE or PlatformIO. The manufacturer Liligo supports the watch with a number of libraries that make programming much easier.

The Liligo T-Watch 2020 has the following components:

Fig. Hardware Lilygo T-Watch 2020 (Lilygo)

  • CPU: ESP32, dual-core MCU, 240MHz
  • FLASH: QSPI Flash 16MB
  • SRAM: 520KB SRAM / PSRAM 8MB
  • WiFi 802.11bgn 2.4GHz
  • Bluetooth 4.2 BR/EDR, BLE
  • Display: 1.54 inch color TFT, capacitive touchscreen, 240 x 240 pixels
  • 3-axis accelerometer BMA423
  • RTC clock: PCF8563
  • IR receiver
  • speaker
  • Button: power button
  • USB to TTL: CP2104 (Micro USB)
  • Lithium battery 380 mAh, 3.7 V, exchangeable Type: YX-W9A
  • Operating temperature range: -40 ~ +85 degrees
  • metal body
  • Water tightness none
  • Silicone strap 270mm
  • Weight: 58.5g

A USB cable is supplied with the T-Watch 2020, which can be used to charge the watch and transfer programs. The watch has an aluminum metal case and the design is based on the Apple I-Watch. The watch is comfortable to wear with the non-replaceable silicone strap. The only weak point is that the watch is not waterproof.

Properties of the firmware

The firmware for the clock is at GitHub hosted and has the following features:

  • Clock function main screen with status bar
  • Setup screen for Date, Time, Alarm time, WiFi, SignalK
  • Custom screens for values from SignalK
  • SignalK events wake up the clock and display messages
  • Sleep mode with display off for long operation up to 24 hours
  • Wake up the display with a tap or twist of your wrist
  • Day/night mode via double tap
  • Language customization via source code
  • pedometer

Fig. Start screen, warning message and SignalK values

Settings and Configuration

The basic settings can be made on the watch via the display. The program is available for designing user-defined image content for SignalK values TWatchSK Designer for Linux, Mac and Windows. This makes it very easy to create new display pages for SignalK and transfer them to the clock via a USB connection. The configurator allows a wide variety of representations and color selection for the values to be displayed.

Fig. TKWatchDesigner with result

Conclusion

With his open source software project, Jan Dytriych has developed a cool application with which it is possible to view and monitor data from SignalK on the wrist. The alarm messages in particular are a useful function for being informed about limit value violations. The project is very well documented on Github and those interested should find all the necessary information. With the T-Watch 2020, Lilygo has provided interesting hardware for little money, with which a large number of projects can be implemented. The use of the popular CPU ESP32 simplifies software development for makers, as they can develop in familiar environments with known knowledge. The only downside of the T-Watch 2020 is that it is not waterproof. Whether this is a KO criterion remains to be seen in practical use on the boat. Let's hope that Liligo will also release a waterproof T-Watch in the future.

Left

Project Homepage: https://github.com/JohnySeven/TWatchSK

TWatchSK Designer: https://github.com/JohnySeven/TWatchSKDesigner#twatchskdesigner

Lillygo T Watch 2020: http://www.lilygo.cn/prod_view.aspx?TypeId=50053&Id=1380&FId=t3:50053:3

pictures

Fig. Lilygo T-Watch 2020 (Lilygo)

Fig. Opened cover, lithium battery on the right

Magnetix - a digital compass with NMEA2000

why

I've always found the idea of not only showing the course on my plotter when the boat is moving, but also when it's bobbing along quietly, I've always found it exciting.

After searching the I-Net for different manufacturers, it quickly became clear that I might not need an e-compass on board at current prices. Due to the corona restrictions and the more free time being spent at home, the idea of building the compass myself came up.

The construction of the electronic compass with an output to the NMEA2000 network was inspired by a post by Andreas in the "segeln-forum.de" forum.
Thanks to many tips in different forums, it was successful. The compass is ready, but not yet tested on the boat (status: 2022.01).

description

Magnetix is an electronic compass that transmits its data on the MNEA2k bus. A CMPS14 serves as a basis as a sensor, an ESP32 as a calculator, a Waveshare SN65HVD230 (don't forget to break out the resistor) as a link to the bus and an LM2596 as a voltage converter. A 0.91 inch OLED with 132×32 pixels is used for the display in the housing.

The housing for the electronics is a Bocube from "www.bopla.de". Both the bracket and the housing were 3D printed for the sensor. The brackets for the OLED and the touch sensors (VA screws) were also created with a 3 printer.

The connection between the compass sensor and the ESP is made via a KAT5 network cable, in which two cables are always connected to form a pair. Although the protocol between the CMPS and the ESP is a short range protocol (I2C), I have no problems with a cable length of ~70cm

Power is supplied via the NMEA bus and is ~1LEN. A built-in plug from Techno-Spark is used to connect to the network.

The ESP gets the data via the I2C bus, converts the whole thing into an NMEA2K data set (127250) and sends it to the network.

The compass identifies itself on the bus as "Magnetix Alpha" and can also be found under that name in the network's sources.

variables in the code

Complete source code https://open-boat-projects.org/wp-content/uploads/2022/01/compass_NMEA2k_V05_01.zip
https://open-boat-projects.org/wp-content/uploads/2022/07/compass_NMEA2k_V05_02.zip
devotion []
is an array with 36 possible entries. A deviation table can be stored in it, which automatically corrects the given course for the respective courses.
CorrectionMountingAngle
This can be used to set a - horizontal - correction for a deviation of the compass line from the boat axis.

[-] Values for a port correction

[+] Values for a starboard correction

service

Operation is limited to the two touch surfaces (screws):

touch surface function
1 Autocalibration on / off
2 autocalibration off Save performed calibration
1 & 2 initiate new calibration

screen

The display is divided into three areas:

Left (in 90° rotated font)
Current function of the sensor
"calib" the sensor is currently being calibrated, which was triggered by touch 1&2.
"inacc" if the sensor is not fully calibrated (not all sensor responses are 1) “inaccurate” will appear. The HDM data was not switched off, as messages 0 occur very often.

It may have to be adjusted after field tests on board

"ON" The sensor is in "autocalibration" mode
OFF The "autocalibration" mode is switched off
center
S Sensor system status followed by two numbers
A. 'Status of the accelerometer
M Magnetic sensor status
The three details are each specified by the following numbers:
00 nothing is OK
11 everything OK
01 or 10 partially OK
(Unfortunately, what these numbers mean exactly is not clear from the documentation of the CMPS14)
Right of the line
M Magnetic course (after pressing T2, “…stored…” [v5.02] appears for 2 seconds)
R roll of the sensor
P pitch of the sensor

construction and assembly

I built the whole thing in a standard housing in which I built a base plate as a support for the perforated plate and the voltage converter. The only thing to note when assembling is that the terminating resistor on the CAN module (Waveshare SN65HVD230) has to be broken out. Otherwise the Waveshare SN65HVD230 terminates the entire NMEA bus. The wiring can be in the Circuit diagram to be checked.

Unfortunately, in the first version, I placed my brackets for the display and the touch surfaces flush with the upper edge of the case. However, since the cover “pulls” itself completely over the lower housing, it no longer closes. 🙁

updates

2022-03-01 New bracket for the case with a wall bracket to compensate for a wrong horizontal installation -> Thingiverse
2022-07-02 After some testing I noticed that the sensor starts again from zero after a power loss (despite having saved the calibration). I have now changed the touch surfaces so that T2 saves the previously performed calibration. After the first tests with a restart of Magnetix it seems to be working now. (V5.02)

libraries

the libraries used appear in the header of the INO file and are not discussed further here.

Links and Materials

All 3D printing components https://www.thingiverse.com/thing:5207953
ESP-32 Dev Kit C V4 https://www.az-delivery.de/products/esp-32-dev-kit-c-v4
CMPS14 datasheet
Wave share SN65HVD230 https://www.amazon.de/gp/product/B00KM6XMXO/ref=ppx_yo_dt_b_asin_title_o01_s01?ie=UTF8&th=1
0.91 inch OLED I2C display 128 x 32 pixels https://www.az-delivery.de/products/0-91-zoll-i2c-oled-display
LM2596S DC-DC power supply adapter step down module https://www.az-delivery.de/products/lm2596s-dc-dc-step-down-modul-1
PCB Board Set breadboard breadboard circuit board https://www.az-delivery.de/products/pcb-board-set-lochrasterplatte-platine-leiterplatte-4×4-stuck
casing https://www.bopla.de/gehaeusetechnik/product/bocube/pc-ul-94-v0-glasklarer-deckel.html

However, I can't find my measurements in the list there!

PG - bushings https://www.conrad.de/de/p/kvpg9gr-kabelverschraubung-verschraubbar-mit-zugentlastung-pg9-pg9-polyamid-grau-1-st-1521121.html

(think of mother)

Micro-C chassis connector https://technospark.de/nmea-2000-panel-mount-connector?number=SW1153
basics This year's winter tinkering: A NMEA heading sensor or electronic compass pitch and roll compensated

https://www.segeln-forum.de/thread/66453-diesj%C3%A4hrige-winterbastelei-ein-nmea-heading-sensor-oder-auch-elektronischer-komp/?pageNo=1

touch functions https://www.wiegleb.org/2018/09/22/esp32-ttgo-mit-touch-funktion/
NMEA basics AK Homberger Workshop (ESP -> NMEA2k)

https://github.com/AK-Homberger/NMEA2000-Workshop

Examples I2C NMEA https://www.robot-electronics.co.uk/htm/arduino_examples.htm#CMPS12/11%20I2C

https://www.robot-electronics.co.uk/files/arduino_cmps12_i2c.ino

gallery

qtVlm navigation and weather routing software

Where the name qtVlm for the navigation and weather routing software comes from is not known. In any case, qtVlm is worth a look for those who are looking for a freeware navigation software with basic functions. Depending on further wishes, the software can be expanded with add-ons that are subject to a fee. If you need it, you can also book telephone or email support for a fee. The software is available for the following operating systems:

  • Linux PC
  • Linux Raspi
  • Mac
  • Windows PC
  • Android app
  • Android wearables (smart watches)

Suitable maps are:

  • Vector Maps (S57, S63)
  • Raster maps (kaps, geotiff, mbtiles)
  • Grib weather maps as an overlay
  • Current data as an overlay

Functions:

  • route routing
  • weather routing
  • Collision warning via AIS
  • regatta features
  • Display of sensor data
  • Performance optimization with polar plot data
  • NMEA multiplexer with input and output

qtVlm can process the following on signal sources:

  • NMEA0183 In/Out over TCP/UDP
  • NMEA0183 In/Out via USB, RS232
  • AIS as NMEA0183
  • GPSd over TCP

In addition to an integrated NMEA multiplexer, filter functions can also be defined for the respective signal sources. However, as with OpenCPN, operation is designed for desktop applications and requires a mouse and keyboard. In the Android app, many setting functions are optimized for touch operation.

This is what the makers of qtVlm say about their software:

“Many options are available, such as B. Multi-routing to find the best date and departure time according to different parameters, routing on a path or considering motorized segments. Winds, currents and waves and some other weather variables are used during the calculation. Boat performance can be fine tuned, for example polar efficiency at night or the time it takes to tack or gybe. Multiple grib files can be loaded simultaneously to route with different parameters (e.g. wind, current and swell) or to compare grib models. Weather fax images can also be loaded onto grids. A start line mode maintains a regatta start line with chronometer, distance and time calculations, and displays a safe zone. qtVlm can also be used in simulation mode. In this mode, qtVlm uses wind and current data from grib to simulate navigation. All instruments are usable and real live AIS targets are received from the internet. Be careful not to collide with a real fishing boat or any other qtVlm boat!”

Conclusion

Freeware is not the same as open source. Anyone looking for open source software for navigation applications is wrong with qtVlm. Nevertheless, it is worth taking a closer look at the program, as it offers a very extensive range of functions and some extras for regatta sailors and long-distance sailors. The good one deserves special mention English language documentation which describes in detail all functions of the program. The program is based on Qt and is therefore available for all common operating systems. However, the desktop versions require a mouse and keyboard and are intended more for applications at the card table. With the Android app, the program is also available for tablets and can therefore also be used directly at the helm. Using the NMEA Out function of the multiplexer, for example, server data can be forwarded from the Raspi to the Android app on the tablet. This means that the same data is available both at the chart table and at the helm station.

Link to website: https://www.meltemus.com/index.php/en/

Air pressure level sensor

Fig. Control box with pump, pressure sensor and valves

In the Facebook group Raspberry Pi for Boats I saw a cool solution for level measurement. Erik from Finland constructed a monitoring system for 4 tanks with an air pressure sensor. The functional principle is based on the displacement of liquids in a measuring tube. A corresponding air pressure then builds up in the measuring tube, which is proportional to the level. The system uses a pump that builds up pressure in a hose system until the air flows out at the end of the hose in the tank. Depending on the length of the hose, the pump works for between 5 and 10 seconds, after which the static pressure in the hose system is measured, which is proportional to the static pressure of a column of liquid. So that you can control 4 tanks, 5 valves are built into the system, which establish a connection to the respective tank from which you want to determine the fill level. With this cool solution, he circumvents the problem of pressure loss in the hose system, because before each measurement he briefly starts the pump and refills the air that has escaped. At that time I had also experimented with hose systems and considered the solution to be unusable because I could not compensate for the pressure loss. The problem was that air has a very low density and can diffuse through hoses or escape at hose connectors. The air pressure can then not be maintained for several days or weeks. You can get around this by using continuous metal lines without connectors, which then makes the whole thing more complex. At the time I was involved in my project Engine diagnosis decided to install the pressure sensor directly in the tank and measure the liquid column directly.

Erik's solution has the advantage that there are no dangerous voltages on the tank and, in principle, you can monitor any number of tanks with the method. He uses a Raspberry Pi as an evaluation unit and displays the measurement results on a website. He housed all the electronics on a simple strip circuit board. Erik has the project on his Homepage described.

You can find one in the sailing forum interesting discussion with further information on this topic.

Fig. Pneumatic system structure

 

Fig. Hose end in the tank

 

Fig. Pump and valve control

Fig. Display and control unit

Volvo Penta NMEA2000 interface

First of all, a few important notes that you should definitely pay attention to.

Disclaimer: The descriptions of the wiring and the pin assignments correspond to what I found in my boat. Therefore, if you want to recreate the interface, you have to make sure that the wiring and pin assignments on your own boat are identical or adapt the interface accordingly. The entire description of this solution is in an experimental state and comes without any guarantee. Changes to the cabling of the boat or the electrical and electronic conditions can lead to damage or critical situations. You do so at your own risk.

 

General

The basic installation of a Volvo Penta engine (engines D1 and D2) with EVC consists of various sensors on the engine that are connected to the EVC / MDI (electronic vessel control / motor data interface) are connected. These data are sent from the MDI to the speed instrument via a CAN bus. Often there is only the tachometer with a small LCD display to show data. However, additional instruments can be purchased and connected behind the rev counter via the so-called Easy-Link.

 

 

 

The speed is displayed continuously. Other values, such as cooling water temperature and charging voltage, are only alerted in the event of an error, but are not displayed continuously. The interface described here connects the engine's CAN bus with an NMEA2000 bus. The information in the VP-CAN bus, which is available as J1939 datagams, is read, evaluated and written to the NMEA2000 bus as NMEA2000 datagrams. The data implemented so far are

  • Engine speed
  • Charging voltage
  • Cooling water temperature
  • Engine hours

In the NMEA2000 bus, the information can be displayed, for example by a plotter, and provided with warning levels.

When my boat was transferred over the Unterems in the direction of DEK, that saved me from very big problems. Due to the large amount of sediments in the Ems, the outer cooling circuit was increasingly clogged. Via my plotter (MFD) I was able to notice the temperature rise early on and react accordingly. Without the interface and the display in the MFD, the alarm would have come at some point, and then I would hardly have had any options for action, that there would have been no opportunities to moor or anchor. I should have continued driving with the risk of the machine overheating.

 

Components

The Volvo Penta - N2K Interface consists of hardware and software components.

hardware

To physically connect the interface to the VP-CAN bus of the engine, you need an adapter cable with a Y-branch. The connection of the cable from the MDI to the tachometer are so-called 6-pin 'Deutsch plugs', male and female. (e.g. https://www.kabelschuhe-shop.de/KALI-1206-DEUTSCH-DT-Steckverbinder-Set-6-polig). You connect the six pins of the plug with those of the socket. In addition, one derives 12v +, GND Can high and CAN low.

In order to physically connect the interface to the N2K bus (either Seatalk NG or NMEA2000), you also need a suitable cable. My interface is connected to a Raymarine Seatalk NG network. So I cut through a STNG standard spur cable to get a cable with a plug and an open end.

 

CAN bus transceiver

I use an SPI-MCP2515-CAN-Transceiver-TJA1050 to connect the interface to the engine's CAN bus at protocol level. This transceiver is controlled by the MCP_CAN_lib from Cory J. Fowler.

To connect the interface to the N2K bus at the protocol level, I use a Waveshare SN65HVD230. This transceiver is controlled by Timo Lappalainen's NMEA2000 library.

Since the ESP32 requires a voltage supply of 5V and the CAN bus is supplied with 12V, you also need a stepdown converter to 5V.

 

 

software

The code is available here: https://github.com/buhhe/VolvoPenta-N2K_Interface

It is based on code from:

Timo Lappalainen https://github.com/ttlappalainen

Andreas Koritnik https://github.com/AK-Homberger

Cory J. Fowler https://github.com/coryjfowler

 

These libraries are required:

https://github.com/coryjfowler/MCP_CAN_lib

https://github.com/ttlappalainen

 

 

Volvo Penta - N2K Interface: How to proceed

  1. Obtain the hardware components
    • ESP32 development module
    • MCP2515 CAN transceiver
    • SN65HVD230 CAN transmitter / receiver
    • DC-DC step-down converter 5V
    • A pair of 6-pin "Deutsch plugs" (male / female)
  2. Create the Y-branch cable. (See page 3)
  3. Carry out the wiring. (See page 4)
  4. Obtain the required libraries.
  5. Compile and flash the software.
  6. Install everything on your boat.
  7. Have fun!

 

Connection of the interface to the VP CAN bus

 

The tachometer with integrated LCD display is connected to the engine's MDI via a cable harness and a 6-pin Deutsch connector. The connection is called “Multi-Link” at Volvo Penta. The data are provided as CAN-based J1939 datagrams.

 

 

A Y-branching cable is required for connection to the bus. The cable is connected between the connector of the cable harness and the speedometer.

 


Pin assignment:

  • 1 not used
  • 2 CAN low
  • 3 not used
  • 4 minus
  • 5 CAN high
  • Plus, 5V

 

cabling