stanfordroboticsclub / StanfordQuadruped

MIT License
1.46k stars 561 forks source link

joystick.service error #20

Open LittleBookboy12138 opened 3 years ago

LittleBookboy12138 commented 3 years ago

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!

juedongli commented 3 years ago

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.

marx-bryan commented 2 years ago

S $~8Y4L5TJJYB`Y$ X~F4R i have the same question ,still unsolved

mikh3x4 commented 2 years ago

try running python3 /home/pi/PupperCommand/joystick.py to run the joystick program without systemd. What does it output?

marx-bryan commented 2 years ago

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'.

mikh3x4 commented 2 years ago

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

marx-bryan commented 2 years ago

sudo hciconfig hciX up Can't get device info: No such device

marx-bryan commented 2 years ago

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

mikh3x4 commented 2 years ago

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?

marx-bryan commented 2 years ago

raspberry 4b ,pi@pi(rw):~/PupperCommand$ hcitool dev Devices: device is blank

mikh3x4 commented 2 years ago

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

marx-bryan commented 2 years ago

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

marx-bryan commented 2 years ago

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

AlfredMoore commented 1 year ago

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.