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
Send GPS data from OpenPlotter to Tinypilot
#1
Hi,

I'm trying to send data such as GPS from OpenPlotter to Tinypilot, but I'm having trouble.

Configuration :

- Raspberry Pi 4 with OpenPlotter
    - SignalK server with mdns option enabled
    - GPS (Neo-6M) connected via UART5 => data arrives in Signal K
    - OpenCPN with Pypilot plugin => the plugin shows "Connected to pypilot"

- Raspberry Pi Zero > with Tinypilot / Pypilot version 0.32 (tinypilot_2021_11_16 image)

Tinypilot is connected as a client to OpenPlotter AccessPoint.
NB : At the moment, I am at home, without pypilot hat or motor controller.

I successfully connected Pypilot to SignalK, using the "zero configuration" method.

In the SignalK Data Browser, I can see navigation.headingMagnetic and navigation.attitude from the pypilot source, navigation.position (with correct longitude/latitude) and other informations from the GPS source.

OpenCPN is connected to SignalK (via the SignalK protocol on port 3000) and shows a good GPS reception.

I would like to check if Pypilot can get informations such as GPS location from OpenPlotter. I saw the "gps.source" information in the OpenCPN pypilot plugin, in the Stats window.
==> Is there another way to verify this information (and other verification statuses) ? I don't see it on the "Pypilot control" web page for example.

I read in the workbook that Signal K can only get data from Pypilot, but cannot send data to Pypilot.
==> Is it right ? Or is this information out of date for the version I'm using ?

The "gps.source" of the OpenCPN plugin shows "none", and I can't choose the "gps" autopilot mode. In fact, I just noticed that it rarely and furtively displays "signalk", but most of the time it displays "none".
==> This does'nt seem normal, does it ? What could be the reason?

I've tried sending NMEA0183 data from Signal K to Pypilot, but I can't figure out what the correct configuration is. I tried the following things :
1 - put "openplotter:10110" on "Pypilot control" webpage > Configuration > NMEA Client host:port (no "save" button ?)
2 - on SignalK > Data Connections > Add a NMEA0183 connection :
    - Source : TCP client
    - Host : pypilot
    - Port : 20220
    - Output Events : nmea0183,nmea0183out              => I didn't really understand the doc about this
3 - on SignalK > Data Connections > Add a NMEA0183 connection :
    - Source : TCP server on port 10110

None of them seemed to do anything :
-  "gps.source" was still "none"
- I could'n see the network connections between OpenPlotter and Tinypilot on port 10110 or 20220 :
    - On Tinypilot :
Code:
tc@pypilot:~$ netstat -apn | grep -e 3000 -e 20220 -e 10110
netstat: showing only processes with your user ID
tcp        0      0 0.0.0.0:20220          0.0.0.0:*              LISTEN      1314/pypilot
tcp      571      0 10.10.10.163:34452      10.10.10.1:3000        ESTABLISHED 1315/pypilot

    - On OpenPlotter :
Code:
pi@openplotter:~ $ netstat -apn | grep -e 20220 -e 10110 -e 10.10.10.163
(Tous les processus ne peuvent être identifiés, les infos sur les processus
non possédés ne seront pas affichées, vous devez être root pour les voir toutes.)
tcp        0      0 10.10.10.1:51458        10.10.10.163:23322      ESTABLISHED 2994/opencpn       
tcp        0      0 10.10.10.1:49328        10.10.10.163:33333      ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:56386        10.10.10.163:80        ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:49308        10.10.10.163:33333      ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:56392        10.10.10.163:80        ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:56374        10.10.10.163:80        ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:56396        10.10.10.163:80        ESTABLISHED 5540/chromium-brows
tcp        0      0 10.10.10.1:52580        10.10.10.163:22        ESTABLISHED 12652/ssh         
tcp6      0      0 :::10110                :::*                    LISTEN      463/node           
tcp6      0      0 10.10.10.1:3000        10.10.10.163:34452      ESTABLISHED 463/node           

==> What is the correct configuration to send NMEA0183 data from Signal K to Pypilot ?

Thanks for your help !
Reply
#2
I finally managed to send data from OpenPlotter to Pypilot using Signal K with the following NMEA0183 connection :
    - Source : TCP client
    - Host : pypilot
    - Port : 20220
    - Output Events : nmea0183,nmea0183ou
=> The "gps.source" of the OpenCPN plugin shows "tcp" and GPS mode can be selected.

I think my problem was that I should have restarted the SignalK server.

I'm still interested in whether SignalK without this NMEA0183 connection should send data to Pypilot.

Thanks
Reply
#3
it should work without nmea0183. For signalk to accept data from pypilot requires granting the access request in the signalk setup.
Reply
#4
(2024-02-12, 09:20 PM)seandepagnier Wrote: it should work without nmea0183.  For signalk to accept data from pypilot requires granting the access request in the signalk setup.

Thanks for your reply Sean. I have already granted pypilot in SignalK (with read and write permissions), and SignalK can receive data from pyilot (roll, pitch, attitude...).
My problem is in the other way : sending data (GPS location) from SignalK to pypilot. This doesn't seem to work.
Reply
#5
It should work even without the access permission because pypilot only needs permissions to send data to signalk.

How are you getting gps into signalk? Can you post a sample of the signalk stream?

specifically pypilot looks for:
'navigation.courseOverGroundTrue', radians 'track',
'navigation.speedOverGround', meters_s 'speed',

Finally, you could try to edit signalk.py and uncomment out the "print" line in the debug function. Now run pypilot from the commandline and try to see if it gets gps information.
Reply
#6
Hi Sean,
Sorry for my late response.
GPS data comes from a "Neo-6M" GPS connected via UART5. I configured it in OpenPlotter "Serial" application to send data to Signal K.
Here is an excerpt of GPS data from Signal K Data Brower for the data you mentioned :

Path                                 Value                Units  Timestamp       Source
navigation.speedOverGround           0.13194444444444445  m/s    02/15 13:32:25  gpsneo6m.GP  (VTG)
navigation.courseOverGroundTrue      null                 rad    02/15 13:33:03  gpsneo6m.GP  (VTG)

We can see that "navigation.courseOverGroundTrue" have a null value.


Here is an excerpt of the pypilot execution logs with debugging enabled:

signalk zeroconf service add avnav-server._http._tcp.local. _http._tcp.local.
signalk zeroconf service add openplotter._http._tcp.local. _http._tcp.local.
signalk server found 10.10.10.1:3000
signalk probe... 10.10.10.1:3000
servo probe ('/dev/ttyAMA0', 38400) 2367.521671
nmea client failed to connect openplotter:10110
signalk found ws://10.10.10.1:3000/signalk/v1/stream?subscribe=none
signalk connected to ws://10.10.10.1:3000/signalk/v1/stream?subscribe=none
servo probe ('/dev/ttyAMA0', 38400) 2372.714597
Exception converting signalk->pypilot unsupported operand type(s) for /: 'NoneType' and 'float' {'GP': {'navigation.position': {'longitude': -4.000000000000000, 'latitude': 47.0000000}, 'navigation.courseOverGroundTrue': None, 'navigation.speedOverGround': 0.1193511413467336}}

For security reasons, I replaced the decimal digits with zero in the longitude and latitude values  Wink

It looks like pypilot is in having issues with this "None" value for "navigation.courseOverGroundTrue".
Maybe because I'm testing from home, without moving ?
Reply
#7
You mention pypilot version 0.32. I checked the code in latest pypilot master branch and it does guard against this since Aug 2022 (commit b15a0b3a3149f5c0a4bf2b1131074e1969d5c3bb)
Reply
#8
OK, thank you for this clarification. I took the latest stable version "tinypilot_2021_11_16.img.xz" from https://pypilot.org/ > Download page.
Do you have any advice for me, for a first time using pypilot (with the pypilot hat and the high-power motor controller that I will receive soon), on which tinypilot version to use? Should I use a version other than "tinypilot_2021_11_16.img.xz"?
Reply
#9
You could try the recent beta from https://pypilot.org/images/

It seems stable, but please report any issues.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)