Connected Battery to Power Distribution board which connect to all 4 servo rails
Connected Raspberry PI to power ( seperate source )
Navio2 is powered through Raspberry Pi
So “sudo python LED.py” works fine
The GPS ones also work fine once I connect the GPS thing on top
however “sudo python Servo.py” does not work. I am expecting that “Servo.py” will make one of the motor ( connected to pin 1 or pin 2 on Navio2) will start rotating .
This example is supposed to control micro servo motor.
If you want make it work with your ESC + Motor pairs, you should change the code as following:
import sys
import time
import navio.pwm
import navio.util
navio.util.check_apm()
PWM_OUTPUT = 0
SERVO_MIN = 1.250 #ms
ESC_INIT = 1.100 #ms
with navio.pwm.PWM(PWM_OUTPUT) as pwm:
pwm.set_period(50)
pwm.enable()
# initialize ESC: set initial duty_cicle for 3 sec
for i in range(30):
pwm.set_duty_cycle(ESC_INIT)
time.sleep(0.1)
while (True):
pwm.set_duty_cycle(SERVO_MIN)
time.sleep(0.1)
Thank you very much for reply. Now since you are here can I ask another question. When I do fresh install of Raspberry pi with Stretch (https://docs.emlid.com/navio2/common/ardupilot/configuring-raspberry-pi/) after that the first thing I try to do is following :
sudo raspi-config --expand-rootfs
However the process exit with error “Device is mounted” etc. It seems like some process (navio) is running in background because I did not initiate any process.
I google this issue and try to partition manually as well (using fdisk) however same error. Do you know by any chance what could be causing it ?
the error seems weird.
But it is a RaspberryPi problem most likely. Cant imagine running processes in the background to be a problem.
But if you think that is the problem: in the navio documentation it is stated that you can start and stop ardupilot with systemctl. sudo systemctl stop arducopter.service for example. You should take a look into the docs.