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
NMEA to pypilot
#1
Hi,

I've planned to get NMEA data (wind) to the pypilot. I have a raymarine system, so its running seatalkNG. I do have a DigitalYacht iKonvert Gateway (USB), NMEA2000 to NMEA0183 converter that has an USB output and gives NMEA data to a PC. As a first try I put this USB in the RPI running pypilot (MicroUSB port), but it doesn't work. Anyone tried this?
How would the best possibility be to get the SEatalkNG to NMEA0183 and into pypilot?

Currently I am only running pypilot, so no OpenCPN, but I guess this would be an option.

Edit: Is the microUSB port usable for this? Or should I go via some other serial connection? Somewhere Sean stated you could go from an NMEA0183 network and a USB to serial converter to the pypilot...


Thanks for tips.

//Fabian
Reply
#2
Provided you have already established with your pc connection that it outputs a wmv sentence, first thing that would come to mind is baudrate. I believe pypilot probes at 4800 and 38400 only. Bring down pypilot, find out the device name in /dev; then set baudrate with stty -F devicename baudrate, then cat the devicename to check mwv sentences come through. Edit: if it does not, solve that first; if it does, post the output of pypilot when ran at the prompt.

Myself, I have pypilot, and wind, interfaced through native signalk. https://github.com/pypilotWorkbook/workb...k-zeroconf.
Reply
#3
You can do it with micro usb or through wifi.

The question is, if the usb device you plugged into the pi is recognized, and it may even need to edit the udev rules.

So, ssh into tinypilot and run "dmesg | tail" after plugging into micro usb port and see what the result is.

Also, yes it only works at 4800 and 38400 baud normally.
Reply
#4
Thanks. Yes, it talks (talked last year) with my computer. However it needs dedicated drivers (unless running ubuntu). Guess this could be an issue?

Does it usually work to have a standard nmea0183 to USB cable plugged into the RPI zero running pypilot, without any more config?

Edit: Did'nt see Seans answer before submitting. It can send on 4800 and 38400 baud, I've tried both. The converter doesn't show any USB connection, so it seems it's not recognized. I will do some more testing during the next nights, everything is well build into the boat right now...

//Fabian
Reply
#5
HI again,

this is what I got:


tc@box:~$ dmesg | tail
[ 2397.012416] usb 1-1: new full-speed USB device number 4 using dwc_otg
[ 2397.012752] Indeed it is in host mode hprt0 = 00021501
[ 2397.248187] usb 1-1: New USB device found, idVendor=0403, idProduct=6001
[ 2397.248202] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2397.248209] usb 1-1: Product: FT232R USB UART
[ 2397.248216] usb 1-1: Manufacturer: FTDI
[ 2397.248222] usb 1-1: SerialNumber: A601SDDE
[ 2397.251468] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[ 2397.251682] usb 1-1: Detected FT232RL
[ 2397.252784] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
tc@box:~$

I guess it is just some definition that has to be changed?

The nmea test tool on the PC reads wind data, true and apparent. RAW data coming from the converter in wind mode:


$SDMDA,,I,,B,,C,9.8,C,,,,,,T,7.5,M,5.7,N,2.9,M*44
$WIMWV,7.5,R,2.9,M,A*29
$WIVWR,7.5,R,5.7,N,2.9,M,10.5,K*68
$WIMWD,,T,7.5,M,5.7,N,2.9,M*7F
$SDMDA,,I,,B,,C,9.8,C,,,,,,T,7.5,M,5.7,N,2.9,M*44
$WIMWV,7.5,R,2.9,M,A*29
$WIVWR,7.5,R,5.7,N,2.9,M,10.5,K*68
$WIMWD,,T,10.0,M,5.9,N,3.0,M*4A
$SDMDA,,I,,B,,C,9.8,C,,,,,,T,10.0,M,5.9,N,3.0,M*71
$WIMWV,10.0,R,3.0,M,A*12
$WIVWR,10.0,R,5.9,N,3.0,M,10.9,K*51
$WIMWD,,T,10.0,M,5.9,N,3.0,M*4A
$SDMDA,,I,,B,,C,9.8,C,,,,,,T,10.0,M,5.9,N,3.0,M*71
$WIMWV,10.0,R,3.0,M,A*12
$WIVWR,10.0,R,5.9,N,3.0,M,10.9,K*51
$WIMWD,,T,10.0,M,5.9,N,3.0,M*4A







Thanks!
//Fabian
Reply
#6
I looks like your adaptor is recognized and a device is set up:

[ 2397.252784] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0

That means your adaptor shows up as /dev/ttyUSB0, and you can set its baudrate with stty -F /dev/ttyUSB0 38400.

Then you can verify you get data by typing cat /dev/ttyUSB0.

If that is all right, I should ask the question that should have been asked before: why do you say "but it doesn't work"? What you should see is that the option 'Wind' is added to the dropdown in the pypilot user interface 1). 

If you get data, and the option wind is not shown, then it is time to stop pypilot (sudo sv stop pypilot), run pypilot at the prompt, and share the output of it.

1) NOTE: this applies to the OpenCPN plugin and the Openplotter interface; the web interface always shows all options, but if you select wind and there is not wind data, it flicks back to compass.
Reply
#7
is pypilot assigned this serial port? It wont probe unless assigned in ~/.pypilot/serial_ports if the file exists. Otherwise you can delete it to probe all ports.

What output do you see from pypilot?

You should also see the nmea stream on 20220 etc:

telnet <address> 20220
Reply
#8
Hi, thanks a lot for you quick replies. Really awesome!

@Ironman, yes, not working meant I don't get the W on the display and can't choose wind mode.

That's what I did today:
- look for serial_prots -> not existing
- Try to cat ttyUSB0 -> device busy
- down pypilot
- cat ttyUSB0 -> no output
- up pypilot
- telnet 20220 -> all NMEA sentences, incl. MWV
- Check pypilot -> wind mode available.

So, I basically only restarted pypilot without restarting tinypilot. I've turned tinypilot and the instruments off and on a couple of times and wind mode keep beeing available, so it seems to work.


Thanks for your help!
//Fabian
Reply
#9
so..

it sometimes doesn't work after rebooting the tinypilot??

if you get no output from "cat <device>" it does not mean it isnt working. cat doesnt work on tinypilot
Reply
#10
(9 hours ago)seandepagnier Wrote: so..

it sometimes doesn't work after rebooting the tinypilot??

if you get no output from "cat <device>" it does not mean it isnt working.  cat doesnt work on tinypilot

HI,

For now it always works, after I once rebooted pypilot while tinypilot was running.

I will see how it works in the next weeks, but during the tests (3 reboots of the whole system, including instruments and converter), it worked (without any further work after start up).

BR, Fabian
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)