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
No communication between RPi and Nano using pypilot service
#3
(2022-07-21, 04:33 PM)seandepagnier Wrote: 1) clutch pwm is normally set from pypilot so this setting you can change from web etc (unless old version and uses this default)
2)  the service may run it as a user that has wrong permissions to access usb ?
3)  the range in RC mode or hbridge mode is 0-1.1v not 0-3.3v   for ratiometric mode 0-5

if you are really running the nano at 3v3 that would be very odd.   It is running at  5 volts correct?


4   depending on mode (described in comment), for hbridge try d2 and d3

Hi Sean

Thank you for your quick reply, both by e-mail and here Smile

1) Going into pypilot Calibration -> Settings, I see that both servo.speed.max and servo.speed.min are set to 100 %, so I guess this is based on clutch pwm in motor.ino and that everything is as I want it Smile

2) To check the user running pypilot service:
user@lysmarine:~ $ systemctl show -pUser,UID pypilot
UID=[not set]
User=pi

So it looks like the service is run by the user "pi", although the user I'm logged in as is named "user". Based on https://forum.arduino.cc/t/permission-de.../475568/11 I tried "sudo adduser pi dialout" and "sudo usermod -a -G dialout pi", but both reported that the user pi does not exist. Is there any way to change the service to be run by "user" instead of "pi"?

3) The Arduino Nano is connected via USB, so it is indeed running at 5V (there's only 4.5V on the 5V pin, though, but I guess that's ok). I am using the 3.3V pin from the Arduino to power the potmeter (48.8kOhm). I've just now inserted a 100kOhm resistor before the pot, which reduces the center pin to 0-1.1V, and pypilot registers rudder sense perfectly now (and can calibrate as intended), and OpenCPN dashboard updates as intended - I am very happy now Smile

I'm considering connecting the RPi and Nano via wires instead of USB, but that will be in the next iteration. USB is fine for now.

4) I've changed pwm_style to 0 (h-bridge) and uploaded motor.ino to the nano again. Then I tested the different D-pins using a 1kOhm resistor and a LED. I tested using the center rudder function to obtain either idle, forward or reverse. Below are the pins that made the LED light up:
Idle: D4, 5, 6, 7, 8, 12, 13 (flashing very bright)
Forward: D4, 5, 6, 7, 8, 9, 11 (very bright), 12, 13 (very bright)
Reverse: D4, 5, 6, 7, 8, 9, 11 (very bright), 12, 13 (very bright)

I then repeated the same test with pwm_style = 1 and 2, and got the same results. I don't see any activity on D2 or D3.

I will test more in the coming few days.
Reply


Messages In This Thread
RE: No communication between RPi and Nano using pypilot service - by Jonas.EH - 2022-07-22, 11:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)