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:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LCD Display
#71
I tested this succesfully in the following way. I installed pypilot on an RP4 openplotter image from github, then ran pypilot at the prompt in one terminal window, pypilot_hat in another window, pypilot_web in a third window. Then I connected a browser to the :33333 port for the hat config screen, and another browser window to the :8000 port for the autopilot screen. I connected GPIO26 to a switch to ground and clicked the switch. In the hat config screen, this was visible and I connected it to the 'engage' function. From then on, I could see that the AP slide in the autopilot screen was switched to 'on' each time I clicked the switch.

So here is a positive scenario that you could replicate. If you succeed, work from here, changing one thing at a time, towards what you want. If you don't succeed, Francesco: post output! Attached mine.

Some notes:
  • something went wrong in the installation from github; I removed the whole git clone directory and started again. Then, pypilot would start (at the prompt).
  • Pypilot nowadays complains a lot about 'autopilot iteration running too slow' but that seems to be the latest fashion; just filter the message (e.g., run at the prompt: pypilot | grep -v "autopilot iteration running too slow")
  • the test was done without motor controller or imu
  • to get pypilot_hat running I had to set pi:ir to false in the hat.conf. At first, this file is not present but it is when you run pypilot_hat a second time.
Good luck!


Attached Files
.txt   tid=3093.txt (Size: 2.8 KB / Downloads: 120)
Reply
#72
Can you show the error you get if pi:ir is not set to false in hat.conf?
Reply
#73
When I set pi.ir to true, the default, this is the outcome. Its was a bit of an educated guess, based on the output, pushed by despair, to set it to false and then it worked!

See attached.


Attached Files
.txt   pi.ir.true.txt (Size: 866 bytes / Downloads: 92)
Reply
#74
I see:
shutting down since pilots updated

If you try running it again even with ir set to pi it should run.
Reply
#75
(2022-04-28, 11:02 PM)seandepagnier Wrote: I see:
shutting down since pilots updated

If you try running it again even with ir set to pi it should run.

I'd try it again, but I don't see any update yet in the master branch of git.
Reply
#76
(2022-04-25, 09:56 PM)ironman Wrote: I tested this succesfully in the following way. I installed pypilot on an RP4 openplotter image from github, then ran pypilot at the prompt in one terminal window, pypilot_hat in another window, pypilot_web in a third window. Then I connected a browser to the :33333 port for the hat config screen, and another browser window to the :8000 port for the autopilot screen. I connected GPIO26 to a switch to ground and clicked the switch. In the hat config screen, this was visible and I connected it to the 'engage' function. From then on, I could see that the AP slide in the autopilot screen was switched to 'on' each time I clicked the switch.

So here is a positive scenario that you could replicate. If you succeed, work from here, changing one thing at a time, towards what you want. If you don't succeed, Francesco: post output! Attached mine.

Some notes:
  • something went wrong in the installation from github; I removed the whole git clone directory and started again. Then, pypilot would start (at the prompt).
  • Pypilot nowadays complains a lot about 'autopilot iteration running too slow' but that seems to be the latest fashion; just filter the message (e.g., run at the prompt: pypilot | grep -v "autopilot iteration running too slow")
  • the test was done without motor controller or imu
  • to get pypilot_hat running I had to set pi:ir to false in the hat.conf. At first, this file is not present but it is when you run pypilot_hat a second time.
Good luck!

Hi, you are very kind. You are encouraging me in proceeding on my attempts. So, if i'I am right, I would not need an LCD or hat device to operate a keypad and I am trying to check through the steps you kindly listed above. However I have to solve some problems related to the lack of connection to the pypilot server in browser remote mode. I would report below some outputs in order to check which are my essential issues.
ps. I have installed pypilot as a plugin through Openplotter settings and not from github. Is it a fundamental difference?
Many thanks for your kind assistance. 


wifi access point: wlan9
wifi client: wlan0 
dnsmasq (dhcp-server): running
hostapd (AP): running
dhcpcd: running
avahi-daemon: running
IP address
wlan0 192.168.1.181
wlan9 10.10.10.1

GPIO (pigpiod) (server)
TCP openplotter.local:8888
TCP 192.168.1.181:8888
TCP 10.10.10.1:8888

Pypilot server (server)
TCP openplotter.local:21311
TCP 192.168.1.181:21311
TCP 10.10.10.1:21311

Pypilot Signal K output (client)
UDP openplotter.local:20220
UDP 192.168.1.181:20220
UDP 10.10.10.1:20220

Autopilot browser controller (server)
TCP openplotter.local:8080
TCP 192.168.1.181:8080
TCP 10.10.10.1:8080

Autopilot browser controller remote (server)
TCP openplotter.local:33333
TCP 192.168.1.181:33333
TCP 10.10.10.1:33333

Pypilot NMEA 0183 output (server)
TCP openplotter.local:20220
TCP 192.168.1.181:20220
TCP 10.10.10.1:20220

VNC Remote Desktop (server)
TCP openplotter.local:5900
TCP 192.168.1.181:5900
TCP 10.10.10.1:5900

Signal K - Admin (server)
TCP openplotter.local:3000
TCP 192.168.1.181:3000
TCP 10.10.10.1:3000

Signal K - NMEA 0183 output (server)
TCP openplotter.local:10110
TCP 192.168.1.181:10110
TCP 10.10.10.1:10110

pi@openplotter:~ $ pypilot_hat
have gpio for raspberry pi
no lirc available
have gpio for raspberry pi
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
assuming original 26 pin tinypilot
loading config file: /home/pi/.pypilot/hat.conf
config failed: [Errno 2] No such file or directory: '/home/pi/.pypilot/hat.conf'
Using driver default
using glut
no languages 'NullTranslations' object has no attribute 'ugettext'
No hat config, arduino not found
failed to configure buzzer 'bool' object is not subscriptable
connected
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)

Hi, Sean, thanks for your reply. Here they are some outputs. I don't why it failed to enable unit. Is it because it doesn't find the hardware (arduino, hat, lcd)?


pi@openplotter:~ $ sudo systemctl enable pypilot_hat
Failed to enable unit: Unit file pypilot_hat.service does not exist.

pi@openplotter:~ $ sudo systemctl start pypilot_hat
Failed to start pypilot_hat.service: Unit pypilot_hat.service not found.

pi@openplotter:~ $ pypilot_hat
have gpio for raspberry pi
no lirc available
have gpio for raspberry pi
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
assuming original 26 pin tinypilot
loading config file: /home/pi/.pypilot/hat.conf
config failed: [Errno 2] No such file or directory: '/home/pi/.pypilot/hat.conf'
Using driver default
using glut
no languages 'NullTranslations' object has no attribute 'ugettext'
No hat config, arduino not found
failed to configure buzzer 'bool' object is not subscriptable
connected
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)

pi@openplotter:~ $ failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)

(2022-04-24, 01:58 PM)seandepagnier Wrote: The pypilot_hat service reads from the gpio pins as well as many other functions.   So without an alternative script , you will need the pypilot_hat service even if you dont have pypilot hat hardware or arduino.  It typically will try to detect the arduino and if it is not found, proceed without it (and remote control reception)   The usual way to enable services on debian systems is with systemctl:
sudo systemctl enable pypilot_hat
sudo systemctl start pypilot_hat

For debugging you can "disable" and "stop" the service.     If you are able to link the key to the action, does it display the action programmed on localhost:33333?    Does it show a connection to the autopilot?   Is pypilot service also running?

If you can show a screenshot and also maybe the output from running pypilot_hat directly?  Any hints about connecting?

Hi, Sean thank you. Here are some outputs. I don't know why it failed to enable unit. Is it because it doesn't find the hat hardware(hat, lcd, arduino)?


pi@openplotter:~ $ sudo systemctl enable pypilot_hat
Failed to enable unit: Unit file pypilot_hat.service does not exist.

pi@openplotter:~ $ sudo systemctl start pypilot_hat
Failed to start pypilot_hat.service: Unit pypilot_hat.service not found.

pi@openplotter:~ $ pypilot_hat
have gpio for raspberry pi
no lirc available
have gpio for raspberry pi
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
assuming original 26 pin tinypilot
loading config file: /home/pi/.pypilot/hat.conf
config failed: [Errno 2] No such file or directory: '/home/pi/.pypilot/hat.conf'
Using driver default
using glut
no languages 'NullTranslations' object has no attribute 'ugettext'
No hat config, arduino not found
failed to configure buzzer 'bool' object is not subscriptable
connected
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
pi@openplotter:~ $ failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)
Reply
#77
(2022-04-29, 12:27 PM)fsnew Wrote: Hi, you are very kind. You are encouraging me in proceeding on my attempts. So, if i'I am right, I would not need an LCD or hat device to operate a keypad and I am trying to check through the steps you kindly listed above. However I have to solve some problems related to the lack of connection to the pypilot server in browser remote mode. I would report below some outputs in order to check which are my essential issues.
ps. I have installed pypilot as a plugin through Openplotter settings and not from github. Is it a fundamental difference?
Many thanks for your kind assistance. 

No worries, I like it when people don't give up. You are right in saying that you can operate a keypad without and LCD or hat device. If you have installed pypilot through openplotter, though, you are likely to have a very old version *). Better leave the 'plugin' in openplotter, but install a fresh pypilot from github over it by following the steps given here. Read the workbook over again; it was intended to take one by the hand.

When you see this :

Code:
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)

it means that pypilot_hat is already running. Apart from that, I cannot see major issues.

*) Openplotter provides a(n older) version of pypilot, but adds a few wrapper scripts to it, so pypilot adopts the openplotter look and feel. Pypilot, though, is developed at a much faster pace than the openplotter wrappers are kept up, so the two might be a bit out of sync.
Reply
#78
(2022-04-29, 04:05 PM)ironman Wrote:
(2022-04-29, 12:27 PM)fsnew Wrote: Hi, you are very kind. You are encouraging me in proceeding on my attempts. So, if i'I am right, I would not need an LCD or hat device to operate a keypad and I am trying to check through the steps you kindly listed above. However I have to solve some problems related to the lack of connection to the pypilot server in browser remote mode. I would report below some outputs in order to check which are my essential issues.
ps. I have installed pypilot as a plugin through Openplotter settings and not from github. Is it a fundamental difference?
Many thanks for your kind assistance. 

No worries, I like it when people don't give up. You are right in saying that you can operate a keypad without and LCD or hat device. If you have installed pypilot through openplotter, though, you are likely to have a very old version *). Better leave the 'plugin' in openplotter, but install a fresh pypilot from github over it by following the steps given here. Read the workbook over again; it was intended to take one by the hand.

When you see this :

Code:
failed to run web server: [Errno 98] Address already in use: ('0.0.0.0', 33333)

it means that pypilot_hat is already running. Apart from that, I cannot see major issues.

*) Openplotter provides a(n older) version of pypilot, but adds a few wrapper scripts to it, so pypilot adopts the openplotter look and feel. Pypilot, though, is developed at a much faster pace than the openplotter wrappers are kept up, so the two might be a bit out of sync.



Hi! Good news for me. Following your detailed instructions and after a lot of attempts I have been able to do my pypilot arrangment working. So now,  after having installed pypilot git on a combined raspi+openplotter software I am able:

1) To control the pypilot through localhost 33333 by a keypad switch;
2) To launch pypilot on the terminal by pypilot_hat service;
3) to open pypilot desk by the pypilot_control service on the terminal and localhost 8080;
4) On OpenCPN  I have been able to add a GPS -Usb  device that works as it should.

 I am proceeding in my project to add a  Nokia or jlx12864 LCD display recently bought in order to use the pypilot base code by Sean. 
My question is:

a) As now I can launch pypilot on terminal ( and it works ) what happens if I add the pypilot Openplotter and OpenCPN plugins? Could I be sure that the pypilot function and relative control desk ( both Openplotter and OpenCPN) would work without launching pypilot_hat on the terminal?

b) Is it possible on the start of my Raspberry to have quickly available, without any other command , the OpenCPN output on a LCD display interfaced through the micro HDMI port to the RASPI? My aim is to control the autopilot through an external keypad only and to see the navigation status over the OpenCPN chartplotter at the start of the Raspberry without the necessity to open by hands any windows on the Raspberry. 

I am very grateful for helping me.
Best regards

Francesco
Reply
#79
Generally, you can set pypilot as a service. There is also a pypilot_hat service which you will want to enable as well. Similarly the pypilot_web service is needed for web control.

Otherwise, you can use startup scripts to start opencpn at boot, and make it autofollow, but to be able to control it you need some kind of input and there is no way to use the wireless control to zoom/pan opencpn at this time.
Reply
#80
(2022-05-28, 03:06 PM)seandepagnier Wrote: Generally, you can set pypilot as a service.   There is also a pypilot_hat service which you will want to enable as well.  Similarly the pypilot_web service is needed for web control.

Otherwise,  you can use startup scripts to start opencpn at boot, and make it autofollow, but to be able to control it you need some kind of input and there is no way to use the wireless control to zoom/pan opencpn at this time.

Ok, thank you Sean. I am proceeding as per your instructions. I would like moreover to ask for a new question related to the LCD Jlx12864 ST7565R. Practically:

1) Which are the interface pins on the raspberry to link to the corresponding LCD pins? I am now following the schematic by Andreas project but I don't find the code in the pypilot files except in the arduino ones. So my second question is:

2) To interface a LCD Jlx12864 to the autopilot is it necessary to link it to an arduino board too? May I fit the LCD straight only  to the Raspberry Pi? If yes with which pins?

I would be very grateful for helping me asking for a patience for my beginner very limited python knowledge.

Best regards

Francesco
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)