mardi 8 avril 2014

Why and how NMEA over Wifi

NMEA Over Wifi, what is that?

Most racing boats are using sensors and display using of the shelves components provided by a couple of manufacturer. Each of them are using different protocols and are usually obfuscated and incompatible. However the NMEA0183 and NMEA2000 protocols are standards defined to allow multiple components to exchange data together and are widely used as interfaces between specific equipments.
On the racing team I'm sailing with we're equipped with a B&G H1000 system, while this system has it's own proprietary undocumented H1000 protocol, it also capable of outputting NMEA sentences for use with other components.
These are right now all connected to each others using electrical signals carried through wires and respecting the RS-232 electrical levels. This system works well but stays confined into the navigation station area of the boat where we also have our onboard computer.


The representation above shows our instruments installation, I did not detailed the H1000 system but it contains speed on water and wind instruments, magnetic compass and displays. The H1000 NMEA interface uses the proprietary data and converts it to standard NMEA0183 frames.
The drawback is that the H1000 network refresh information with a frequency of about 5 times per second while the NMEA output is only refreshed every 2 seconds or so. We have a much slower rate of information available there.

The new system will introduce a WiFi hotspot in the system, giving us the advantage of allowing the laptop to be still connected to the instruments network but also to have handheld devices connected to the network:

Tables and phones can now see the instrument data and represent information to the sailors of the boat.

While we already have displays for regular information like speed on water, wind information... We can now build our own application and filter/interpret the NMEA data.

The first application of the laptop is to record all data and allow to check that instruments are properly calibrated, it also helps for weather routing, navigations and waypoint management.

The handheld devices will be more specific to each persons in the cockpit. Our custom made app is able to provide to the Tactician, Main Trimmer and Driver information such as:
- Actual performance versus optimal performance (in development)
- Estimated distance to the layline (idea)
- Favourite end of the starting line (idea)
- Distance to the starting line (idea)
- Heading and distance to the next waypoint (idea)
- Timing features for starts (idea)

We can now display any information to these people, assuming that the wind instrument reading are correctly calibrated. We can potentially ditch the laptop and use a tablet for navigation but we may need it still for long races where weather routing and satellite connection is giving an advantage.

WiFi Hotspot

This idea came after we started to develop custom software for the laptop, by discussion after races around the grill we started to imagine what a wireless system could be done and what could it provide. Not knowing anything about that but having couple of engineers in the team we started to experiment with the RaspberryPi. This solution provided us with a hotspot for a cost of around $50 using already existing software.

After a couple of trials and errors I opted for a solution using the IPE operating system and Kplex multiplexer software. The specific OS is a read-only system that will tolerate power failures very well and will prevent from having corrupted memory on the device. This was mandatory for a correct reliability of the WiFi hotspot but still provides the advantages of using a debian based linux operating system. Again with that os we can develop custom software for data filtering or transmission of information.

The Kplex software was a great surprise, instead of implementing myself the program that will read serial port information and stream it though TCP and UDP packets over the WiFi, I found that someone has already done that and used an open source license. Thus we could just save time and efforts by reusing this amazing piece of software.

The hotspot is now used as a testing platform, I'm sending NMEA data recorded 2 years ago during the NOOD series races to feed in my phone application and develop the code needed for correct visualisation of the data. This setup is the simplest and most reliable that I've experimented with to data leaving me more time to focus on the Android development rather than troubleshooting electrical problems.
Second testing platform, much simpler and robust
First testing platform to feed simulated NMEA to the system


Custom Android Application

This application is currently in development as in order to keep this article up to date I prefer to refer to the GitHub development page, so I don't have to update images and documentation on multiple pages :)

Please visit the application specification page for more details

The overall goal is to provide custom information when it's necessary to whom it is necessary, look at what Jim pithill was wearing during the races:
Left arm custom made instruments repeater
Right arm custom made smart watch repeater



Now this is not as advanced as what Richard Kent is developing for the multiple America's cup and Volvo ocean races he works on but this is a good start for an open source project that could benefit the racing community.

Aucun commentaire:

Enregistrer un commentaire