joystick.service error
LittleBookboy12138 opened this issue · comments
Both joystick.service and robot.service are active, but an error occurred while connecting the PS4 to the Pupper.
The specific questions are as follows:
pi@raspberrypi(rw):~$ sudo systemctl status joystick.service
● joystick.service - Pupper Joystick service
Loaded: loaded (/boot/appliance/home/pi/PupperCommand/joystick.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2019-02-14 10:17:57 GMT; 78ms ago
Process: 1173 ExecStart=/usr/bin/python3 /home/pi/PupperCommand/joystick.py (code=exited, status=1/FAILURE)
Main PID: 1173 (code=exited, status=1/FAILURE)
Thank you!
https://github.com/stanfordroboticsclub/UDPComms
DEFAULT_IP = "10.0.0.255"
ip By default UDPComms sends to the 10.0.0.X subnet, but can be changed to a different ip using this argument.
Set to localhost (127.0.0.1) for development on the same computer.
try running python3 /home/pi/PupperCommand/joystick.py
to run the joystick program without systemd. What does it output?
try running
python3 /home/pi/PupperCommand/joystick.py
to run the joystick program without systemd. What does it output?
pi@pi(rw):~/PupperCommand$ sudo python3 joystick.py
Can't get device info: No such device
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/ds4drv/backends/bluetooth.py", line 89, in setup
subprocess.check_output(["hcitool", "clock"],
File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['hcitool', 'clock']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/PupperCommand/joystick.py", line 14, in
joystick = Joystick()
File "/usr/local/lib/python3.9/dist-packages/PS4Joystick.py", line 85, in init
backend.setup()
File "/usr/local/lib/python3.9/dist-packages/ds4drv/backends/bluetooth.py", line 92, in setup
raise BackendError("'hcitool clock' returned error. Make sure "
ds4drv.exceptions.BackendError: 'hcitool clock' returned error. Make sure your bluetooth device is powered up with 'hciconfig hciX up'.
have you tired running hciconfig hciX up
before running that command? Its a bit weird because I think joystick.py should run that on its own but I want to make sure
sudo hciconfig hciX up
Can't get device info: No such device
To start with,I didnt use offical img ,instead i used version _2021 bulleyes( 2021-10-30-raspios-bullseye),and followed the offical document to install the software
It seems like the pi's bluetooth module is not showing up at all. What version of Pi are you using? What's the output of hcitool dev
?
raspberry 4b ,pi@pi(rw):~/PupperCommand$ hcitool dev
Devices:
device is blank
It's possible something changed between raspios versions. A quick googling brings this up which suggests early bullseye versions had something wrong with bluetooth. I would recommend updating raspios (it should be possible to do in place without reinstalling) and seeing if that fixes things
pi@pi(rw):$ sudo nano /etc/apt/sources.list.d/raspi.list$ sudo apt-get update
pi@pi(rw):
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian bullseye InRelease
Hit:2 http://mirrors.tuna.tsinghua.edu.cn/raspberrypi bullseye InRelease
Reading package lists... Done
pi@pi(rw):$ sudo apt-get upgrade$ sudo hcitool dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@pi(rw):
Devices:
still blank
i think maybe i need to reinstall it to the newest version
It's possible something changed between raspios versions. A quick googling brings this up which suggests early bullseye versions had something wrong with bluetooth. I would recommend updating raspios (it should be possible to do in place without reinstalling) and seeing if that fixes things
thanks for your advice
pi@pi(rw):
$ sudo nano /etc/apt/sources.list.d/raspi.list pi@pi(rw):$ sudo apt-get update Hit:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian bullseye InRelease Hit:2 http://mirrors.tuna.tsinghua.edu.cn/raspberrypi bullseye InRelease Reading package lists... Done pi@pi(rw):$ sudo apt-get upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. pi@pi(rw):$ sudo hcitool dev Devices: still blank i think maybe i need to reinstall it to the newest version
Did you solve it ? Totally same problem, though I am in the Debian 10.