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
Getting wind data into Pypilot
#21
Dear Sean / Ironman.

Thank you for your extremely constructive an patient guidance throughout my trouble shooting in this case. I'm heading offshore (Bergen-Shetland) in 10 days, and I really wanted to have the wind mode ready for this passage.

The issue, as Sean already pointed out, was due to the mast height parameter was set to 15 (m?), instead of the default zero value. (turns out, Pypilot wasn't ment for sailboats, after all... :-)) -> causing a bug in the python code.

The bug caused pypilot to fail during initialization when using the nmea0183 connection. This also gave some meaningful debugable output (which probably was where Sean spotted the issue).
The signalk zeroconf service appeared to work, and gave no indication about the issue, but the wind data was not available for controlling pypilot.

When setting the mast height back to zero, my Pypilot is now fully operational in both modes (nmea0183 connection as well as the zeroconf service).

Thanks again, guys. Great work.


Attached Files Image(s)
       
Reply
#22
Correction: 

For now, the wind data is ONLY available through the nmea0183 connection in my setup. The issue is still there with the other one... 
For now, I'm happy with the result, but i will try more trouble shooting if any of you have ideas of how to proceed...
Reply
#23
Well thank you as well , because for your tenacity I learned as well how and why things are working for me. Streamlining the data flows on the boat is essential - sometimes I don't know which connection provides my pypilot with gps and wind data but I'm afraid to touch anything. Now I got it sorted - I think.

As it turns out, the signalk error mentioned before (issue #143) does occur at my boat as well, but only when I disable the signalk nmea feed; I guess it was for this reason I configured the signal nmea feed. If the nmea feed on port 20220 provides cog, the native-signalk cog seems to be ignored and there is no error in the pypilot output. This makes sense; seems to be that nmea feed takes priority. But I know now that it was this issue that has been bugging me for long.

BTW for future reference: where you set mast height/wind.sensors_height? I'm on 0.24 still and that is from before height compensation was added.
Reply
#24
I managed to run pypilot with more debug info. The two screenshots below are with, and without, the nmea0183 connection, respectively.


Attached Files Image(s)
       
Reply
#25
I just found out that coexisting of a nmea tcp/20220 and a signalk tcp/3000 connection to pypilot is that data (e.g., SOG) that you put into pypilot through nmea:20220 comes back through signalk:3000. This becomes visible as two sources for the same path in signalk's data browser *):

[Image: 185943500-b639634d-ba4f-48d1-9a76-9033ad62fcb2.png]

At first sight this only seems to have the drawback of source data ambiguity. This can be solved by using the signalk Source Priorities feature. But invisible in the UI, there might also be some infinite loop created by this. As it is not visible, it scares me, and without knowing for sure, I am inclined to attribute past problems with signalk's node process going through the roof, and some wifi issues, to this effect.

To prevent or solve this, I have now made the pypilot client device in signalk (Security->Devices) read/only. This way, pypilot might still benefit from any data that becomes available in signalk, but there is no risk of a loop being created.

Of course, this is a temporary solution, only to bridge the time until the pypilot signalk connection is debugged. But some prudence in making the signalk connection read-write might still be advised.

*) note that in this chosen example, the original wind speed is practically 0; pypilot merely seems to round the figure.
Reply
#26
Any chance you can rerun without the nmea stream with:

Code:
diff --git a/pypilot/signalk.py b/pypilot/signalk.py
index da9230c..15b9180 100644
--- a/pypilot/signalk.py
+++ b/pypilot/signalk.py
@@ -343,7 +343,7 @@ class signalk(object):
             try:
                 self.receive_signalk(msg)
             except Exception as e:
-                debug('failed to parse signalk', e)
+                debug('failed to parse signalk', msg, e)
                 return
             self.keep_token = True # do not throw away token if we got valid data

I put this now for better debugging info.

Its because you have a different setup from me. My homemade wind sensors output nmea0183, so they are different from yours in the signalk generated and always have either $source or source and talker.
Reply
#27
(2022-08-22, 03:31 PM)ironman Wrote: I just found out that coexisting of a nmea tcp/20220 and a signalk tcp/3000 connection to pypilot is that data (e.g., SOG) that you put into pypilot through nmea:20220 comes back through signalk:3000. This becomes visible as two sources for the same path in signalk's data browser *):
I noticed the same thing, and I see your point, Ironman. 
But I rather not block the incoming data from pypilot, as I am using the rudder feedback signal for displaying in WilhelmSK/grafana.

(2022-08-22, 07:28 PM)seandepagnier Wrote: Any chance you can rerun without the nmea stream with:

Code:
diff --git a/pypilot/signalk.py b/pypilot/signalk.py
index da9230c..15b9180 100644
--- a/pypilot/signalk.py
+++ b/pypilot/signalk.py
@@ -343,7 +343,7 @@ class signalk(object):
            try:
                self.receive_signalk(msg)
            except Exception as e:
-                debug('failed to parse signalk', e)
+                debug('failed to parse signalk', msg, e)
                return
            self.keep_token = True # do not throw away token if we got valid data

I put this now for better debugging info.

Its because you have a different setup from me.   My homemade wind sensors output nmea0183, so they are different from yours in the signalk generated and always have either $source or source and talker.

(2022-08-22, 07:28 PM)seandepagnier Wrote: Any chance you can rerun without the nmea stream with:

Code:
diff --git a/pypilot/signalk.py b/pypilot/signalk.py
index da9230c..15b9180 100644
--- a/pypilot/signalk.py
+++ b/pypilot/signalk.py
@@ -343,7 +343,7 @@ class signalk(object):
            try:
                self.receive_signalk(msg)
            except Exception as e:
-                debug('failed to parse signalk', e)
+                debug('failed to parse signalk', msg, e)
                return
            self.keep_token = True # do not throw away token if we got valid data

I put this now for better debugging info.

Its because you have a different setup from me.   My homemade wind sensors output nmea0183, so they are different from yours in the signalk generated and always have either $source or source and talker.

Code:
tc@pypilot:/mnt/mmcblk0p2/tinypilot/pypilot$ diff --git a/pypilot/signalk.py b/pypilot/signalk.py
diff: unrecognized option '--git'
BusyBox v1.26.2 (2017-05-05 07:13:57 UTC) multi-call binary.

Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

Compare files line by line and output the differences between them.
This implementation supports unified diffs only.

       -a      Treat all files as text
       -b      Ignore changes in the amount of whitespace
       -B      Ignore changes whose lines are all blank
       -d      Try hard to find a smaller set of changes
       -i      Ignore case differences
       -L      Use LABEL instead of the filename in the unified header
       -N      Treat absent files as empty
       -q      Output only whether files differ
       -r      Recurse
       -S      Start with FILE when comparing directories
       -T      Make tabs line up by prefixing a tab when necessary
       -s      Report when two files are the same
       -t      Expand tabs to spaces in output
       -U      Output LINES lines of context
       -w      Ignore all whitespace
... Obviously not what you were looking for...
Reply
#28
I augmented issue 143. The results I got with a raspberry 3 with openplotter 3.0 on it. In it, I stuck the GPS USB dongle and added a serial Data Connection in signalk. I connected a tinypilot through wifi with signalk, then stopped the pypilot service on it (sudo sv stop pypilot) and ran pypilot at the prompt to get the output. The changes to signalk.py I made were compiled with '. pypilot.build' (mind the dot and the space behind) and then I sudo reboot to make it effective.

Running pypilot on the same machine had the drawback that the gps dongle was hijacked by pypilot and signalk could not connect to it. And there was also another issue (#144).
Reply
#29
(2022-08-23, 10:44 AM)ironman Wrote: Running pypilot on the same machine had the drawback that the gps dongle was hijacked by pypilot and signalk could not connect to it. And there was also another issue (#144).

You can blacklist it with adding the device to ~/.pypilot/blacklist_serial_ports and pypilot will leave it alone

(2022-08-22, 07:28 PM)seandepagnier Wrote: Any chance you can rerun without the nmea stream with:

Code:
diff --git a/pypilot/signalk.py b/pypilot/signalk.py
index da9230c..15b9180 100644
--- a/pypilot/signalk.py
+++ b/pypilot/signalk.py
@@ -343,7 +343,7 @@ class signalk(object):
            try:
                self.receive_signalk(msg)
            except Exception as e:
-                debug('failed to parse signalk', e)
+                debug('failed to parse signalk', msg, e)
                return
            self.keep_token = True # do not throw away token if we got valid data

I put this now for better debugging info.

Its because you have a different setup from me.   My homemade wind sensors output nmea0183, so they are different from yours in the signalk generated and always have either $source or source and talker.

Code:
tc@pypilot:/mnt/mmcblk0p2/tinypilot/pypilot$ diff --git a/pypilot/signalk.py b/pypilot/signalk.py
diff: unrecognized option '--git'
BusyBox v1.26.2 (2017-05-05 07:13:57 UTC) multi-call binary.

Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

Compare files line by line and output the differences between them.
This implementation supports unified diffs only.

       -a      Treat all files as text
       -b      Ignore changes in the amount of whitespace
       -B      Ignore changes whose lines are all blank
       -d      Try hard to find a smaller set of changes
       -i      Ignore case differences
       -L      Use LABEL instead of the filename in the unified header
       -N      Treat absent files as empty
       -q      Output only whether files differ
       -r      Recurse
       -S      Start with FILE when comparing directories
       -T      Make tabs line up by prefixing a tab when necessary
       -s      Report when two files are the same
       -t      Expand tabs to spaces in output
       -U      Output LINES lines of context
       -w      Ignore all whitespace
... Obviously not what you were looking for...

If you can just edit signalk.py and add ,msg to the debug print function, or run patch or whatever... replacing the -- line with ++.

Then reproduce the first case of "unable to parse 'talker'" when feeding pypilot signalk wind directly from your wind source, it would show me finally, the raw signalk data so I could modify the parser in pypilot to interpret it correctly.  

What kind of wind sensors, and how do they get data into signalk?  Are they native signalk wind sensors??
Reply
#30
Sean. 
I now managed to output your requested debug info. See screenshot below... 
My wind sensor is a brand new B&G WS310.


Attached Files Image(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)