2023-12-15, 08:49 PM
(This post was last modified: 2023-12-15, 08:54 PM by drbarritt.)
I have tried everything I can think of (including reloading pypilot from github and from OpenCPN) but cannot get pypilot_hat to run either directly or as a service. I tried with no hat.conf and tried with a hat.conf file I copied from the forum:
{"host":"localhost","actions":{"auto":[],"menu":[],"port1":[],"starboard1":[],"select":[],"port10":[],"starboard10":[],"tack":[],"dodge_port":[],"dodge_starboard":[],"engage":[],"disengage":[],"1":[],"-1":[],"2":[],"-2":[],"5":[],"-5":[],"10":[],"-10":[],"compassmode":[],"gpsmode":[],"windmode":[],"truewindmode":[],"center":[],"tackport":[],"tackstarboard":[],"none":[],"pilot_absolute":[],"pilot_basic":[]},"pi.ir":true,"arduino.ir":false,"arduino.nmea.in":false,"arduino.nmea.out":false,"arduino.nmea.baud":4800,"lcd":{},"hat":{"lcd":{"driver":"default","port":"\/dev\/spidev0.0"},"lirc":"gpio4"}}
But I just get:
pi@openplotter:~/.pypilot $ sudo pypilot_hat
hat start 9252.581509633
have gpio for raspberry pi
hat import done 9252.631372467
loading config file: /root/.pypilot/hat.conf
config failed: [Errno 2] No such file or directory: '/root/.pypilot/hat.conf'
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
assuming original 26 pin tinypilot with nokia5110 display
Traceback (most recent call last):
File "/usr/local/bin/pypilot_hat", line 33, in <module>
sys.exit(load_entry_point('pypilot==0.42', 'console_scripts', 'pypilot_hat')())
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 687, in main
hat = Hat()
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 348, in __init__
self.write_config()
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 502, in write_config
if self.client and not 'modes' in self.config:
AttributeError: 'Hat' object has no attribute 'client'
Any help would be much appreciated!
I also ran pypilot_hat without the sudo and got:
pi@openplotter:~/.pypilot $ pypilot_hat
hat start 9607.944609552
have gpio for raspberry pi
hat import done 9607.997461213
loading config file: /home/pi/.pypilot/hat.conf
config failed: Expected object or value
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
assuming original 26 pin tinypilot with nokia5110 display
Traceback (most recent call last):
File "/usr/local/bin/pypilot_hat", line 33, in <module>
sys.exit(load_entry_point('pypilot==0.42', 'console_scripts', 'pypilot_hat')())
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 687, in main
hat = Hat()
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 348, in __init__
self.write_config()
File "/usr/local/lib/python3.9/dist-packages/pypilot/hat/hat.py", line 502, in write_config
if self.client and not 'modes' in self.config:
AttributeError: 'Hat' object has no attribute 'client'