From e5a2524ad6d9b9de6514cc2cd7fa715f8e773307 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 11 Sep 2023 19:04:40 +0200 Subject: [PATCH] CommsNTRIP: add a checkbox to select NTRIP v1.0 for older caster Casters using RTKLib are still using NTRIP V1.0 so a checkbox allow to support them --- ExtLibs/Comms/CommsNTRIP.cs | 14 ++- .../ConfigSerialInjectGPS.Designer.cs | 13 +++ .../ConfigSerialInjectGPS.cs | 7 ++ .../ConfigSerialInjectGPS.resx | 103 ++++++++++++------ 4 files changed, 98 insertions(+), 39 deletions(-) diff --git a/ExtLibs/Comms/CommsNTRIP.cs b/ExtLibs/Comms/CommsNTRIP.cs index cd881ea7a8..74ab92dbed 100644 --- a/ExtLibs/Comms/CommsNTRIP.cs +++ b/ExtLibs/Comms/CommsNTRIP.cs @@ -27,6 +27,7 @@ public class CommsNTRIP : CommsBase, ICommsSerial, IDisposable public double lat = 0; public double lng = 0; + public bool ntrip_v1 = false; private IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0); private Uri remoteUri; @@ -362,10 +363,15 @@ private void doConnect() + "User-Agent: NTRIP MissionPlanner/1.0\r\n" + auth + "Connection: close\r\n\r\n"; - - sw.Write(linev2); - - log.Info(linev2); + if (ntrip_v1) + { + sw.Write(linev1); + log.Info(linev1); + } else + { + sw.Write(linev2); + log.Info(linev2); + } sw.Flush(); diff --git a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.Designer.cs b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.Designer.cs index 626b5baeb9..fa00627fa6 100644 --- a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.Designer.cs +++ b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.Designer.cs @@ -83,6 +83,7 @@ private void InitializeComponent() this.labelbase = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.myGMAP1 = new MissionPlanner.Controls.myGMAP(); + this.check_sendntripv1 = new System.Windows.Forms.CheckBox(); this.groupBoxm8p.SuspendLayout(); this.groupBox1.SuspendLayout(); this.panel2.SuspendLayout(); @@ -218,6 +219,7 @@ private void InitializeComponent() // resources.ApplyResources(this.but_restartsvin, "but_restartsvin"); this.but_restartsvin.Name = "but_restartsvin"; + this.but_restartsvin.TextColorNotEnabled = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4))))); this.toolTip1.SetToolTip(this.but_restartsvin, resources.GetString("but_restartsvin.ToolTip")); this.but_restartsvin.UseVisualStyleBackColor = true; this.but_restartsvin.Click += new System.EventHandler(this.but_restartsvin_Click); @@ -234,6 +236,7 @@ private void InitializeComponent() // resources.ApplyResources(this.but_save_basepos, "but_save_basepos"); this.but_save_basepos.Name = "but_save_basepos"; + this.but_save_basepos.TextColorNotEnabled = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4))))); this.toolTip1.SetToolTip(this.but_save_basepos, resources.GetString("but_save_basepos.ToolTip")); this.but_save_basepos.UseVisualStyleBackColor = true; this.but_save_basepos.Click += new System.EventHandler(this.but_save_basepos_Click); @@ -323,6 +326,7 @@ private void InitializeComponent() // resources.ApplyResources(this.BUT_connect, "BUT_connect"); this.BUT_connect.Name = "BUT_connect"; + this.BUT_connect.TextColorNotEnabled = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4))))); this.BUT_connect.UseVisualStyleBackColor = true; this.BUT_connect.Click += new System.EventHandler(this.BUT_connect_Click); // @@ -499,8 +503,16 @@ private void InitializeComponent() this.myGMAP1.ShowTileGridLines = false; this.myGMAP1.Zoom = 0D; // + // check_sendntripv1 + // + resources.ApplyResources(this.check_sendntripv1, "check_sendntripv1"); + this.check_sendntripv1.Name = "check_sendntripv1"; + this.toolTip1.SetToolTip(this.check_sendntripv1, resources.GetString("check_sendntripv1.ToolTip")); + this.check_sendntripv1.UseVisualStyleBackColor = true; + // // ConfigSerialInjectGPS // + this.Controls.Add(this.check_sendntripv1); this.Controls.Add(this.chk_sendgga); this.Controls.Add(this.myGMAP1); this.Controls.Add(this.groupBox3); @@ -586,5 +598,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label16; private Controls.myGMAP myGMAP1; private System.Windows.Forms.CheckBox chk_sendgga; + private System.Windows.Forms.CheckBox check_sendntripv1; } } \ No newline at end of file diff --git a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs index d7f1ee269d..ef74aff9f8 100644 --- a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs +++ b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs @@ -317,6 +317,13 @@ public void DoConnect() ((CommsNTRIP) comPort).lng = MainV2.comPort.MAV.cs.PlannedHomeLocation.Lng; ((CommsNTRIP) comPort).alt = MainV2.comPort.MAV.cs.PlannedHomeLocation.Alt; } + if (check_sendntripv1.Checked) + { + ((CommsNTRIP)comPort).ntrip_v1 = true; + } else + { + ((CommsNTRIP)comPort).ntrip_v1 = false; + } chk_sendgga.Enabled = false; chk_ubloxautoconfig.Checked = false; diff --git a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.resx b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.resx index 357eedb9e7..90b8ee87c6 100644 --- a/GCSViews/ConfigurationView/ConfigSerialInjectGPS.resx +++ b/GCSViews/ConfigurationView/ConfigSerialInjectGPS.resx @@ -122,7 +122,7 @@ 3, 3 - 121, 21 + 121, 24 @@ -138,7 +138,7 @@ $this - 9 + 10 2400 @@ -183,7 +183,7 @@ 3, 30 - 121, 21 + 121, 24 2 @@ -198,7 +198,7 @@ $this - 7 + 8 True @@ -211,7 +211,7 @@ 93, 13 - 51, 13 + 61, 16 3 @@ -232,7 +232,7 @@ 1 - 17, 17 + 12, 17 104, 17 @@ -247,7 +247,7 @@ 3, 57 - 106, 17 + 125, 20 4 @@ -271,7 +271,7 @@ $this - 6 + 7 Top, Left, Right @@ -325,7 +325,7 @@ Acc: current accuracy of our survey in point 3, 132 - 156, 17 + 185, 20 6 @@ -346,7 +346,7 @@ Acc: current accuracy of our survey in point $this - 4 + 5 groupBox1 @@ -685,7 +685,7 @@ Acc: current accuracy of our survey in point dg_basepos - MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.7829.30222, Culture=neutral, PublicKeyToken=null + MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.8654.33854, Culture=neutral, PublicKeyToken=null panel2 @@ -802,7 +802,7 @@ Acc: current accuracy of our survey in point 3, 3 - 113, 17 + 127, 20 12 @@ -886,7 +886,7 @@ Acc: current accuracy of our survey in point dg_basepos - MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.7829.30222, Culture=neutral, PublicKeyToken=null + MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.8654.33854, Culture=neutral, PublicKeyToken=null panel2 @@ -946,7 +946,7 @@ Acc: current accuracy of our survey in point 137, 29 - 41, 13 + 53, 16 11 @@ -970,7 +970,7 @@ Acc: current accuracy of our survey in point 94, 25 - 37, 20 + 37, 22 8 @@ -1003,7 +1003,7 @@ Acc: current accuracy of our survey in point 3, 29 - 85, 13 + 104, 16 9 @@ -1031,7 +1031,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 184, 25 - 37, 20 + 37, 22 10 @@ -1109,7 +1109,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations $this - 8 + 9 104, 17 @@ -1124,7 +1124,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 3, 80 - 182, 17 + 219, 20 38 @@ -1145,7 +1145,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations $this - 0 + 1 True @@ -1157,7 +1157,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 255, 13 - 13, 13 + 14, 16 16 @@ -1187,7 +1187,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 93, 40 - 241, 13 + 278, 16 17 @@ -1217,7 +1217,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 6, 13 - 76, 13 + 91, 16 18 @@ -1247,7 +1247,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 165, 13 - 84, 13 + 101, 16 19 @@ -1277,7 +1277,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 6, 40 - 68, 13 + 84, 16 20 @@ -1307,7 +1307,7 @@ ie less than 2 m accuracy, and Greater than 60 seconds of observations 6, 31 - 83, 13 + 106, 16 21 @@ -1410,7 +1410,7 @@ rtcm0000 $this - 5 + 6 True @@ -1422,7 +1422,7 @@ rtcm0000 6, 20 - 31, 13 + 39, 16 25 @@ -1452,7 +1452,7 @@ rtcm0000 69, 20 - 26, 13 + 32, 16 27 @@ -1482,7 +1482,7 @@ rtcm0000 127, 20 - 45, 13 + 57, 16 29 @@ -1608,7 +1608,7 @@ rtcm0000 $this - 3 + 4 NoControl @@ -1644,7 +1644,7 @@ rtcm0000 278, 20 - 39, 13 + 50, 16 35 @@ -1698,7 +1698,7 @@ rtcm0000 204, 20 - 40, 13 + 50, 16 33 @@ -1812,7 +1812,7 @@ rtcm0000 $this - 2 + 3 Top, Left, Right @@ -1836,7 +1836,40 @@ rtcm0000 $this - 1 + 2 + + + True + + + NoControl + + + 3, 106 + + + 191, 20 + + + 39 + + + Send NTRIP protocol v1.0 ? + + + Some older NTRIP casters, such as RTKLIB, don't allow NTRIP protocol v2.0. Check the box to get back on Protocol v1.0 + + + check_sendntripv1 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 True