Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On raspi 4 #2

Open
rperezibacache opened this issue Jul 12, 2021 · 5 comments
Open

On raspi 4 #2

rperezibacache opened this issue Jul 12, 2021 · 5 comments

Comments

@rperezibacache
Copy link

Good day Danny,
I'm trying to replicate your code for the raspi 4. However, when the line "kbd=Keyboard()" is executed, an error is returned.

File "", line 1, in
File "/home/pi/.../Py_Keyboard/Py_Keyboard/HID.py", line 452, in init
self.release_all()
File "/home/pi/.../Py_Keyboard/Py_Keyboard/HID.py", line 551, in release_all
send_report(self.report)
File "/home/pi/.../Py_Keyboard/Py_Keyboard/HID.py", line 599, in send_report
fd.write(report)
BlockingIOError: [Errno 11] write could not complete without blocking

Do you think that there is a chance to replicate for raspi 4?

Thanks Ricardo

@hannescam
Copy link

the problem is that the machine where you pluged it in isnt properley initializing the pi and then the pi cant send any keystrokes
try a diferent machine / os or try rebooting the pi after the machine has started

@kelsorj
Copy link

kelsorj commented Oct 8, 2022

When I plug into a USB port on my PC and Mac everything works perfectly, fantastic project, thank you.
But I'm trying to control a laser text projector (https://lighting-geek.com/product/300mw-rgb-text-laser-projector-with-keyboard/) that's normally controlled by a keyboard that you plug in. When I plug in the pi4 there isn't enough power to boot and it constantly restarts. So I got a dual power cable ( https://www.amazon.com/dp/B0711R8828?psc=1&ref=ppx_yo2ov_dt_b_product_details) and that lets the pi boot perfectly but when I send exactly the same keyboard commands I get the following error:

`eror
Traceback (most recent call last):
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 448, in init
self.release_all()
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 551, in release_all
send_report(self.report)
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 598, in send_report
with open('/dev/hidg0', 'rb+') as fd:
PermissionError: [Errno 13] Permission denied: '/dev/hidg0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Py_Keyboard/example.py", line 3, in
kbd = Keyboard()
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 452, in init
self.release_all()
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 551, in release_all
send_report(self.report)
File "/home/pi/Py_Keyboard/Py_Keyboard/HID.py", line 598, in send_report
with open('/dev/hidg0', 'rb+') as fd:
PermissionError: [Errno 13] Permission denied: '/dev/hidg0'
`
Could this be because the USB power cable isn't able to let the pi distinguish between the power cable and the projector? When it's plugged into the projector with the adaptor I don't see the /dev/hidg0 but when it's plugged into the computer that is listed.
Any ideas how I might be able to get it working would be greatly appreciated.

@hannescam
Copy link

i think it is because the cable is not data capable

@kelsorj
Copy link

kelsorj commented Oct 13, 2022

I think you're correct ... I'm just going to need to figure out how to get more power out of the laser harware so it'll work with the data cable that's working

@hannescam
Copy link

if you have an soldering iron and a power only or power and data cable that you can cut and another usb-c to usb a cable (that one that yure using for the projector and the raspi) then you could wire such an cable up if you have all of these things (plus about an hour as beginner or 10 to 15 minutes as a bit better beginner)
then please say it and i will make a small tutorial for you how to make such an adaptor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants