robotanv
Posts: 11
Joined: Sat Nov 21, 2020 12:12 am

pi inception or just not cool?

Sat Nov 28, 2020 3:36 am

It's late and apologies if this is not as funny as I thought it would be.
pi inception.jpg
pi inception.jpg (127.04 KiB) Viewed 455 times

DarkElvenAngel
Posts: 1262
Joined: Tue Mar 20, 2018 9:53 pm

Re: pi inception or just not cool?

Sat Nov 28, 2020 5:47 am

It's late but I think you need a few more keyboards plugged in there!

I got a chuckle from it then the thought of adding more keyboards popped to mind. Add a spinning top and the illusion is complete.

robotanv
Posts: 11
Joined: Sat Nov 21, 2020 12:12 am

Re: pi inception or just not cool?

Sat Nov 28, 2020 12:20 pm

Haha.

I thought about adding more but then couldn't quite justify spending the extra cash just for the lols!
Having said that, there's a possibility I'll get through a lot of keyboards in the near future so this rabbit hole may go deeper! :D

cleverca22
Posts: 2483
Joined: Sat Aug 18, 2012 2:33 pm

Re: pi inception or just not cool?

Sat Nov 28, 2020 3:15 pm

if you want some real piception, you need to get a usb keyboard gadget, so the pi400 can act like a usb keyboard!
then you can use the pi400 as a keyboard on a pi400!!

something involving usb_f_hid i believe

robotanv
Posts: 11
Joined: Sat Nov 21, 2020 12:12 am

Re: pi inception or just not cool?

Sat Nov 28, 2020 4:04 pm

cleverca22 wrote:
Sat Nov 28, 2020 3:15 pm
if you want some real piception, you need to get a usb keyboard gadget, so the pi400 can act like a usb keyboard!
then you can use the pi400 as a keyboard on a pi400!!

something involving usb_f_hid i believe
mind blown! :o

That's beyond me. I just mash things together and hope for the best! :D

cleverca22
Posts: 2483
Joined: Sat Aug 18, 2012 2:33 pm

Re: pi inception or just not cool?

Sat Nov 28, 2020 7:15 pm

i punched that module into google to figure out how it works, and wound up right back on the pi forums! lol
viewtopic.php?t=163774

and after following those steps and adding them to my composite usb gadget, i can "echo 'U' > /dev/hidg0" which makes things freak out pretty crazily, lol

hitting enter then toggles the terminal between fullscreen and not (the virtual keyboard is holding a weird key), but it recovers after unplugging

edit1:
https://github.com/raspberrypi/linux/bl ... esting.rst
https://github.com/raspberrypi/linux/bl ... et_hid.rst
further docs

edit2:

Code: Select all

echo -ne \\x00\\x00\\x05\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00 > /dev/hidg0
and this sends a pair of 8 byte reports, the first claiming a key was held, the second saying its now released
not sure on the mapping yet, the 0x05 turns into a lowerbase b

edit3:
0x4 to 0x1d map to a-z
0x1e to 0x27 map to 1-90
gadget_hid.rst has a table for special keys, like 0x28 being enter
i believe bytes 0/1 are special flags in the report, and bytes 2/3/4/5/6/7 report up to 6 keys being held at that moment, with null representing no key being held

that just leaves writing a program that can capture input from the pi400 keyboard, then packaging it up into the above, and forwarding it on

edit4:
https://www.usb.org/sites/default/files/hut1_21_0.pdf page 83 has the full table, and it matches what i figured out via brute-force

cleverca22
Posts: 2483
Joined: Sat Aug 18, 2012 2:33 pm

Re: pi inception or just not cool?

Sun Nov 29, 2020 12:47 pm

https://hydra.angeldsis.com/build/10480 ... 1/root.zip
https://github.com/librerpi/rpi-tools/b ... oxy/main.c

and this is what happens when people dont stop me, lol

unpack root.zip to a fat32 formatted uSD card, pop it into a pi400, and then plug the usb-c port into any computer with a normal C->A cable

after ~5 seconds, it will function like a normal usb keyboard!

User avatar
HermannSW
Posts: 3467
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: pi inception or just not cool?

Sun Nov 29, 2020 2:14 pm

robotanv wrote:
Sat Nov 28, 2020 3:36 am
It's late and apologies if this is not as funny as I thought it would be.
Pi400.two_keyboards.jpg
Pi400.two_keyboards.jpg
Pi400.two_keyboards.jpg (14.67 KiB) Viewed 224 times
I knew that reminded my of something, and now I found it, the movie "Lucy".
She uses two laptops at super human speed in parallel:
https://www.imdb.com/title/tt2872732
Lucy_two_laptops.jpg
Lucy_two_laptops.jpg
Lucy_two_laptops.jpg (61.38 KiB) Viewed 224 times
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/working_with_FPGAs

Return to “Raspberry Pi 400”