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, signalk and USB
(2021-11-04, 06:37 AM)seandepagnier Wrote: it is in the ~/.pypilot directory a file named serial_ports or a file blacklist_serial_ports

What specifically is the program conflicting?   I will like to build logic in the future to help negotiate these issues if possible.

Hi Sean - thanks for your response.  Below is the post I originally put on the openplotter forum a couple of days ago.

Hi all.  A plug-n-play, non-technical type here so bear with me and speak slowly.

I've been building a basic Openplotter system now for a couple of months, plodding along as we work our way through our COVID-19 restrictions and winter.

I now have it up and mostly running.  Physically, its a RPi 4B 2Gb with a separate powered 4-port USB 3.0 hub.  A 12v -> 5v 3A converter powers each device separately ie 2 x 3A supplies.  An IMU is installed via GPIO. Power supply includes a 12v battery module with its own BMS in parallel with the main supply from house batteries (or a wall wart at home).  HDMI output drives and external monitor.  USB keyboard and mouse.

A 'U-blox 7' mouse-style gps device is plugged into the USB hub.  It shows in the serial connection app as ttyACM0 and has the alias ttyOP_gpsmouse.

OpenCPN 5.2.4 is installed.  SignalK is installed.  OpenCPN gets all its data from the SignalK server on :localhost 3000

The gps device shows in the SignalK dashboard and with JUST OpenCPN running, the gps data gets to OpenCPN

If I install PyPilot 2.1.1 and make its connections to SignalK, it runs initially, but on reboot the gps data stream stops dead in its tracks - neither OpenCPN or Pypilot get gps data.  The device still shows on the serial connection app, but no data coming or going to SignalK.

So, I read through Tony's thread today and his problem is identical - and it make sense since an error message I get (I think in SignalK server) is that the gps device is busy or being used by another program.  I just could not figure out which program.  This is what led me to removing openplotter apps until the problem resolved.

So, now from your answers for Tony, I understand that Pypilot is probing the USB ports on bootup and so the device is not available to SignalK and then to OpenCPN, because PyPilot got there first. I understand that I need to include a short line in the config file to blacklist the gps device so that PyPilot doesn't probe and attach to the port.

My problem now is I have no idea how to do this from the terminal console.  This - "~/.pypilot" means nothing to me.I am a complete, rank beginner in linux, and the last time I wrote any code it was on portapunch FORTRAN cards at school in the 1970s.

What I actually need is for someone to take me through it, step by step, command by command, line by line.
(2021-11-04, 08:29 AM)aardvarkash10 Wrote: This - "~/.pypilot" means nothing to me. I am a complete, rank beginner in linux, and the last time I wrote any code it was on portapunch FORTRAN cards at school in the 1970s.

What I actually need is for someone to take me through it, step by step, command by command, line by line.

~/ is unix speak for the home directory of the account you are logged into. So if you are logged in as user pi, this is the home directory of user pi. Typically, and on openplotter this is the case, this is the directory /home/pi/. You can go to your home directory by simply typing cd <enter>. You will see a ~ appear in your prompt, so you know you are in your home directory. If you want to know exactly where you are, you can type pwd (print working directory) and you know for sure:

Quote:pi@openplotter:/etc $ cd

pi@openplotter:~ $ pwd
pi@openplotter:~ $

Now .pypilot is a directory within /home/pi/. You will notice that it starts with a dot. In unix, this means the directory is hidden. If a directory, or any file, starts with a dot, you won't normally see it. So if you type 'ls' (list files and directories) this directory will not be visible. However, if you type 'ls -a', you will see it, along with a whole lot of very important rubbish. And you can go to it with cd:

Quote:pi@openplotter:~ $ ls

Desktop  Documents  Downloads  Music  Pictures  Public  pypilot  pypilot_pi  RTIMULib.ini  Templates  Videos

pi@openplotter:~ $ ls -a
.   .bash_history  .bashrc  .config  Desktop    Downloads  .local  .npm      .openplotter  .pki      Public    pypilot     RTIMULib.ini  Templates  .vnc         .xsession-errors .bash_logout   .cache   .cups    Documents  .gnupg     Music   .opencpn  Pictures      .profile  .pypilot  pypilot_pi  .signalk      Videos     .Xauthority  .xsession-errors.old

pi@openplotter:~ $ cd .pypilot

pi@openplotter:~/.pypilot $ ls
persist_fail  pypilot_client.conf  pypilot.conf  pypilot.conf.bak  RTIMULib.ini  servodevice  signalk-token

Now to create a text file on linux, the text file editor for newbies (equivalent to notepad.exe on windows) would be 'nano'. So to edit a file called ~/.pypilot/blacklist_serial_ports, you would type nano ~/.pypilot/blacklist_serial_ports. Type the device name you want to block, e.g. /dev/ttyUSB0 (mind the correct case), then type CTRL-X and Yes to save the file. Restart pypilot and see what happens.

Now you won't see any useful logging if you run pypilot from the openplotter tool. If a car does not start, you have to look under the bonnet. Better is to disable pypilot in the openplotter tool, and then run it at the prompt. You will then see all the information that will help people here to help you!
excellent reply! Thanks for your help, and also thanks for your pretty clear and humorous manual. Its a permanent fixture on my reading list atm.

Forum Jump:

Users browsing this thread: 1 Guest(s)