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
Getting wind mode and GPS mode into pypilot
#21
This is beyond what I know. I do notice, however, that the client disconnects not long after messages like 'pypilot socket failed to send to 192.168.14.5:20220 1'. That I find weird, as it means that pypilot tries to SEND data to the socket on your router. Wouldn't know why it tries to send anything, but I have a sort of an intuitive hunch that that could be the reason for disconnecting.
Reply
#22
I tried something else:
1- the same but only with wind frames sent to the router TCP port--->same result and in particular this sequence:
pypilot socket failed to send to 192.168.14.5:20220 1
pypilot socket failed to send to 192.168.14.5:20220 10
pypilot socket failed to send to 192.168.14.5:20220 100
nmea client lost connection
sensor wind lost tcp WIsocket1
nmea client connected 192.168.14.5:20220
sensor found wind tcp WIsocket2

2- I sent nothing to the router TCP port AND sent GPS and wind NMEA sentences to the pypilot TCP port 20220 through Opencpn:

tc@pypilot:~$ sudo sv stop pypilot
ok: down: pypilot: 0s
tc@pypilot:~$ pypilot
autopilot start 395.530518859
ERROR loading wind.py cannot import name 'HeadingOffset' cannot import name 'HeadingOffset'
ERROR loading gps.py cannot import name 'HeadingOffset' cannot import name 'HeadingOffset'
imu process 4234
made imu process realtime
Using settings file RTIMULib.ini
Settings file not found. Using defaults and creating settings file
nmea process 4239
listening on port 20220 for nmea connections
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
loading servo calibration /home/tc/.pypilot/servocalibration
WARNING: using default servo calibration!!
gps process 4242
Available Pilots: ['simple', 'basic', 'absolute']
warning: failed to open special file /dev/watchdog0 for writing
cannot stroke the watchdog
pypilotServer process 4244
warning, failed to make calibration process idle, trying renice
server setup has 5 pipes
autopilot init complete 395.794995004
servo probe ('/dev/ttyAMA0', 38400) 395.805067036
server add socket ('127.0.0.1', 40916)
ICM-20948 init complete
server add socket ('127.0.0.1', 40918)
arduino servo found ['/dev/ttyAMA0', 38400]
serialprobe success: /home/tc/.pypilot/servodevice ['/dev/ttyAMA0', 38400]
server add socket ('127.0.0.1', 40920)
server add socket ('192.168.14.86', 44938)
setting initial gyro bias [-0.743, 0.114, -0.198]
imu rate set to rate 20
gpsd connected
GPSD devices []
EEPROM SIGNATURE ok
calibration loaded, starting 4233
sensors is running too _slowly_ 0.07777291699994748
read imu running too _slowly_ 0.04094255199998997 0.05
nmea client failed to connect 192.168.14.5:20220
signalk process 4241
signalkread token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2UiOiJweXBpbG90LTI1MTcwMjk3NDg5IiwiaWF0IjoxNjI4MjQ0MjkyLCJleHAiOjE2NTk4MDE4OTJ9.64SjpKncbuBgWYlyWYfFQ9JCkl9TOO-4OOVpBPRgG6s
sensor found gps tcp AIsocket0
sensor found wind tcp WIsocket0
sensor wind lost tcp WIsocket0
sensor found wind tcp WIsocket0
servo calibration invalid False
read imu running too _slowly_ 0.031591457999979866 0.05
sensor wind lost tcp WIsocket0
sensor found wind tcp WIsocket0
sensor wind lost tcp WIsocket0
sensor found wind tcp WIsocket0

Then the sequence mentioned at 1- above does not appear anymore, from time to time, about every 5 minutes or so, the wind info is lost but recovered immediately and GPS info does not seems to be lost at all. Also the WIsocket stays to 0 whereas before it was incremented 0,1,2,etc. which may result in a crash eventually I suppose even though I do not know what it is...
enough for today!

(2023-01-04, 12:37 AM)ironman Wrote: This is beyond what I know. I do notice, however, that the client disconnects not long after messages like 'pypilot socket failed to send to 192.168.14.5:20220 1'. That I find weird, as it means that pypilot tries to SEND data to the socket on your router. Wouldn't know why it tries to send anything, but I have a sort of an intuitive hunch that that could be the reason for disconnecting.

Yes I drew the same conclusion! see above
Reply
#23
It is near impossible for me to debug this without being able to reproduce...

Basically, yes something is wrong, but it is unclear if the router disconnects somehow or there is actually an exception in pypilot though none seems to be thrown.
Reply
#24
I compiled a fresh pypilot from github, configured a nmea client and fed it selected simulation data through this client. I could not replicate your 'client disconnects' this way.
Reply
#25
A bug was recently uncovered that may contribute to this.

https://github.com/pypilot/pypilot/issues/182
Reply
#26
Actually, having traced the code, this message comes from a module that takes care of pypilot's internal communication mechanism:

Code:
pypilot socket failed to send to 192.168.14.5:20220 1
pi@openplotter:~/pypilot/pypilot $ grep 'pypilot socket failed to send' *
bufferedsocket.py:                    print(_('pypilot socket failed to send to'), self.address, self.sendfail_cnt)

This would mean that somewhere you have configured pypilot incorrectly, inadvertently having configured the address of your nmea server (192.168.14.5:20220) into a place where pypilot thinks there's a pypilot server sitting. I would not know where that could be. Could you grep in the .pypilot directory for 192.168.14.5 and look what comes up?

Code:
grep 192.168.14.5 ~/.pypilot/*
Reply
#27
Thank you for your support, this is what I get:

Code:
tc@pypilot:~$ grep 192.168.14.5 ~/.pypilot/*
/home/tc/.pypilot/pypilot.conf:nmea.client="192.168.14.5:20220"
/home/tc/.pypilot/pypilot.conf.bak:nmea.client="192.168.14.5:20220"

I might try to assign a different client IP address to the router? 192.168.14.2 i.e. ? or try DHCP instead?
Reply
#28
Different router (=nmea client address) would be a good try. I'm running out of options I could think of. Next step would now be to start tracing the code with debug statements. What Pypilot version is it again?
Reply
#29
I am using tinypilot 2022_11_16, last image available on pypilot.org
Changing the NMEA router client IP address to 192.168.14.2 did not bring any change
Regarding DHCP is there a range of IP address pypilot allows for clients to connect to?
Reply
#30
You should be able to manually set ip address in the range 192.168.14.X on the pypilot access point otherwise dhcp will assign them automatically.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)