This is an old revision of the document!
It is useful to run pypilot directly from the command line to quickly start and stop the server for debugging and development.
Only one server process (which listens on port 21331 for clients) can be run at a time. To ensure no other process is running execute:
$ ps aux | grep python
If another process already is bound to this port when you execute a server script, you will see the message: signalk_server: bind failed, try again.
Under openplotter, it might be useful to disable pypilot from the pypilot tab in openplotter config. If pypilot is installed as a systemd service: sudo service pypilot stop Under tinypilot: sudo sv d pypilot
For testing just the motor controller, it can be useful to execute the servo script: pypilot_servo or pypilot/servo.py
This connects to the motor controller and will output the voltage and other measurements to the console when it works. Otherwise it will try to detect a motor controller and with no output indicates the controller is not found.
pi@openplotter:~ $ pypilot_servo Servo Server loading servo calibration /home/pi/.pypilot/servocalibration WARNING: using default servo calibration!! connected to gpsd nmea poll times 0.298720121384 8.20159912109e-05 1.28746032715e-05 8.10623168945e-06 6.60419464111e-05 arduino servo found on [u'/dev/ttyAMA0', 38400] serialprobe success: /home/pi/.pypilot/servodevice [u'/dev/ttyAMA0', 38400] voltage: 12.76 current 0.0 ctrl temp 23.26 motor temp False rudder pos False flags SYNC voltage: 12.76 current 0.0 ctrl temp 23.25 motor temp False rudder pos False flags SYNC voltage: 12.75 current 0.0 ctrl temp 23.28 motor temp False rudder pos False flags SYNC voltage: 12.76 current 0.0 ctrl temp 23.28 motor temp False rudder pos False flags SYNC voltage: 12.76 current 0.0 ctrl temp 23.28 motor temp False rudder pos False flags SYNC voltage: 12.76 current 0.0 ctrl temp 23.28 motor temp False rudder pos False flags SYNC
For testing just the imu (inertial sensors) it is useful to run this script. If an autopilot is not needed, and only calibrated compass, this script can be used as well. openplotter uses it for “imu only” mode.
pi@openplotter:~ $ pypilot_boatimu Settings file not found. Using defaults and creating settings file Using settings file RTIMULib.ini 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
The pitch, roll and heading are now output to the console, and the pypilot_calibration can be used.
To test nmea connections, and also to relay nmea data between tcp port 20220 and any nmea serial devices connected
This runs the full autopilot which includes all of the above services as well as the autopilot control loop