Hi,
I just wanted to modify some statements below if that is okay. Please do not take offence it is just to help others when they try what you have achieved. I do hope I have not confused it more
Firstly you are correct in that the app needs to provide all or some of the NMEA 0183 sentences or 2000 equivalent ( or indeed signal K) for the autopilot to work ( sentences RMB,RMC,APB,XTE and BWC) the hardest for me to build being XTE - cross track error. These then need to be sent to the autopilot in some way. I have also been looking at i-boating and it indeed sends these sentences and it works on Android so seems a good fit. However the circles ( orange, green and red) seem to clutter up the display - I am going to ask if there is a way or removing these but the maps themselves look really good for the Solent area.
With regard to networking I wanted to just correct a few areas.
Background
The User Datagram Protocol ( UDP) is primarily used for fast connectionless communications (fire and forget) . It used in video transmission such as streaming services. Although the original I believe was for DNS lookup. It is fast as there is no checking. The messages are not guaranteed to arrive in sequence or at all. It is broadcast on xxx.xxx.xxx.255 on a predetermined port number. Any receiver ( or client) can open the port and read the data.
If you want a reliable transmission then the Transmission Control Protocol ( TCP) should be used. The server establishes a 'hanging socket' which comprises an ip address and port number. The client requests a connection to the hanging socket which then provides another port number where socket 2-way communication can occur. This is difficult to programme as each connection needs to be handled synchronously and in the modern world is achieved using parallel computing and shared memory. This is why TCP connections are restricted to one only. However sequence of transmission is guaranteed and delivery is guaranteed.
Port numbers are used to establish types of connections between computers on a common ethernet based network. For instance web pages use port 80 ( and 8080 for secure pages). Any program listening or providing messages on that port needs to comply with message construct for that port. There are fixed pre-defined purposes for port numbers but also a range of number that are not fixed - I use 8829. You usually find a free one by scanning the ports on the computers you are using.
To come back nearer to the real world....
The problem here is to find a bridge ( yet another computer term - your internet router has a wifi bridge) that will take the point to point NMEA0183 messages based on serial comms ( 4800 baud) to a wifi/ethernet network. This is usually accomplished via a multiplexor of which some allow 2 way communication. The serial connections usually have an in and out connection which some devices can cope with. For example a wind sensor would have an 'out' port connection and the autopilot an 'in' connection. The multiplexor will be configured to receive NMEA messages from the wifi network and send those messages out on a pre-determined 'out' connection. It can also route messages from an 'in' port to an 'out' port. Not normally an issue as these are hardwired. I use the later to send wind information to the autopilot.
The Wi-Fi network can either be UDP or TCP. I prefer TCP as the wind displays seem more consistent than with UDP however I may be imagining things here. So you could broadcast on one UDP port and receive on another UDP port. However most apps don't seem to want to do this ( prefer a single port) and those with auto pilot functionality prefer TCP as the sequence of NMEA messages are important.
I have moved completely over to TCP and programmed the raspberry pi to handle multiple TCP connections. It would appear that Graham's multiplexor can send messages on both TCP and UDP and receive on TCP. So I would set that up to have one TCP connection to the app that is going to provide the autopilot data and the other apps ( such as Navionics) which only receive to a UDP connection.
The NMEA 2000 network is not point to point. That means many messages from many sensors, chart plotters etc are flying around it. There could as a result be a clash of messages ( 2 devices sending the same message such as GPS data) The NMEA 2000 message has a source id that allows the receiver to decide which takes priority. So the GPS unit rather than the phone GPS( coming through the wifi bridge) would be used unless the GPS unit stops sending. Most chart plotters have this priority functionality which is setup by the installer.
In the world of Android/IOS networks it is the individual apps that provide the messages. So I would see a clash if say the Android tablet provides a GPS signal along with the phone and you have apps that transmit both over the network. In this case you would need to decide which app takes priority and turn off the other. I do this with Navionics on the Sailproof Android device. I turn off the Sailproof GPS ( which saves a lot of power) and use the more accurate GPS unit which send the position over the multiplexor to the Wi-Fi network and then to Navionics.
So to summarise:
UDP comms is connectionless. You could use 2 ports to provide 2-way communication but it would be very difficult to synchronise the messages and why build it when there is one waiting to be used - TCP.
TCP comms is reliable and can perform 2-way comms. It is hard to programme. Most simple multiplexors constrain the usage to one TCP connection.
Part of the chartplotter installation is to determine the priority of messages should the same one come from different devices.
When using a tablet/phone/pc based chart plotter when setting up the software priority of message source has to be determined by the installer.
It is interesting to note that most installations of multiplexors assume the only interesting bit of information you get back from the wifi network is autopilot information but I suspect a lot will use it as a means to get back GPS data to obtain say true wind from a wind sensor....
Please let me know if this type of message is inappropriate. I do not want to offend people.
Best regards
Andy B