This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot heading display
#13
If I turn the pypilot it immediately shows the new compass reading. My esp32 continues to show the old reading for 30secs or more. Checking port 20220  with opencpn debug shows the correct readings, so the problem is with the esp, maybe my code?

void loop() {
 WiFiClient client;

 if (!client.connect(host, port)) {
  Serial.println("Connection to host failed");
  delay(4000);
  return;
 } // end if

 Serial.println("Connected to server successful!");

   
  while (client.connected()){
    if (client.available()) {
           
     String NMEAline = client.readStringUntil('\n'); //Read one line of the NMEA output 
    if(NMEAline.startsWith("$APHDM")){ //Check if it is the APHDM one which contains the info I want
     Serial.println(NMEAline); //Print it out over serial
     delay(500);    
    } // end if
  } // end while
  } // end line if
} // end loop
Reply


Messages In This Thread
Pypilot heading display - by oldjohn - 2020-10-06, 09:56 AM
RE: Pypilot heading display - by seandepagnier - 2020-10-06, 04:22 PM
RE: Pypilot heading display - by oldjohn - 2020-10-07, 08:09 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-08, 05:42 PM
RE: Pypilot heading display - by oldjohn - 2020-10-08, 09:39 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-08, 11:56 PM
RE: Pypilot heading display - by oldjohn - 2020-10-11, 10:27 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-11, 11:44 PM
RE: Pypilot heading display - by nousian - 2024-02-20, 05:14 PM
RE: Pypilot heading display - by oldjohn - 2020-10-12, 04:59 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-12, 10:42 PM
RE: Pypilot heading display - by oldjohn - 2020-10-14, 05:32 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-14, 10:29 PM
RE: Pypilot heading display - by oldjohn - 2020-10-14, 11:10 PM
RE: Pypilot heading display - by seandepagnier - 2020-10-14, 11:23 PM
RE: Pypilot heading display - by oldjohn - 2020-10-16, 03:01 PM
RE: Pypilot heading display - by oldjohn - 2020-10-16, 09:54 PM
RE: Pypilot heading display - by seandepagnier - 2024-02-20, 11:58 PM
RE: Pypilot heading display - by nousian - 2024-02-21, 10:26 AM
RE: Pypilot heading display - by seandepagnier - 2024-02-21, 11:00 AM
RE: Pypilot heading display - by nousian - 2024-02-21, 11:35 AM
RE: Pypilot heading display - by seandepagnier - 2024-02-22, 02:10 AM
RE: Pypilot heading display - by nousian - 2024-02-22, 10:18 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)