NMEA2000 and ESP32
NMEA2000 is increasingly replacing NMEA0183 as the standard. Unfortunately, NMEA2000 is a very complex protocol and for a long time it was hardly possible to realize your own projects. That has changed with the NMEA2000 library by Timo Lappalainen (https://github.com/ttlappalainen/NMEA2000).
The library supports different microcontrollers, including the ESP32. The ESP32 from Espressiv is very powerful and, thanks to WLAN and CAN bus interface, ideal for your own projects.
The projects described here use the NMEA2000 library and the ESP32 (ESP32 NODE MCU). Programming is very easy in the Arduino development environment.
The projects are documented in detail on GitHub (including hardware and software): https://github.com/AK-Homberger.
The following projects have been implemented so far and can easily be copied or modified / expanded:
- NMEA2000 to NMEA0183 WiFi Gateway
- NMEA2000 M5Stack Data Display
- NMEA2000 Data Transmitter
- NMEA2000 Data Recorder
The essential components for the trade fair were put together on a demo board. This allows the interaction of the components to be clearly illustrated:
The Seatalk autopilot remote control is also included on the demo board, but is explained on a separate page (https://open-boat-projects.org/diy-fernbedienung-fur-autopilot-raymarine/).
The simulator board is only for the trade fair and is used for demonstration purposes. It receives simulated data from a PC via USB-serial, converts them into NMEA2000 PGNs and sends them to the CAN bus. The simulator was built with the ActisenseListenerSender realized by Timo Lappalainen. The WiFi gateway receives the NMEA2000 data from the CAN bus and thus supplies other exhibits on the exhibition stand with simulated data.
NMEA2000 to NMEA0183 WiFi Gateway
- The WiFi gateway receives the data from the NMEA2000 CAN bus and converts it to NMEA0183.
- The NMEA0183 data are provided via WLAN (NMEA0183 via TCP, port 2222).
- The data can be displayed / used by many components. For example: OpenCPN, AVnav, tablet with NMEA software, . ).
- The gateway also delivers the data in JSON format. The data can then be viewed wirelessly with the M5Stack data display.
- The project on GitHub also contains a NMEA0183 multiplexer (serial input for AIS data) and voltage / temperature monitoring. However, these functions are optional.
M5Stack and AVnav on 7 ”car radio with data from the WiFi gateway:
NMEA2000 M5Stack Data Display
- The M5Stack is a finished product with an ESP32 and housing. The integrated display, the built-in rechargeable battery and the buttons make it particularly suitable for displaying NMEA data.
- The version of the Data displays (top left) receives the data wirelessly from the WiFi gateway in JSON format.
- The data types can easily be expanded. So far, the following data is displayed: LAT / LON, COG, SOG, heading, STW, rudder angle, water depth, triplog, sumlog and the data from the NMEA2000 data transmitter: temperature, diesel tank and engine speed.
- On GitHub A version of the display is also available that reads and displays the data directly from the NMEA2000 bus. Optionally, the M5Stack module also functions as a WiFi gateway. This means that an NMEA2000 to NMEA0183 WLAN gateway can be implemented without soldering.
NMEA2000 Data Transmitter
- The NMEA2000 Data Transmitter measures different values in the boat (here temperature, tank level, engine speed) and sends them as NMEA2000 data.
- This NMEA2000 data can be received and displayed by almost all modern multifunctional displays.
- The temperature is measured by a DS18B20 sensor (can be easily expanded with additional sensors).
- The circuit on GitHub is designed for a TGT 200 tank sensor from Philippi (resistance 5-180 Ohm).
- The engine speed is measured on the alternator (terminal W).
- The circuit and the program can easily be expanded for further measurement data.
- For the demo board, the tank level and the engine speed are simulated using potentiometers.
NMEA2000 Data Recorder
- The NMEA2000 Data Recorder reads all data from the NMEA2000 bus and saves it on an SD card.
- The data can be saved in different formats: NMEA0183, Seasmart, Actisense).
- In addition to the ESP32 (here Node MCU), only an SD card and a CAN bus transceiver are required.
- An M5Stack module can also be used as an option. This already contains an SD card reader.
- The data recorder is not included on the demo board.
Neueste Beiträge
NMEA 2000 Wi-Fi Gateway YDWG-02
The NMEA 2000 Wi-Fi Gateway allows you to see data from a NMEA 2000 marine digital network on a PC or smartphone. With it, you get marine network data including vessel course, speed, position, wind speed and direction, water depth, AIS messages from vessels and aircrafts and other navigation data in popular software applications.
The Device creates its own Wi-Fi network (with range of about 30 meters in open spaces) or it can be connected to an existing Wi-Fi network. In the second case, the coverage depends on coverage of the base network; laptops and PCs can be connected to Wi-Fi routers (and the Gateway) by Ethernet; and you can configure remote access to a Gateway over the Internet.
Picture 1. EDO Instruments and AirMar OnSiteWX on iPad4 Mini
To configure the Gateway, you need any Wi-Fi enabled device (laptop or smartphone) with any web browser. The Device’s settings can be reset to the factory values using the hidden reset button.
The Gateway supports TCP and UDP network protocols (both can be enabled at the same time). For UDP protocol, the number of clients (physical devices or software applications) is unlimited.
Picture 2. SEAiq Open IPhone app connected to YDWG-02
The Device has a bi-directional converter between NMEA 2000 and NMEA 0183 protocol. NMEA 0183 protocol is widely supported in marine applications dating back to last millennium. So the Device is compatible with virtually all marine mobile applications (except applications especially designed for use only with specific hardware) and with most popular PC applications.
Pictures 3-7. Built-in web gauges (IPhone screenshots)
Moreover, you do not need to install applications to view realtime vessel data. We added colorful, web-based gauges to built-in administrative web site, and now you can view wind, engines and fuel rate, pressure of oil, coolant and fuel, tanks and batteries (or using circular gauges), course, speed, depth and other data right from a browser. You can customize any page’s layout and its sets of data bars. You can even watch NMEA logs! Save on apps, save on additional instrument displays and monitor your boat from your sofa with a smartphone! No internet connection is required and it is free. See this guide to learn more about the built-in web gauges. Or see this video!
Pictures 8-12. Screenshots of administrative web site (use slider)
The Gateway automatically records your track with weather, depth and other data to the internal memory (up to 16256 points). These data can be saved from the internal web site to GPX (for Garmin MapSource, Google Earth or other cartographic applications) or CSV (spreadsheet) files.
If the Gateway has an internet connection, it can automatically upload recoreded data to Cloud Service. Cloud Service allows easy access to your tracks or monitor your boat from home and lets you share your position with family and friends. To learn more about Cloud Service, read this article or visit: https://cloud.yachtd.com/
The Gateway also supports RAW protocol, which is supported in a popular Expedition software and CAN Log Viewer. It allows transferring of any NMEA 2000 messages (including proprietary) to application and in reverse direction. You can record messages to a .CAN file and/or monitor in real time with free CAN Log Viewer software (Mac OS X, Windows, Linux). It can be useful for NMEA 2000 or J1939 networks setup and troubleshooting.
The recorded .CAN file can be converted to a .DAT format and processed with YDVR Converter software to convert NMEA 2000 data to GPX tracks, spreadsheets and other formats. Of course, it is not as convenient as recording data with the Voyage Recorder, but it is suitable for tests and trials, etc.
The RAW protocol is open and is supported also in our USB Gateway. We hope that it will become popular among software developers, because it is very simple and free.
- can duplicate or replace broken instruments or complement obsolete instruments;
- has built-in web gauges, only a browser is required to view realtime vessel data and manage digital switching loads;
- can act as a NMEA 2000 wireless extender and allows joining of two or more physical networks;
- can be paired with our NMEA 0183 Wi-Fi Gateway to remotely connect NMEA 0183 devices to NMEA 2000;
- can pass any message (including proprietary) between NMEA 2000 and a PC application by RAW protocol;
- with NMEA 0183 protocol, provides compatibility with virtually all marine applications, including Navionics;
- allows to control Raymarine SeaTalk NG autopilots from NMEA 0183;
- is compatible with NMEA 2000, J1939 and Volvo Penta EVC networks;
- supports TCP and UDP protocols, works as a Wi-Fi Access Point or can be connected to an existing Wi-Fi network;
- supports firmware updates over Wi-Fi and diagnostic data logging;
- free diagnostic software for Microsoft Windows, Mac OS X and Linux is supplied;
- contains an internal web server for diagnostics and configuration.
Order now and get our special offer: free world wide delivery! The Gateway is designed for operation in an NMEA 2000 network and is compatible with a wide range of equipment supporting this protocol. Raymarine SeaTalk NG, Simrad SimNet, and Furuno CAN networks are branded versions of NMEA 2000 and differ only by connector type. Garmin uses the NMEA 2000 Micro connector in its devices, which is compatible with the DeviceNet Micro connector. Gateway is supplied with different types of connectors (see the User Guide), making it possible to connect it to networks of different manufacturers without any adapters. Picture 13. Drawing of YDWG-02N and YDWG-02R models of Gateway (photos) The Wi-Fi antenna is located inside under the LED. For additional technical details, please see the User Guide and FAQ. View models and prices
I purchased the n2k-to-wifi gateway and installed it on the boat right after it arrived. The installation was so easy. Just plug the dongle into one spare n2k port and off you go. I immediately could see the wind data on the web gauges. However, my biggest desire was to have iRegatta Pro be NMEA enabled. I started iRegatta, configured the NMEA server and see — all the Data available. Super cool. Posted by Peter Weigt on Monday, June 25, 2018