Closed kagouraki closed 7 months ago
You have a water speed sensor correct? It tries to use this instead of gps speed to calculate true wind... but as you can see there is a bug if you remove the waterspeed sensor. It is great you found this, because most people dont have such a sensor. I have updated git to hopefully fix this.
You said "Also i want to mention that i needed to change the 60-gpsd.rules and commented out the CP210x portion so it wont remove the hub after discovering it."
I am not sure what you mean by "it wont remove the hub after discovering it" Could you explain a little more? I am assuming you have a cp210x serial device that is not a gps, but the rules think it is or?? I will try to figure a way to improve it if so.
ok, firsts things first. I installed a fresh tinypilot_beta_2024_01_14.img and tried to update to the main branch to test the changes you made for the water sensor:
cd
mkdir pypilot-update
cd pypilot-update/
git clone git@github.com:pypilot/pypilot.git
git clone --depth 1 git@github.com:pypilot/pypilot_data.git
cp -rv pypilot_data/* pypilot
cd pypilot
. pypilot.build
sudo reboot
after the reboot the screen is stuck at the logo so i ssh and try to run pypilot manually and get :
tc@pypilot:~$ pypilot
autopilot start 555.127886
falling back to python nonblocking socket, will consume more cpu cannot import name 'linebuffer'
pypilot failed to import required modules. Did you forget to run sudo python3 setup.py install?
tc@pypilot:~$
when i run the sudo python3 setup.py install
from the pypilot directory(the tinypilot image original one since i rebooted and the previously cloned main branch is deleted) the screen works and pypilot is started. In the info i see the version is 0.45. Also the web interface doent work.
I run the filestool.sh -b but after reboot the same thing. What is the procedure to update to the latest main branch from the image tinypilot_beta_2024_01_14.img ?
So as for the usb devices, I have the hardware mentioned previously. When i dont comment the cp210x line in the 60-gpsd.rules pypilot starts as this :
tc@pypilot:/mnt/mmcblk0p2/tinypilot/pypilot$ pypilot
autopilot start 1427.002011
world magnetic model not available
ERROR loading gps.py cannot import name 'HeadingOffset' cannot import name 'HeadingOffset'
ERROR loading wind.py cannot import name 'HeadingOffset' cannot import name 'HeadingOffset'
imu process 6697
made imu process realtime
Using settings file RTIMULib.ini
Settings file not found. Using defaults and creating settings file
Detected ICM20948 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: ICM-20948
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
warning, failed to make calibration process idle, trying renice
ICM-20948 init complete
IMU all sensor axes verified
nmea process 6706
listening on port 20220 for nmea connections
gps process 6709
loading servo calibration /home/tc/.pypilot/servocalibration
WARNING: using default servo calibration!!
Available Pilots: ['absolute', 'basic']
warning: failed to open special file /dev/watchdog0 for writing
cannot stroke the watchdog
pypilotServer process 6711
pypilotinit complete 1430.055879
serialprobe found more devices by path
serialprobe removing gps device /dev/serial/by-path/platform-20980000.usb-usb-0:1.4:1.0-port0
serialprobe removing gps device /dev/serial/by-path/platform-20980000.usb-usb-0:1.1:1.0-port0
servo probe ('/dev/ttyAMA0', 38400) 1430.152082
server/client is running too _slowly_ 0.13522699999998622
arduino servo found ['/dev/ttyAMA0', 38400]
serialprobe success: /home/tc/.pypilot/servodevice ['/dev/ttyAMA0', 38400]
Arduino motor controller EEPROM SIGNATURE ok
load file /home/tc/.pypilot/pypilot.conf
store_file /home/tc/.pypilot/pypilot.conf.bak 1431.150
server setup has 6 pipes
imu rate set to rate 20
too long write pipe 0.06209206581115723 pypilotServer pipe3[1] 15
gpsd connected
GPSD devices ['/dev/ttyUSB0', '/dev/ttyUSB1']
too long write pipe 0.07815408706665039 pypilotServer pipe3[1] 42
imu rate set to rate 20
setting initial gyro bias [0.763, -0.235, -0.047]
server add socket ('127.0.0.1', 34748)
server add socket ('127.0.0.1', 34750)
zeroconf addresses ['127.0.0.1', '192.168.1.18'] 2
sensors is running too _slowly_ 0.3948849999999311
signalk process 6708
signalkread token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2UiOiJweXBpbG90LTI1MTcwMjk3NDg5IiwiaWF0IjoxNjYyMTAzNjAzLCJleHAiOjE2OTM2NjEyMDN9.Hs_3V83weuk8KiDXCTZ59DMGS3rZEJCNfsU8W0IjnWA
gps filter process 6710
calibration loaded, starting 6696
and i get no nmea data because i understand it doesnt probe the input to recieve them. Truly i dont undestand the difference between gps device and nmea in device. Why should it know before recieving data what device it is? I am testing it on the bench and i have a nmeatester sendig this file over and over again with all sorts of nmea data. Nmea0183Tester.txt
Ok found the solution to the update procedure in the wiki in another section. You need to run the pypilot.build command twice before rebooting. Now with the main branch and version 0.45 the problem of the water sensor is fixed. But the web interface is not working anymore. The Hat configuration 33333 is working but the port 80 is saying
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
error 500.
Should i open a new Issue ? The water sensor one is considered closed
I think here lies the web interface problem :
tc@pypilot:~$ pypilot_web
using port 8000
failed to import flask_babel, translations not possible!! [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/pypilot/web/translations'
processing clients
[2023-04-12 11:12:58,289] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/site-packages/pypilot/web/web.py", line 197, in index
return render_template('index.html', async_mode=socketio.async_mode, pypilot_web_port=pypilot_web_port, tinypilot=tinypilot.tinypilot, translations=translations, language=config['language'], languages=Markup(LANGUAGES))
NameError: name 'LANGUAGES' is not defined
[2023-04-12 11:12:58,711] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/site-packages/pypilot/web/web.py", line 197, in index
return render_template('index.html', async_mode=socketio.async_mode, pypilot_web_port=pypilot_web_port, tinypilot=tinypilot.tinypilot, translations=translations, language=config['language'], languages=Markup(LANGUAGES))
NameError: name 'LANGUAGES' is not defined
[2023-04-12 11:13:05,080] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/site-packages/pypilot/web/web.py", line 197, in index
return render_template('index.html', async_mode=socketio.async_mode, pypilot_web_port=pypilot_web_port, tinypilot=tinypilot.tinypilot, translations=translations, language=config['language'], languages=Markup(LANGUAGES))
NameError: name 'LANGUAGES' is not defined
I think it is when you removed the Greek translations
The issue with gps is, some gps use binary mode and gpsd must read from them rather than pypilot. So in this case, it is good to prevent pypilot from probing those devices, and to give hints to gpsd to use them. Unfortunately it seems you have a device which was known as a potential gps, but in your case is actually a nmea0183 device. For this I am not sure what solution to deal with it as there is always going to have to be manual configuration to specify it (you have managed to do this but editing the udev rules is not supposed to be required)
As for updating, I fixed the issue with running pypilot.build twice I thought, but it seems that the way you have updated (a fresh clone) rather than pulling the existing repository into /home/tc/pypilot may be the reason.
I dont seem to get the error with LANGUAGES either which is not specific to removing greek but must be because of how you updated. I am not sure exactly why this occurred but for now I would suggest pulling instead of cloning.
Ok i did it. letting this info here for reference for what i did from fresh install of the tinypilot_beta_2024_01_14.img image:
cd
rm -f .ssh/knows_hosts
cd pypilot
git pull git@github.com:pypilot/pypilot.git
rm -rf web/translations/el
rm -rf hat/translations/el
python3 /hat/ugfx/generate_version.py
. pypilot.build
sudo reboot
Thanks Sean for your help. You are awesome !
the generate_version.py script is only used to generate the initial splash screen. You would also have to build with "make" and copy the splash to /opt It doesnt enhance the pilot in any way, but perhaps these steps should be integrated into pypilot.build
Yes i know what the generate_version.py script does. I read it. I wanted the true version to be displayed on splash so i made the steps above and now the splash version says 0.45 which is the updated one and the one reported in the pypilot info page. I didnt copy anything. I didnt run make. I just run pypilot.build.
That is because I already did the steps to make that image.
I am trying Seans newest beta image of tinypilot tinypilot_beta_2024_01_14.img. I have a hat and motor controller from Sean, a pi zero w and the usb hub from waveshare ( https://www.waveshare.com/wiki/USB_HUBHAT(B) ) I have two of these boards connected to the hub and configured for USB to RS232 data ( https://www.aliexpress.com/item/1005004423540244.html )
everything seems to work perfectly until i stop the incoming nmea stream. Then it crashes. This is the terminal output :
The /dev/serial/by-path/platform-20980000.usb-usb-0:1.1:1.0-port0 has nothing connected so it keeps probing. Disregard it. Also i want to mention that i needed to change the 60-gpsd.rules and commented out the CP210x portion so it wont remove the hub after discovering it. I just made the exact same things in the tinypilot_2021_11_16.img.xz image and it works as expected.
I hope it is a easy fix because version 0.46 has awesome feautures !