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
Autopilot Errors: no motor controller
#1
Hello,

A couple of days ago, the motor controller was recognised and I could switch AP on and observe the voltage etc. in the statistics. Without me knowingly changing anything, it stopped working and the 'no motor controller error' occurred. 

After spending two days in fixing this error, I would like to get some suggestions and hints on this.
   

Apparently, I have in parallel 'IMU not detected' error. Could it be that the missing compass heading lead to 'no motor controller error'?

   

Following the suggestion from another post in this forum, I did:
Code:
pi@openplotter:~ $ ls -l /dev/serial0
lrwxrwxrwx 1 root root 7 Nov 27 01:21 /dev/serial0 -> ttyAMA0

I also made sure:
   

However, I am not sure if ttyAMA0 is supposed to be exclusively used by PyPilot. If so, I have a problem here because Maiana AIS is also on ttyAMA0.
   

Any ideas on how to debug this are highly appreciated! (I have been reading the previous posts on this topic back and forth many times, without any success...) Many thanks!
Reply
#2
How are you connecting the motor controller to the raspberry?

Normally pypilot uses /dev/ttyAMA0 exclusively but it can use a different port.
Reply
#3
(2023-11-27, 02:46 AM)seandepagnier Wrote: How are you connecting the motor controller to the raspberry?

Normally pypilot uses /dev/ttyAMA0 exclusively but it can use a different port.

I wish I could tell you concisely how the motor controller is connected to the raspberry zero. Due to my lack of electronic knowledge, we bought the assembled pypilot hardware in Germany. 

I am still trying to understand how it is connected by looking at the main board plan, which is not trivial to my brain.  Huh Maybe you are faster on this? Attached is the main board plan. Many thanks!

(2023-11-27, 03:52 AM)volksbar Wrote:
(2023-11-27, 02:46 AM)seandepagnier Wrote: How are you connecting the motor controller to the raspberry?

Normally pypilot uses /dev/ttyAMA0 exclusively but it can use a different port.

I wish I could tell you concisely how the motor controller is connected to the raspberry zero. Due to my lack of electronic knowledge, we bought the assembled pypilot hardware in Germany. 

I am still trying to understand how it is connected by looking at the main board plan, which is not trivial to my brain.  Huh Maybe you are faster on this? Attached is the main board plan. Many thanks!

In case this helps to understand better the plan, here is what the entire hardware looks like:
   


Attached Files
.pdf   pypilotmain.pdf (Size: 187.08 KB / Downloads: 64)
Reply
#4
So I understand the maiana ais is on a separate raspberry pi?

If this is the case, it may use /dev/ttyAMA0 on that pi, and the pi zero will use /dev/ttyAMA0 to communicate with the arduino nano.

'no motor controller' indicates communication problem with the nano. It is hard to say why. It could be damaged somehow, or some of the solder connections are bad. If you can remove and replace the arduino or pi, that might help.

I do not build this board so I can only suggest contacting whoever made it.
Reply
#5
The electric schema shows that pi and arduino are directly connected - with a voltage divider from the arduino to the pi. There is nothing much here that can break overnight.

As always, it is best to show the full output of main pypilot process. To do this, you would have to shutdown pypilot and then run it at the prompt. There are some hints in the workbook: https://github.com/pypilot/workbook/wiki...the-prompt. To connect to a tinypilot, use an ssh client like putty.exe to port 22, username tc password pypilot.
Reply
#6
(2023-11-28, 06:04 PM)ironman Wrote: The electric schema shows that pi and arduino are directly connected - with a voltage divider from the arduino to the pi. There is nothing much here that can break overnight.

As always, it is best to show the full output of main pypilot process. To do this, you would have to shutdown pypilot and then run it at the prompt. There are some hints in the workbook: https://github.com/pypilot/workbook/wiki...the-prompt. To connect to a tinypilot, use an ssh client like putty.exe to port 22, username tc password pypilot.

Thanks @Sean and @ironman for your thoughts and suggestions.

Sorry for my delayed reply. I was waiting for the new IMU sensor to see if it can be detected now and can contribute indirectly to solving the motor controller error. But sadly no... IMU is still not detected and motor controller error persists. And I have not heard back from the person who sold me the board.

Back to @ironman's  suggestion to run pypilot at the prompt to get more log info:

Code:
pi@openplotter:~ $ sudo service pypilot stop
pi@openplotter:~ $ pypilot
autopilot start 1198.720886858
world magnetic model not available
ERROR loading wind.py cannot import name 'HeadingOffset' from partially initialized module 'pypilot.autopilot' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/pypilot/autopilot.py)   cannot import name 'HeadingOffset' from partially initialized module 'pypilot.autopilot' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/pypilot/autopilot.py)
imu process 2987
nmea process 2991
listening on port 20220 for nmea connections
gps process 2994
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Failed to open SPI bus 0, select 1
Using fusion algorithm Kalman STATE4
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
Available Pilots: ['absolute', 'basic']
warning: failed to open special file /dev/watchdog0 for writing
         cannot stroke the watchdog
pypilotServer process 2998
pypilotinit complete 1199.137328855
load file /home/pi/.pypilot/pypilot.conf
store_file /home/pi/.pypilot/pypilot.conf.bak 1199.167
server setup has 6 pipes
imu rate set to rate 20
zeroconf addresses ['10.10.10.1', '127.0.0.1', '192.168.88.154'] 3
signalk zeroconf service add openplotter (2)._http._tcp.local. _http._tcp.local.
Exception in thread zeroconf-Engine:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 1228, in run
    reader.handle_read(socket_)
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 1301, in handle_read
    self.zc.handle_response(msg)
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 2501, in handle_response
imu rate set to rate 20
    with self._handlers_lock:
AttributeError: 'Zeroconf' object has no attribute '_handlers_lock'
setting initial gyro bias [0.0, 0.0, 0.0]
gps filter process 2997
Failed to open SPI bus 0, select 1
signalk zeroconf service add Victron._http._tcp.local. _http._tcp.local.
gpsd connected
GPSD devices []
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
calibration loaded, starting 2985
servo probe ('/dev/ttyAMA0', 38400) 1204.267752892
server/client is running too _slowly_ 0.09196797799995693
signalk process 2993
Failed to open SPI bus 0, select 1
signalkread token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2UiOiI1NTNjZGYyYi1hMTAzLTQ0OGQtYmQ2NS0wMjNiNTFmNDlkYmYiLCJpYXQiOjE3MDA4ODMwMTQsImV4cCI6MTczMjQ0MDYxNH0.tIlw3CsO2jtevBPunrZ5ZvHP4CBW0e9U1x40tXhW4n0
signalk server found 192.168.88.154:3000
signalk found ws://192.168.88.154:3000/signalk/v1/stream?subscribe=none
signalk connected to ws://192.168.88.154:3000/signalk/v1/stream?subscribe=none
Failed to open SPI bus 0, select 1
sensor found gps signalk maiana.GPsignalk Wed Dec  6 23:08:21 2023
Failed to open SPI bus 0, select 1
nmea probe ('pypilot', 38400)
failed to open ('pypilot', 38400) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
nmea probe ('pypilot', 4800)
failed to open ('pypilot', 4800) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('pypilot', 38400) 1213.429507218
failed to open servo on: ('pypilot', 38400) [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
sensor lost gps signalk maiana.GPsignalk Wed Dec  6 23:08:29 2023
Failed to open SPI bus 0, select 1
sensor found gps signalk maiana.GNsignalk Wed Dec  6 23:08:30 2023
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('/dev/ttyAMA0', 38400) 1223.703527951
nmea probe ('pypilot', 38400)
failed to open ('pypilot', 38400) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
nmea probe ('pypilot', 4800)
failed to open ('pypilot', 4800) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('pypilot', 38400) 1232.883809123
failed to open servo on: ('pypilot', 38400) [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('/dev/ttyAMA0', 38400) 1243.162751084
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
nmea probe ('pypilot', 38400)
failed to open ('pypilot', 38400) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
nmea probe ('pypilot', 4800)
failed to open ('pypilot', 4800) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('pypilot', 38400) 1252.341124935
failed to open servo on: ('pypilot', 38400) [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('/dev/ttyAMA0', 38400) 1262.611576002
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
nmea probe ('pypilot', 38400)
failed to open ('pypilot', 38400) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
nmea probe ('pypilot', 4800)
failed to open ('pypilot', 4800) for nmea data [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
servo probe ('pypilot', 38400) 1271.791032107
failed to open servo on: ('pypilot', 38400) [Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
Failed to open SPI bus 0, select 1
^CTraceback (most recent call last):
  File "/usr/local/bin/pypilot", line 33, in <module>
    sys.exit(load_entry_point('pypilot==0.42', 'console_scripts', 'pypilot')())
  File "/usr/local/lib/python3.9/dist-packages/pypilot/autopilot.py", line 520, in main
    ap.iteration()
  File "/usr/local/lib/python3.9/dist-packages/pypilot/autopilot.py", line 376, in iteration
    time.sleep(pd10)
  File "/usr/local/lib/python3.9/dist-packages/pypilot/autopilot.py", line 194, in cleanup
KeyboardInterrupt
closing autopilot

The error message seems to occur again and again: 
Code:
[Errno 2] could not open port pypilot: [Errno 2] No such file or directory: 'pypilot'

Any further hints to debug this? Many thanks!
Reply
#7
hi volksbar

In your log it seems it cant get SPI mode, so check this first in /boot/config.txt.
dtparam=spi=on

about the IMU sensor:
are your i2c pins otherwhy defined in /boot/config.txt?
this is the normal config:

dtparam=i2c_arm=on
#dtparam=i2s=on


->Last Option: it is possible optional to define other pins for the i2c protocoll.
the command is "dtoverlay ?????".
but check this out only if your pi has really broken pins!

mybe bettter try another pi first or sd-card first.

holger
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)