Ok thanks, I thought there was maybe some difficulty getting it to work. Looks like a lot of work.

Oops… Had a bad path to the keycodes library in the keyboard test script. Fixed now.

Please git pull the revised version.

1 Like

hi there trying your HID demo my Rpi norns cant see usb QWERTY keyboard or usb mouse not detected in devices HID. any suggestions. :thinking:

Not sure what might be happening there. Really need more specific information about what you are doing.

You could test with the hid-events.lua script and watch for output in the Maiden REPL when you launch that script. It will print out info on attached devices.

Do you have a screen on your RasPi norns? Do the keyboard/mouse show up in SYSTEM>DEVICES>HID ?

yes do have a screen no they do not show up in devices HID and here is what i get out or maiden :-
lua:

/home/we/norns/lua/core/vport.lua:13: table index is nil

stack traceback:

/home/we/norns/lua/core/vport.lua:13: in function ‘vport.get_unique_device_name’

/home/we/norns/lua/core/hid.lua:39: in function ‘core/hid.new’

/home/we/norns/lua/core/hid.lua:116: in function </home/we/norns/lua/core/hid.lua:115>

Not a clue.

Sounds like more of a system problem if the devices aren’t showing up. Might wanna bring it up in the RasPi thread. Prob need some debug like looking at dmesg after you plug/unplug the HID devices

@okyeron Is it possible to connect a Bluetooth nub to Norns and capture/connect keyboard or other devices (like possibly a wiimote)? I have a bluetooth 4.0 (USB nub) connected to the latest norns update and nothing shows up under the HID directory in the system menu, so I’m guessing that it is not supported as of yet.

1 Like

At the moment, no.

I tried getting a wiimote setup with my raspi-norns a couple weeks ago and it won’t work with the current norns software.

(As best I can tell) The general problem is that norns is looking for HID devices only on the USB subsystem. Thus while the wiimote will show up as a HID “event” norns won’t see it because it’s on the Bluetooth subsystem (not USB).

Possible problem #2 (on norns hardware) is that the UART serial connection and bluetooth may conflict. Thus you’d need to change boot/config.txt

I’ve filed a github issue for this here if you want to chime in.

2 Likes

hi there replaced name with port on line 13 of vport.lua and it works?

cheers :grinning:

Curious.

It would be helpful if you brought this up on the main norns 2.0.1 help thread so that the main devs could chime in. vport.lua is core code and I’m not entirely sure what’s happening there in relation to your problem.

EDIT - my thought here is to better understand WHY that change worked for you and if it’s a general bug that needs fixing

Very excited to find that my Wacom tablet sends hid commands to my Norns successfully. Now I have to see if i can decode the messages meaningfully. And then do something useful with it. Thanks for the demo code!

4 Likes

Suffer like G did…

2 Likes

installed this thru maiden to play with and i’m getting failed load.
here is the error log

MISSING INCLUDE: hid-demo/lib/keycodes

SCRIPT ERROR: load fail

/home/we/dust/code/hid_demo/hid-keyboard-test.lua:15: MISSING INCLUDE: hid-demo/lib/keycodes

stack traceback:

/home/we/norns/lua/core/norns.lua:215: in function </home/we/norns/lua/core/norns.lua:215>

[C]: in function ‘error’

/home/we/norns/lua/core/startup.lua:46: in function ‘include’

/home/we/dust/code/hid_demo/hid-keyboard-test.lua:15: in main chunk

[C]: in function ‘dofile’

/home/we/norns/lua/core/script.lua:149: in function </home/we/norns/lua/core/script.lua:149>

[C]: in function ‘xpcall’

/home/we/norns/lua/core/norns.lua:216: in field ‘try’

/home/we/norns/lua/core/script.lua:149: in function ‘core/script.load’

/home/we/norns/lua/core/menu.lua:439: in field ‘key’

/home/we/norns/lua/core/menu.lua:177: in function </home/we/norns/lua/core/menu.lua:154>

Sorry about that. Looks like I had not updated this in awhile and the path behaviour changed in a recent norns release.

I just pushed fixes, so you can check the maiden “installed” tab and run “update” and things should work properly now.

5 Likes

hi! trying to get the HID events demo to run - ive got a footswitch that prints when i plug it in, but I dont get any response when I press it. I should be getting another event, right?



# script load: /home/we/dust/code/hid_demo/hid-events.lua
# cleanup
# script clear
pset >> write: /home/we/dust/data/system.pset
# script run
Engine.register_commands; count: 0
___ engine commands ___
___ polls ___
amp_in_l
amp_in_r
amp_out_l
amp_out_r
cpu_avg
cpu_peak
pitch_in_l
pitch_in_r
# script init
 
Devices:
6: USB2.0 Hub 2
5: USB2.0 Hub
 
vports:
1: Magic Keyboard
2: USB2.0 Hub
3: USB2.0 Hub 2
4: none
 
>> reading PMAP /home/we/dust/data/hid_demo/hid-events/hid-events.pmap
hid added:	7	USB2.0 Hub
hid added:	8	USB2.0 Hub 2

You may need to edit the script to tell it to look at device 2 or 3 (hid.connect(2), etc. )

I’ll maybe add a device selection parameter (later today) to the script to make this easier.

1 Like

Great! it worked. thank you for the noob assist

1 Like

Added device selector to parameters screen in hid-keyboard-test.lua and hid-events.lua

Looking forward to that. I have some ideas re. speech/singing synthesis I want to try implementing, myself.

1 Like