This is an old revision of the document!
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.
The software uart device /dev/ttyS0 is unreliable. It is recommended to use the hardware serial port /dev/ttyAMA0 which means you need to disable bluetooth. To see which serial port is available:
pi@openplotter:~ $ ls -l /dev/serial0 lrwxrwxrwx 1 root root 7 Jul 24 07:17 /dev/serial0 -> ttyAMA0
If it points instead to ttyS0, then edit /boot/config.txt and add the line: dtoverlay=pi3-disable-bt and reboot.
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