Posts: 31
Threads: 10
Joined: Jan 2019
Reputation:
1
I installed openplotter+opencpn on raspberry 3+arduino motor controller
Works great. Now I am looking to add dedicated keyboard for autopilot.
I am going to make module with real buttons to control autopilot without clicking mouse and touchscreen.
Is Pypilot can be controlled some external way. Probably I can reverse engineer how open on plugin is doing this, but probably some documentation exists.
Point me on it please.
Posts: 1,997
Threads: 19
Joined: Jun 2016
Reputation:
59
The pypilot_lcd script is designed to drive an lcd over spi pins, and read from a keypad on gpio pins. It can also read from an IR sensor and soon from 433mhz radio transmitter.
Otherwise you can control it from tcp. The port 20220 is only used for nmea so only autopilot route commands.
Posts: 25
Threads: 7
Joined: Jul 2019
Reputation:
1
(2019-07-09, 03:14 AM)seandepagnier Wrote: The pypilot_lcd script is designed to drive an lcd over spi pins, and read from a keypad on gpio pins. It can also read from an IR sensor and soon from 433mhz radio transmitter.
Otherwise you can control it from tcp. The port 20220 is only used for nmea so only autopilot route commands.
Is it not possible to achieve some limited control over the web-app-interface to pypilot to achieve incremental/decrement of heading?
I.E., shown in attachment figure
I would rather address signalK via web or directly, though
Does that web-app need some sort of security token to prevent hack-in?
Dont really want to rely on network-security all the time for app-security
Posts: 1,997
Threads: 19
Joined: Jun 2016
Reputation:
59
Port 20220 is used for nmea0183 communication and is useful for route following since opencpn can send these messages.
Instead, you can control heading changes and everything else from tcp port 21311. This is exactly how pypilot_lcd works. You can run it with the screen disabled, and it will still read from gpio and send commands to the autopilot over the network. Normally it connects to the localhost but it can be configured to use a remote host.
There is currently no app-level security, instead for now, you can use an encrypted wifi network. It's a nice idea but I'm not really sure what the use case is.
Posts: 29
Threads: 4
Joined: May 2019
Reputation:
1
I have not worried about WiFi security with my sensors on the boat because most of these small devices are only able to connect a few meters away through the teak/fiberglass hull and all. In practice, I can sometimes connect to my boat when in a marina from the boat in the next slip, but seldom from 2 slips away. And I don't usually anchor that close to other boats either.
I usually connect to the internet through my cellphone and that I do secure. But I know and I trust my neighbors not to hyjack my GPS or AIS signal while docked.
I try not to sail close enough to other boats underway that it could be a problem!
--
Larry - s/v Katie Lee Passport 45 Ketch (For Sale) - somewhere in Taiwan
Posts: 31
Threads: 10
Joined: Jan 2019
Reputation:
1
2019-07-14, 04:00 AM
(This post was last modified: 2019-07-14, 04:02 AM by partyvi.)
(2019-07-10, 12:13 AM)wdee Wrote: (2019-07-09, 03:14 AM)seandepagnier Wrote: The pypilot_lcd script is designed to drive an lcd over spi pins, and read from a keypad on gpio pins. It can also read from an IR sensor and soon from 433mhz radio transmitter.
Otherwise you can control it from tcp. The port 20220 is only used for nmea so only autopilot route commands.
Is it not possible to achieve some limited control over the web-app-interface to pypilot to achieve incremental/decrement of heading?
I.E., shown in attachment figure
I would rather address signalK via web or directly, though
Does that web-app need some sort of security token to prevent hack-in?
Dont really want to rely on network-security all the time for app-security
Unfortunately Web interface is not working well on my installation, i am able to open page and it even reacts on commands but main screen is not updates after buttons activated. Neither other tabs. Is it known issue? I did not worry it does not work due i did not plan to use it but probably i will do.
Does somebody had similar malfunction?
(2019-07-10, 12:44 AM)seandepagnier Wrote: Port 20220 is used for nmea0183 communication and is useful for route following since opencpn can send these messages.
Instead, you can control heading changes and everything else from tcp port 21311. This is exactly how pypilot_lcd works. You can run it with the screen disabled, and it will still read from gpio and send commands to the autopilot over the network. Normally it connects to the localhost but it can be configured to use a remote host.
There is currently no app-level security, instead for now, you can use an encrypted wifi network. It's a nice idea but I'm not really sure what the use case is.
Thanks, is somewhere specification for the commands on 21311 port? If so, point me on it, please.
Posts: 1,997
Threads: 19
Joined: Jun 2016
Reputation:
59
2019-07-14, 05:22 PM
(This post was last modified: 2019-07-14, 05:23 PM by seandepagnier.)
If would be best to study the current 4 implementations to see how they communicate. They all use port 21311:
1) pypilot/ui/autopilot_control.py - python control client
2) pypilot/lcd/lcd.py - spi lcd, gpio keypad and ir remote
3) pypilot/webapp/webapp.py - python/javascript control from website, web interface for pypilot using web sockets
4) pypilot_pi - opencpn plugin for pypilot. This reimplements all of the communication in c++.
I would pick which one of the above most closely matches your goals to read the source code first.
Posts: 31
Threads: 10
Joined: Jan 2019
Reputation:
1
(2019-07-14, 05:22 PM)seandepagnier Wrote: If would be best to study the current 4 implementations to see how they communicate. They all use port 21311:
1) pypilot/ui/autopilot_control.py - python control client
2) pypilot/lcd/lcd.py - spi lcd, gpio keypad and ir remote
3) pypilot/webapp/webapp.py - python/javascript control from website, web interface for pypilot using web sockets
4) pypilot_pi - opencpn plugin for pypilot. This reimplements all of the communication in c++.
I would pick which one of the above most closely matches your goals to read the source code first.
Thanks to everyone.
Posts: 3
Threads: 1
Joined: Sep 2021
Reputation:
0
2021-09-28, 11:31 PM
(This post was last modified: 2021-09-28, 11:42 PM by gustavo.)
(2019-07-19, 01:34 AM)partyvi Wrote: (2019-07-14, 05:22 PM)seandepagnier Wrote: If would be best to study the current 4 implementations to see how they communicate. They all use port 21311:
1) pypilot/ui/autopilot_control.py - python control client
2) pypilot/lcd/lcd.py - spi lcd, gpio keypad and ir remote
3) pypilot/webapp/webapp.py - python/javascript control from website, web interface for pypilot using web sockets
4) pypilot_pi - opencpn plugin for pypilot. This reimplements all of the communication in c++.
I would pick which one of the above most closely matches your goals to read the source code first.
Thanks to everyone. 
Hi all. I have the same issue that partyvi.The web interface is not working in my instalation (Rpi 3+, and open plotter, arduino nano motor controller L298N). Buttons reacts but the main page dont upgrade anything.
When I tried in the terminal "pypilot_hat" it answer that not is a command.So until now I can´t make a keypad to control autopilot.
I will apreciate some orientation.
(2019-07-19, 01:34 AM)partyvi Wrote: (2019-07-14, 05:22 PM)seandepagnier Wrote: If would be best to study the current 4 implementations to see how they communicate. They all use port 21311:
1) pypilot/ui/autopilot_control.py - python control client
2) pypilot/lcd/lcd.py - spi lcd, gpio keypad and ir remote
3) pypilot/webapp/webapp.py - python/javascript control from website, web interface for pypilot using web sockets
4) pypilot_pi - opencpn plugin for pypilot. This reimplements all of the communication in c++.
I would pick which one of the above most closely matches your goals to read the source code first.
Thanks to everyone. 
Hi all. I have the same issue that partyvi.The web interface is not working in my instalation (Rpi 3+, and open plotter, arduino nano motor controller L298N). Buttons reacts but the main page dont upgrade anything.
When I tried in the terminal "pypilot_lcd" it answer that not is a command.So until now I can´t make a keypad to control autopilot.
I will apreciate some orientation.
Posts: 447
Threads: 26
Joined: Jun 2019
Reputation:
31
2021-10-04, 09:55 AM
(This post was last modified: 2021-10-05, 08:21 AM by ironman.)
I built my own UI that connects directly to the pypilotServer; see link below. In my case I connect through IPC but the same can be done through the 21311 socket. The meat of the code is in handleKey() at line 233:
https://github.com/marcobergman/pypilot_ray
|