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
Problem with GPIO push button inputs following Pypilot upgrade
#1
Hi, I have recently upgraded Pypilot on my RPi3 to 0.24 so that the OpenCPN Pypilot plugin will work.  Everything seems to work fine (including the plugin) except for the push button controls I have connected to the Pi GPIO.  I checked in hat.conf and the GPIO definitions are all correct.  when I browse to port 33333 I get the remote control setup web page and this shows it is connected to Pypilot, but the button presses are not showing. 
Any ideas as to what I may have missed during the upgrade?
Many thanks
David
Reply
#2
is pypilot_hat running as a service?

What does journalctl say? Are there not permissions? What does gpio readall show for the io pin states when pressing and not pressing each button?
Reply
#3
Hi Sean, many thanks for your quick response. the buttons are working OK when read using gpio readall. I cant find any mention of pypilot_hat in journalctl. I tried to manually start pypilot_hat (sudo systemctl start pypilot_hat) but got "unit pypilot_hat.service not found"
Does that help sort the problem?
Reply
#4
It must be running if the webserver on port 33333 is working.
Reply
#5
Can you just run 'pypilot_hat none' (not the service) at the prompt and share the output?
Reply
#6
(2021-04-07, 05:06 PM)ironman Wrote: Can you just run 'pypilot_hat none' (not the service) at the prompt and share the output?

I found pypilot_hat in the usr/local/bin directory and tried running it,  the LCD display popped up but  there were loads of errors (see attached).  The web interface on port 33333 was not available.  Previously, I had tried running hat.py (as per the old 0.16 version of pypilot) and this did start the web service.
I have modified the hat desktop file in home/pi/.config/autostart so that it starts pypilot_hat, instead of hat.py.  From the errors it looks like I must have missed something when doing the pypilot upgrade.
Any help would be much appreciated.

[attachment=1437 Wrote:drbarritt pid='18919' dateline='1617912517']
(2021-04-07, 05:06 PM)ironman Wrote: Can you just run 'pypilot_hat none' (not the service) at the prompt and share the output?

I found pypilot_hat in the usr/local/bin directory and tried running it,  the LCD display popped up but  there were loads of errors (see attached).  The web interface on port 33333 was not available.  Previously, I had tried running hat.py (as per the old 0.16 version of pypilot) and this did start the web service.
I have modified the hat desktop file in home/pi/.config/autostart so that it starts pypilot_hat, instead of hat.py.  From the errors it looks like I must have missed something when doing the pypilot upgrade.
Any help would be much appreciated.


Attached Files Image(s)
       
Reply
#7
Hey David, just run 'pypilot_hat' or 'pypilot_hat none' at the prompt; no need for sudo, python3 or changing the directory to /usr/local/bin. Best is to capture the full text and post it here, instead of a graphical screen dump of just a portion of the output; if it is very long consider to upload it in an attached .txt file.

If there is no pypilot_hat.service, something must have gone wrong in the upgrade, and in that case it's miraculous you still had the port 33333 web interface working. I guess it does not work anymore after a reboot?

Are you on openplotter? If you want to restore the previous version of pypilot you might use the openplotter installer, which will install 0.16. What type of lcd/hat do you have installed?
Reply
#8
(2021-04-08, 11:13 PM)ironman Wrote: Hey David, just run 'pypilot_hat' or 'pypilot_hat none' at the prompt; no need for sudo, python3 or changing the directory to /usr/local/bin. Best is to capture the full text and post it here, instead of a graphical screen dump of just a portion of the output; if it is very long consider to upload it in an attached .txt file.

If there is no pypilot_hat.service, something must have gone wrong in the upgrade, and in that case it's miraculous you still had the port 33333 web interface working. I guess it does not work anymore after a reboot?

Are you on openplotter? If you want to restore the previous version of pypilot you might use the openplotter installer, which will install 0.16. What type of lcd/hat do you have installed?

Hi, many thanks for your help.  I did as you suggested via SSH and the log is attached.  I am a newbie with Linux and it doesn't mean much to me!  Yes I am running openplotter and it is a shame this does not have the latest version of pypilot included.  I am reluctant to go back to 0.16 as then the plugin won't work.  I don't have a hat, just an IMU.  I have only had the 33333 web server working when I ran the old py.hat.  
Thanks
David

(2021-04-09, 10:47 AM)drbarritt Wrote:
(2021-04-08, 11:13 PM)ironman Wrote: Hey David, just run 'pypilot_hat' or 'pypilot_hat none' at the prompt; no need for sudo, python3 or changing the directory to /usr/local/bin. Best is to capture the full text and post it here, instead of a graphical screen dump of just a portion of the output; if it is very long consider to upload it in an attached .txt file.

If there is no pypilot_hat.service, something must have gone wrong in the upgrade, and in that case it's miraculous you still had the port 33333 web interface working. I guess it does not work anymore after a reboot?

Are you on openplotter? If you want to restore the previous version of pypilot you might use the openplotter installer, which will install 0.16. What type of lcd/hat do you have installed?

Hi, many thanks for your help.  I did as you suggested via SSH and the log is attached.  I am a newbie with Linux and it doesn't mean much to me!  Yes I am running openplotter and it is a shame this does not have the latest version of pypilot included.  I am reluctant to go back to 0.16 as then the plugin won't work.  I don't have a hat, just an IMU.  I have only had the 33333 web server working when I ran the old py.hat.  
Thanks
David

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.04.09 09:50:04 =~=~=~=~=~=~=~=~=~=~=~=

pi@openpcpn:~ $ pypilot_hat
have gpio for raspberry pi
loading config file: /home/pi/.pypilot/hat.conf
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'

pi@openpcpn:~ $ pypilot_hat none
have gpio for raspberry pi
loading config file: /home/pi/.pypilot/hat.conf
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
overriding driver default  to command line none
Traceback (most recent call last):
  File "/usr/local/bin/pypilot_hat", line 11, in <module>
    load_entry_point('pypilot==0.24', 'console_scripts', 'pypilot_hat')()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/hat.py", line 435, in main
    hat = Hat()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/hat.py", line 236, in __init__
    self.lcd = lcd.LCD(self)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/lcd.py", line 131, in __init__
    if screen:
UnboundLocalError: local variable 'screen' referenced before assignment
pi@openpcpn:~ $ 
Reply
#9
Hey David, this is a proper report indeed, and it looks like you run into a problem that has already been reported. We need to wait for this to be fixed.
Reply
#10
Thanks for your help. I will an eye on the issue and hope it is resolved soon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)