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
Motor Controller not detected by Raspberry Pi
#1
I've got a new model motor controller, wired up to a Raspberry Pi 4, and it's not being detected by either Openplotter or Tinypilot.

When connected to 12v on my bench top power supply, and connected to Pi pins 8,9,10,17 [3.3v] (pin 1 is used for my i2c IMU) I only receive a red light on the motor controller, and an error "No motor controller!" on the web interface.

The IMU is connected via QWIIC and a QWIIC shim on pins 1-6.

This is true for both tinypilot (2021 pi 4 version) and open plotter.

Openplotter, when running pypilot_servo, after disabling the pypilot service returns the following:
Code:
pi@pypilot:~ $ sudo systemctl stop pypilot
pi@pypilot:~ $ sudo pypilot_servo
pypilot Servo
world magnetic model not available
nmea process 2320
listening on port 20220 for nmea connections
gps process 2323
loading servo calibration /root/.pypilot/servocalibration
WARNING: using default servo calibration!!
read_last_working_devices failed [Errno 2] No such file or directory: '/root/.pypilot/'
pypilotServer process 2325
failed to monitor  /root/.pypilot/ Call failed (should not be -1): (-1) ERRNO=(0)
creating config directory: /root/.pypilot/
load file /root/.pypilot/pypilot.conf
failed to load pypilot.conf [Errno 2] No such file or directory: '/root/.pypilot/pypilot.conf'
load file /root/.pypilot/pypilot.conf.bak
backup data failed as well [Errno 2] No such file or directory: '/root/.pypilot/pypilot.conf.bak'
server setup has 4 pipes
zeroconf addresses ['127.0.0.1', '192.168.1.150', '10.10.10.1'] 3
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
server add socket ('127.0.0.1', 47870)
gps filter process 2324
gpsd connected
GPSD devices []
servo probe ('/dev/ttyAMA0', 38400) 146.705816042
signalk process 2322
signalk failed to read token /root/.pypilot/signalk-token
signalk server found 192.168.1.150:3000
signalk found ws://192.168.1.150:3000/signalk/v1/stream?subscribe=none
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.150:3000
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
servo probe ('/dev/ttyAMA0', 38400) 161.055823531
signalk server found 192.168.1.150:3000
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.150:3000
servo probe ('/dev/ttyAMA0', 38400) 175.355870521
servo probe ('/dev/ttyAMA0', 38400) 189.655925455
....
servo probe repeats endlessly

I've got a Pi Zero W, a new memory card, and a multimeter (since my one on the boat is, well, on the boat) coming tomorrow to test with new Pi hardware, and Sean's original 2021 image.

Any thoughts on what's being done wrong? Is it possible the embedded Arduino on the controller is busted?

Code:
pi@pypilot:~ $ sudo systemctl stop pypilot
pi@pypilot:~ $ pypilot_servo
pypilot Servo
world magnetic model not available
nmea process 2364
listening on port 20220 for nmea connections
gps process 2367
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
pypilotServer process 2369
load file /home/pi/.pypilot/pypilot.conf
store_file /home/pi/.pypilot/pypilot.conf.bak 265.712
server setup has 4 pipes
server add socket ('127.0.0.1', 48884)
zeroconf addresses ['127.0.0.1', '192.168.1.150', '10.10.10.1'] 3
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
gps filter process 2368
gpsd connected
GPSD devices []
servo probe ('/dev/ttyAMA0', 38400) 270.693644519
signalk process 2366
signalkread token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2UiOiJjZDcwYTA1ZC0xMjczLTQ4NmUtODhjMi0zNmU3OWQ1NWFhY2IiLCJpYXQiOjE3MDMxNjIxMDEsImV4cCI6MTczNDcxOTcwMX0.QW2dpq-rLh9NQg3k9FKExaVgTaQZrMi0PhjjPUQipjY
signalk server found 192.168.1.150:3000
signalk found ws://192.168.1.150:3000/signalk/v1/stream?subscribe=none
signalk connected to ws://192.168.1.150:3000/signalk/v1/stream?subscribe=none
servo probe ('/dev/ttyAMA0', 38400) 285.029541465
servo probe ('/dev/ttyAMA0', 38400) 299.329750909
servo probe ('/dev/ttyAMA0', 38400) 313.629689775
servo probe ('/dev/ttyAMA0', 38400) 328.029658993
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.150:3000
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.150:3000
signalk zeroconf service add pypilot._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.150:3000
servo probe ('/dev/ttyAMA0', 38400) 342.329715159
servo probe ('/dev/ttyAMA0', 38400) 356.829700893
servo probe ('/dev/ttyAMA0', 38400) 371.229730628
servo probe ('/dev/ttyAMA0', 38400) 385.729660884
servo probe ('/dev/ttyAMA0', 38400) 400.129699012
servo probe ('/dev/ttyAMA0', 38400) 414.429737862
servo probe ('/dev/ttyAMA0', 38400) 428.729761602
servo probe ('/dev/ttyAMA0', 38400) 443.029720659
servo probe ('/dev/ttyAMA0', 38400) 457.429717566
servo probe ('/dev/ttyAMA0', 38400) 471.730237366
servo probe ('/dev/ttyAMA0', 38400) 486.029726002
servo probe ('/dev/ttyAMA0', 38400) 500.329699544
servo probe ('/dev/ttyAMA0', 38400) 514.729657327
servo probe ('/dev/ttyAMA0', 38400) 529.029720967
servo probe ('/dev/ttyAMA0', 38400) 543.429772656
servo probe ('/dev/ttyAMA0', 38400) 557.729740352
servo probe ('/dev/ttyAMA0', 38400) 572.129729648
servo probe ('/dev/ttyAMA0', 38400) 586.529700566
servo probe ('/dev/ttyAMA0', 38400) 601.029671852
servo probe ('/dev/ttyAMA0', 38400) 615.429662178
servo probe ('/dev/ttyAMA0', 38400) 629.729648955
servo probe ('/dev/ttyAMA0', 38400) 644.029784568
servo probe ('/dev/ttyAMA0', 38400) 658.329747923
servo probe ('/dev/ttyAMA0', 38400) 672.729683315
servo probe ('/dev/ttyAMA0', 38400) 687.129746595
servo probe ('/dev/ttyAMA0', 38400) 701.52969552
servo probe ('/dev/ttyAMA0', 38400) 715.929721083
servo probe ('/dev/ttyAMA0', 38400) 730.229718702
servo probe ('/dev/ttyAMA0', 38400) 744.629738173
servo probe ('/dev/ttyAMA0', 38400) 758.929722088
pypilot_servo (Pi4 / Openplotter) running in user space.
Reply
#2
From a Pi Zero W, running Sean's newest Beta:

Code:
tc@pypilot:~$ sudo kill 1469
tc@pypilot:~$ sudo killall pypilot
killall: pypilot: no process killed
tc@pypilot:~$ ps a | grep py
1466 root     runsv pypilot_hat
1471 root     runsv pypilot_web
1473 tc       svlogd -tt /var/log/pypilot_hat
1477 tc       svlogd -tt -b 24 -l 16 /var/log/pypilot_web
2160 root     {python3.8} pypilot_hat /usr/local/lib/python3.8/site-packages/pypilot/hat/hat.py
2886 root     {gpsdate.py} /usr/local/bin/python3.8 /opt/gpsdate.py
3321 root     {pypilot_web} /usr/local/bin/python3.8 /usr/local/bin/pypilot_web 80
3376 root     {python3.8} pypilot_hat /usr/local/lib/python3.8/site-packages/pypilot/hat/hat.py
3379 root     {python3.8} pypilot_hat /usr/local/lib/python3.8/site-packages/pypilot/hat/hat.py
3383 root     {python3.8} pypilot_hat /usr/local/lib/python3.8/site-packages/pypilot/hat/hat.py
4614 root     runsv pypilot
4615 tc       svlogd -tt -b 24 -l 16 /var/log/pypilot
4619 tc       grep py
tc@pypilot:~$ pypilot_servo
pypilot Servo
world magnetic model not available
nmea process 4621
listening on port 20220 for nmea connections
gps process 4623
loading servo calibration /home/tc/.pypilot/servocalibration
WARNING: using default servo calibration!!
servo probe ('/dev/ttyAMA0', 38400) 375.721614
pypilotServer process 4625
server setup has 4 pipes
server add socket ('127.0.0.1', 50680)
gpsd connected
GPSD devices []
server add socket ('127.0.0.1', 50684)
signalk process 4622
signalkread token
zeroconf addresses ['192.168.14.1', '127.0.0.1'] 2
servo probe ('/dev/ttyAMA0', 38400) 384.306748
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
servo probe ('/dev/ttyAMA0', 38400) 384.340889
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
zeroconf exception:
servo probe ('/dev/ttyAMA0', 38400) 389.432204
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
gps filter process 4624
servo probe ('/dev/ttyAMA0', 38400) 394.531329
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
servo probe ('/dev/ttyAMA0', 38400) 394.631404
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
servo probe ('/dev/ttyAMA0', 38400) 399.831437
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
servo probe ('/dev/ttyAMA0', 38400) 404.931156
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'
servo probe ('/dev/ttyAMA0', 38400) 405.031384
failed to open servo on: ('/dev/ttyAMA0', 38400) [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'

sudo sv stop pypilot didn't actually work to stop the pypilot on this combo.

Same response with No motor controller! on the web interface for both version's.

Attempting to run pypilot_servo on the 2021 image over SSH created a python error about missing boatimu. - the web interface shows the heading and roll on both versions, so the IMU is being detected and used.

Some other quick notes:

The bench top 12.8v supply sits steady at 0.004a draw when any of the Pi's are off.

It spikes to 0.01a periodically, which roughly correlates to the Pi's probing /dev/ttyAMA0
Reply
#3
It's not the wiring:

3.3v rail on the PI is providing 3.26v.

On the controller:
3.26v from ground to vcc
3.18v from ground to RX
0.5v from ground to TX
Reply
#4
Regarding your first message, the pins on the pi are ok but in general there's this principle that the tx on one device should be connected to the rx on the other device, and vice versa. Can you confirm that you crossed them over?

Pypilot on the prompt should always run in user space: pi on openplotter and tc on tinypilot. Only the services should be managed with a sudo. The sv sudo stop I have never seen failing. May be you killed the child process manually and therefor the service errored shutting down.

If you have a pi running on 10 milli amps you have a very rare specimen ;-)
Reply
#5
That's the correct pins from the data sheet for my wire colours, although changing them around doesn't make any difference to the responses.

0.01a is the spike draw on the bench top supply to the 12vin of the motor controller, not the Pi's power draw.
Reply
#6
Could you take a picture of your setup? The wire colors can be confusing.

Further, both tx and rx should be near 3v3 most of the time.
Reply
#7
(2023-12-25, 04:38 AM)seandepagnier Wrote: Could you take a picture of your setup?  The wire colors can be confusing.

Further, both tx and rx should be near 3v3 most of the time.

Sorry for the delay, I've added them to this post.


Attached Files Image(s)
               
Reply
#8
did you try t switching tx and rx?

If you type "ls -l /dev/serial0" on the console does it point to /dev/ttyAMA0?
Reply
#9
From following the cables you connected rx to rx and tx to tx.
Reply
#10
(2024-01-01, 12:17 PM)ironman Wrote: From following the cables you connected rx to rx and tx to tx.

I'd done it repeatedly both ways, with no joy.

It's all good, I've ordered a HAT to go with the Pi Zero W bought for testing this, and will run it through that instead, which will (hopefully) fix the issues (otherwise I've got a dud motor controller).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)