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:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot web browser interface showing not connected
#1
Just got pypilot up and running today, Pi4 with openplotter.  all seems to work OK but the web browser control page opens OK but shows "pypilot Server: Not Connected"
apart from that all seems fine though it doesn't connect to signalk with mds enabled. Pypilot V2.2.1Beta. 
Usually I've missed something - any ideas? Opencpn plugin won't connect either though sending wind data from Opencpn works and enable a route pypilot follows that.


[Image: nMCyuNp.png]

[Image: J5KYlUj.png]
Reply
#2
The old version in openplotter is broken..

Please upgrade either pypilot-openplotter from git, or just pypilot:


git clone https://github.com/pypilot/pypilot
sudo python3 setup.py install
Reply
#3
Ta, just installed pypilot, everything works now so enough to be getting on with. Didn't seem to work with systemctl start but run in command line seemed fine, pypilot-web ran at port 8000.
Great stuff, thanks for the help!!  Just mechanical and wiring now  Cool
Reply
#4
Just a note, i did the git install of the openplotter above and still get not connected but the desktop version is ok.
Reply
#5
In the original openplotter pypilot i had the motor controller connected. i could move the mpu9250 and the multimeter connected to the controller a/b would show voltage change. But no web interface as per this thread.

I did the git update on openplotter-pypilot.

I add the device and connection under openplotter->serial

Status:
pypilot Server: Connected
Servo Flags:
Autopilot Errors: no motor controller!
Web Server Latency: 5.4 ms

BUT when i goto pypilot->serial and add the /dev/ttyOP_pypilot which i created above...

pypilot Server: Disconnected
Servo Flags:
Autopilot Errors: no motor controller!
Web Server Latency: 6.2 ms

pypilot server is no longer accessible and still no motor controller.

It is most likely a serial connect to the controller issue.
I am using a usb to serial adapter cp2101. (was working before git update)
Here are some logs.

==> /var/log/daemon.log <==
Oct 24 11:53:12 pi4 pypilot[25439]: autopilot start 3224.213305151
Oct 24 11:53:12 pi4 pypilot[25439]: ERROR loading wind.py cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)   cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)
Oct 24 11:53:12 pi4 pypilot[25439]: loading servo calibration /home/pi/.pypilot/servocalibration
Oct 24 11:53:12 pi4 pypilot[25439]: WARNING: using default servo calibration!!
Oct 24 11:53:12 pi4 pypilot[25439]: Available Pilots: ['basic', 'absolute', 'simple']
Oct 24 11:53:12 pi4 pypilot[25439]: warning: failed to open special file /dev/watchdog0 for writing
Oct 24 11:53:12 pi4 pypilot[25439]:          cannot stroke the watchdog
Oct 24 11:53:12 pi4 pypilot[25439]: Settings file not found. Using defaults and creating settings file
Oct 24 11:53:12 pi4 pypilot[25439]: Failed to open settings file for saveDetected MPU9250/MPU9255 at standard address
Oct 24 11:53:12 pi4 pypilot[25439]: Failed to open settings file for saveUsing fusion algorithm Kalman STATE4
Oct 24 11:53:12 pi4 pypilot[25439]: min/max compass calibration not in use
Oct 24 11:53:12 pi4 pypilot[25439]: Using ellipsoid compass calibration
Oct 24 11:53:12 pi4 pypilot[25439]: Using accel calibration
Oct 24 11:53:12 pi4 pypilot[25439]: autopilot init complete 3224.379114806
Oct 24 11:53:12 pi4 pypilot[25439]: serialprobe found more devices by path
Oct 24 11:53:12 pi4 pypilot[25439]: serialprobe removing gps device /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.0-port0
Oct 24 11:53:12 pi4 pypilot[25439]: serialprobe removing gps device /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0
Oct 24 11:53:12 pi4 pypilot[25439]: Traceback (most recent call last):
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/bin/pypilot", line 11, in <module>
Oct 24 11:53:12 pi4 pypilot[25439]:     load_entry_point('pypilot==0.32', 'console_scripts', 'pypilot')()
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 450, in main
Oct 24 11:53:12 pi4 pypilot[25439]:     ap.iteration()
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 332, in iteration
Oct 24 11:53:12 pi4 pypilot[25439]:     self.servo.poll()
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/servo.py", line 559, in poll
Oct 24 11:53:12 pi4 pypilot[25439]:     device_path = serialprobe.probe('servo', [38400], 5)
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/serialprobe.py", line 242, in probe
Oct 24 11:53:12 pi4 pypilot[25439]:     if enumerate_devices():
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/serialprobe.py", line 203, in enumerate_devices
Oct 24 11:53:12 pi4 pypilot[25439]:     scanned_devices = scan_devices()
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/serialprobe.py", line 147, in scan_devices
Oct 24 11:53:12 pi4 pypilot[25439]:     allowed_devices[path]['realpath'] = realpath
Oct 24 11:53:12 pi4 pypilot[25439]: KeyError: '/dev/ttyOP_pypilot'
Oct 24 11:53:12 pi4 pypilot[25439]: Error in atexit._run_exitfuncs:
Oct 24 11:53:12 pi4 pypilot[25439]: Traceback (most recent call last):
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll
Oct 24 11:53:12 pi4 pypilot[25439]:     pid, sts = os.waitpid(self.pid, flag)
Oct 24 11:53:12 pi4 pypilot[25439]:   File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 195, in cleanup
Oct 24 11:53:12 pi4 pypilot[25439]:     raise KeyboardInterrupt # to get backtrace on all processes
Oct 24 11:53:12 pi4 pypilot[25439]: KeyboardInterrupt
Oct 24 11:53:12 pi4 pypilot[25439]: closing autopilot
Oct 24 11:53:12 pi4 systemd[1]: pypilot.service: Main process exited, code=exited, status=1/FAILURE
Oct 24 11:53:12 pi4 systemd[1]: pypilot.service: Failed with result 'exit-code'.
Oct 24 11:53:13 pi4 systemd[1]: openplotter-pypilot-read.service: Service RestartSec=2s expired, scheduling restart.
Oct 24 11:53:13 pi4 systemd[1]: openplotter-pypilot-read.service: Scheduled restart job, restart counter is at 1163.
Oct 24 11:53:13 pi4 systemd[1]: Stopped openplotter-pypilot-read.
Oct 24 11:53:13 pi4 systemd[1]: Started openplotter-pypilot-read.

Regards,
Dennis
Reply
#6
I believe this occurs only if the device is assigned but does not exist when pypilot is started?

Anyway I have updated git, and hopefully the error is fixed now.
Reply
#7
ok i see you updated the pypilot not openplotter. this is ok i will focus on getting command line working first.
just an fyi, the dir structure and placement might need some love....

pi@pi4:~/tmp/pypilot-git $ sudo python3 ./setup.py install
/usr/bin/apt
please run this script from the pypilot directory

it wants to run from pypilot dir so then....

pi@pi4:~/tmp/pypilot-git/pypilot $ sudo python3 ../setup.py install
/usr/bin/apt
running install
running build_ext
building 'pypilot/arduino_servo/_arduino_servo' extension
swigging pypilot/arduino_servo/arduino_servo.i to pypilot/arduino_servo/arduino_servo_wrap.cpp
swig -python -c++ -o pypilot/arduino_servo/arduino_servo_wrap.cpp pypilot/arduino_servo/arduino_servo.i
Unable to find file 'pypilot/arduino_servo/arduino_servo.i'.
error: command 'swig' failed with exit status 1

adding a sym links.
ln -s . pypilot
ln -s ../hat hat

and it compiled and installed.

pypilot -- autopilot <-- started but still showed no motor controller connected in web.

running sensors....
pi@pi4:~/tmp/pypilot-git/pypilot $ pypilot_sensors
-bash: pypilot_sensors: command not found
pi@pi4:~/tmp/pypilot-git/pypilot $ /usr/local/bin/pypilot_sensors
-bash: /usr/local/bin/pypilot_sensors: No such file or directory
pi@pi4:~/tmp/pypilot-git/pypilot $ ls /usr/local/bin/pypilot*
/usr/local/bin/pypilot /usr/local/bin/pypilot_client_wx /usr/local/bin/pypilot_servo
/usr/local/bin/pypilot_boatimu /usr/local/bin/pypilot_control /usr/local/bin/pypilot_web
/usr/local/bin/pypilot_calibration /usr/local/bin/pypilot_hat
/usr/local/bin/pypilot_client /usr/local/bin/pypilot_scope

pi@pi4:~/tmp/pypilot-git/pypilot $ pypilot_boatimu
imu process 7586
pypilotServer process 7588
server setup has 3 pipes
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Detected MPU9250/MPU9255 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
MPU-925x init complete
imu rate set to rate 202 roll -0.7149461117343743 heading 108.2590862333762
setting initial gyro bias [2.516, 4.069, 1.4929999999999999]
calibration loaded, starting 75856252137207876687 heading 107.32602177493588
^CProcess Process-3:2132 roll -0.6407787070699742 heading 107.03908411923062

pi@pi4:~/tmp/pypilot-git/pypilot $ pypilot_servo
pypilot Servo
Traceback (most recent call last):
File "/usr/local/bin/pypilot_servo", line 11, in <module>
load_entry_point('pypilot==0.32', 'console_scripts', 'pypilot_servo')()
File "/usr/local/lib/python3.7/dist-packages/pypilot/servo.py", line 775, in main
sensors = Sensors(client)
TypeError: __init__() missing 1 required positional argument: 'boatimu'


pi@pi4:~ $ pypilot_web
using default port of 8000
failed to import flask_babel, translations not possible!! [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/pypilot/web/translations'
processing clients
Client connected DZT_Y1C2kZXbwEQ8AAAB

still shows Autopilot Errors: no motor controller!

i didnt uninstall the openplotter version. i saw it overwrote the files.
are there any usb settings to the controller i can check on rpi?
as mentioned it was working before so i am not sure where the glitch is after the udpate.

one suggestion in the web client would be to show a green/red dot when connected/online. i noticed that the web page showed disconnected but the service on the rpi was not even running. if service is not connected and online then maybe page should go down or show that service is not running. i realize if port 8000 is not active no messages but would be nice to have a heartbeat to at least kill the page if service is done.

on running pypilot command line there is this....

serialprobe removing gps device /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0

I have removed the gps from usb. I only have the motor controller plugged in.
Previously when the motor controller worked it was all done through openplotter. I have removed the openplotter.
Where do config files sit for setting the usb port of motor controller?
Reply
#8
ok. after a few hours and review of the serialprobe.py i have updated files.

.pypilot/serial_ports
.pypilot/servodevice

i have used ttyUSB0 and ttyUSB1 rather than by-id and/or by-path
I will reboot a few times and see if the devices will stick.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)