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
#21
still curious about the outcome of those statements and the output of pypilot_hat none after that patch?

It might not be important for you now but it might help others in the future. Thx!
Reply
#22
I ran the patch again and saw there were a load of errors to do with permissions:
pi@openpcpn:~ $ pip3 uninstall python-socketio python-engineio flask-socketio
Uninstalling python-socketio-5.1.0:
Would remove:
/usr/local/lib/python3.7/dist-packages/python_socketio-5.1.0.dist-info/*
/usr/local/lib/python3.7/dist-packages/socketio/*
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 563, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/dist-packages/python_socketio-5.1.0.dist-info/INSTALLER' -> '/tmp/pip-uninstall-u3krkdgm/usr/local/lib/python3.7/dist-packages/python_socketio-5.1.0.dist-info/INSTALLER'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/uninstall.py", line 75, in run
auto_confirm=options.yes, verbose=self.verbosity > 0,
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 683, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_uninstall.py", line 224, in remove
renames(path, new_path)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/misc.py", line 280, in renames
shutil.move(old, new)
File "/usr/lib/python3.7/shutil.py", line 578, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/dist-packages/python_socketio-5.1.0.dist-info/INSTALLER'

so I did it again with sudo in front of pip3:
pi@openpcpn:~ $ sudo pip3 uninstall python-socketio python-engineio flask-socketio
Uninstalling python-socketio-5.1.0:
Would remove:
/usr/local/lib/python3.7/dist-packages/python_socketio-5.1.0.dist-info/*
/usr/local/lib/python3.7/dist-packages/socketio/*
Proceed (y/n)? y
Successfully uninstalled python-socketio-5.1.0
Uninstalling python-engineio-4.0.1:
Would remove:
/usr/local/lib/python3.7/dist-packages/engineio/*
/usr/local/lib/python3.7/dist-packages/python_engineio-4.0.1.dist-info/*
Proceed (y/n)? y
Successfully uninstalled python-engineio-4.0.1
Not uninstalling flask-socketio at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'Flask-SocketIO'. No files were found to uninstall.
pi@openpcpn:~ $
pi@openpcpn:~ $ pip3 install flask-socketio<5""flask-socketio<5"
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: flask-socketio<5 in /usr/lib/python3/dist-packages (2.9.0)
Collecting python-socketio>=1.5.0 (from flask-socketio<5)
Downloading https://files.pythonhosted.org/packages/...ne-any.whl (53kB)

19% |###### | 10kB 3.7MB/s eta 0:00:01
38% |############ | 20kB 4.2MB/s eta 0:00:01
57% |################## | 30kB 4.1MB/s eta 0:00:01
76% |######################## | 40kB 3.5MB/s eta 0:00:01
96% |############################## | 51kB 2.7MB/s eta 0:00:01
100% |################################| 61kB 1.5MB/s
Requirement already satisfied: bidict>=0.21.0 in /usr/local/lib/python3.7/dist-packages (from python-socketio>=1.5.0->flask-socketio<5) (0.21.2)
Collecting python-engineio>=4 (from python-socketio>=1.5.0->flask-socketio<5)
Downloading https://files.pythonhosted.org/packages/...ne-any.whl (50kB)

20% |###### | 10kB 3.5MB/s eta 0:00:01
40% |############ | 20kB 3.7MB/s eta 0:00:01
60% |################### | 30kB 4.2MB/s eta 0:00:01
80% |######################### | 40kB 4.4MB/s eta 0:00:01
100% |################################| 51kB 1.8MB/s
Installing collected packages: python-engineio, python-socketio
Successfully installed python-engineio-4.0.1 python-socketio-5.1.0

I also set pi.ir to false in hat.conf. Running pypilot.hat none now I get:

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
arduino process on 1985
renice: failed to set priority for 1985 (process ID): Permission denied
warning, failed to renice hat arduino process
No hat config, arduino not found
1986 (process ID) old priority 0, new priority 19
web process 1986
web config {'remote': False, 'host': 'pypilot', 'actions': {'auto': [], 'menu': [], 'up': [], 'down': [], 'select': [], 'left': [], 'right': [], 'engage': ['gpio17'], 'disengage': ['gpio23'], '1': ['gpio27'], '-1': ['gpio22'], '2': [], '-2': [], '10': ['gpio5'], '-10': ['gpio6'], 'compassmode': ['gpio18'], 'gpsmode': [], 'windmode': ['gpio26'], 'tackport': [], 'tackstarboard': []}, 'pi.ir': False, 'arduino.ir': False, 'arduino.nmea.in': False, 'arduino.nmea.out': False, 'arduino.nmea.baud': 4800, 'lcd': {'contrast': 60, 'invert': False, 'backlight': 200, 'flip': False, 'language': 'en', 'bigstep': 10, 'smallstep': 1, 'remote': False, 'hue': 27}}
web process on port 33333
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)

The web pages on 33333 and 8080 both show no connection to pypilot.

Hope this helps
Regards
David
Reply
#23
Thanks for doing this!

This looks weird: pi@openpcpn:~ $ pip3 install flask-socketio<5""flask-socketio<5"

Can you try it again, this time with sudo's:

Code:
sudo pip3 uninstall python-socketio python-engineio flask-socketio
sudo pip3 install "flask-socketio<5"

You are on the latest openplotter image, right?
Reply
#24
Also having issues upgrading to .24 on newest openplotter image.  Followed steps for the web fix and everything was working on .16 prior to upgrading with git.

pypilot_web has no errors on command line but shows no connection on webpage and get 'javascript:void(0)' when hovering over buttons.

pypilot_hat runs the lcd but don't get webpage, pressing gpio buttons exits:

pi@openplotter:~ $ 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'
arduino process on  4698
renice: failed to set priority for 4698 (process ID): Permission denied
warning, failed to renice hat arduino process
No hat config, arduino not found
4700 (process ID) old priority 0, new priority 19
web failed to run process: module 'web' has no attribute 'web_process'

After button press:

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 448, in main
    hat.poll()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/hat.py", line 394, in poll
    i.poll()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/lcd.py", line 327, in poll
    next_page = self.page.process()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/hat/page.py", line 732, in process
    speed = keys[key][0]
KeyError: 0
got signal atexit cleaning up 4613
got signal 17 cleaning up 4613
subprocess returned (0, 0) []
got signal 17 cleaning up 4613


pi@openplotter:~ $ pip3 freeze | grep -iE "engine|socket"
Flask-SocketIO==2.9.0
gevent-websocket==0.10.1
python-engineio==3.14.2
python-socketio==4.6.1
websocket-client==0.58.0


Any help greatly appreciated!

Edit: pypilot_web does actually show "unsupported version of the Socket.IO or Engine.IO protocols" after opening web page.
Reply
#25
(2021-05-01, 02:11 PM)ajax Wrote: Edit: pypilot_web does actually show "unsupported version of the Socket.IO or Engine.IO protocols" after opening web page.

Can you try this?

Code:
sudo pip3 uninstall -y python-socketio python-engineio flask-socketio
sudo pip3 install --ignore-installed "flask-socketio<5" "python-socketio<5"
Reply
#26
Same issues as before.  Freeze shows flask-socketio updated to 4.3.2 but everything else is the same.

Uninstall does not touch flask-socketio, maybe because it's installed from the package manager?  Gives me this:

Not uninstalling flask-socketio at /usr/lib/python3/dist-packages, outside environment /usr


Installation results:

Successfully installed Flask-1.1.2 Jinja2-2.11.3 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 flask-socketio-4.3.2 itsdangerous-1.1.0 python-engineio-3.14.2 python-socketio-4.6.1 six-1.15.0
Reply
#27
I just updated pypilot so you can use the newes flask-socketio now. Maybe the version mismatch is the problem?
Reply
#28
Looking hopeful. I did the following and I got a 'client connected'.

Code:
cd
cd pypilot
git pull
sudo python3 setup.py install

sudo pip3 uninstall -y python-socketio python-engineio flask-socketio
sudo pip3 install --ignore-installed python-socketio python-engineio flask-socketio
pypilot_web

I see what you did; only now I understand what you meant about the javascript library involved. Thanks for solving this; this was a tough one I guess.
Reply
#29
Pypilot web now works for me too!  Thanks!

Unfortunately still have the same issue with pypilot hat, though.
Reply
#30
it should work on all cases, what error do you see?

also, you have to clear your browser files.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)