Release [WIP] Master Control - Testers needed


Crionic

Member
Joined
Mar 13, 2013
Messages
179
Location
Germany
Hello everyone!

I am currently working on a tool that lets you use the Pandora as a HID(evice). I call it "Master Control" :D

This tool is under development and there is still a lot of work to do. There are certainly bugs, I haven't found yet, and some features are not implemented yet. Since I do only have my Linux/Windows PC for testing, I need some people to give me some feedback. I've just uploaded a very first version to the repo. It can be downloaded here: http://repo.openpandora.org/?page=detail&app=package.mastercontrol

These are the currently implemented features:

  • Connects via USB (otg) and Bluetooth
  • HID
    Standard 101 keyboard (supports boot protocol)
  • Standard 3-button mouse
  • Gamepad with 2 joysticks, a digipad and up to 16 buttons
[*]14 virtual keys for free use
[*]Flexible key map.


The tool is known to work with:

  • Other Pandoras :)
  • Windows (7)
  • Linux (openSuse 11.4/12.3)
  • Android (4.1.1/4.1.2)


The tool comes with 2 config files:

mastercontrol_keydefs.conf

This file includes key definitions which are needed to identify key presses, mouse moves, etc..  It should not be modified (unless you know what you are doing :unsure:   )

mastercontrol.conf

This file includes some application parameters and, most importantly, the key map. Here you can define which input key (or move) maps to which output (HID) key (or move). So, for example, it's possible to map the key 'y' to 'z' and visa versa. It's also possible to map one input key to multiple output keys. For example, the (Pandora) gamepad "A" to (HID) keyboard "page up" and (HID)  gamepad "A".

Some major keys are already predefined, but most work must be done by the user.

Sidenote:

If you encounter any problems or crashes, please take a look at the log-file (in the appdata dir) and let me know. You may even try gdb (tool is build with debug symbols)

That's all for now. Feedback, critics and discussions are highly welcome  :)

How to use Bluetooth:

- Start MC. This registers the HID service on the SDP-Server (the host has to know, which services are available on the Pandora)

- Initiate pairing with the Pandora from the host side! This will ensure, that the host finds the HID service and connects afterwards.

- Enter your pin

- The host should now detect the services and connect to MC

- For a reconnect, press the "Connect" button in the full screen interface. This will try to connect to the host, to which MC was last connected

To debug Bluetooth problems, please download the attached file. It contains the tool "hcidump", which monitors all BT events. It's part of the Bluez software collection, but not included in the Pandoras firmware.

hcidump.zip
 

Attachments

  • hcidump.zip
    161.2 KB · Views: 725
Last edited by a moderator:
No reaction.

=======================================================================================
PND : /media/MAIN/pandora/menu/mastercontrol.pnd
PND_FSTYPE : Squashfs
APPDATADIR : /media/MAIN/pandora/appdata/mastercontrol
APPDD_FSTYPE : vfat
PND_CPUSPEED : <unset>
EXENAME : pandora/run_mastercontrol.sh
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/mastercontrol"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/MAIN/pandora/appdata/mastercontrol=rw+nolwh":"/mnt/pnd/mastercontrol=rr" none "/mnt/utmp/mastercontrol"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( pandora/run_mastercontrol.sh ) ----------
++ id -u
+ '[' 1000 '!=' 0 ']'
+ gksudo -m 'Master Control needs root privileges to run. Please enter your password' id

(gksudo:5088): Gtk-WARNING **: Unable to locate theme engine in module_path: "crux-engine",

** (gksudo:5088): WARNING **: Invalid borders specified for theme pixmap:
/usr/share/themes/Slick Red/gtk-2.0/entry/entry-inactive.png,
borders don't fit within the image
uid=0(root) gid=0(root)
+ exec sudo -n ./pandora/run_mastercontrol.sh
++ id -u
+ '[' 0 '!=' 0 ']'
+ modprobe gadgetfs
+ mkdir -p /dev/gadgetfs
+ mountpoint -q /dev/gadgetfs
+ mount -t gadgetfs gadgetfs /dev/gadgetfs
mount: unknown filesystem type 'gadgetfs'
[ FAILED]--- Starting the application ( pandora/run_mastercontrol.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/mastercontrol': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 2


For USB mode, do I have to use the big USB port or the OTg port?

EDIT:

I've found it in the first post :) .

It's the OTG port.
 
Last edited by a moderator:
 mountpoint -q /dev/gadgetfs
That should be "mountpoint -q /dev/gadgetfs || mount -t gadgetfs gadgetfs /dev/gadgetfs". Strange...  You will have to do that by hand.

For USB you need the OTG port (Mini A plug).

Edit:

Do you have USB network running?

Please check, if you have any "g_" modules loaded (g_hid, g_ether, ...) Those are incompatibe to gadgetfs.
 
Last edited by a moderator:
That should be "mountpoint -q /dev/gadgetfs || mount -t gadgetfs gadgetfs /dev/gadgetfs". Strange...  You will have to do that by hand.
Ignore this :)

Do you have USB network running?

Please check, if you have any "g_" modules loaded (g_hid, g_ether, ...) Those are incompatibe to gadgetfs.
But please check this ( lsmod | grep g_ )
 
great! usb input works here (keyboard, mouse paired with linux machine), how do I use bluetooth? (do I have to enable bluetooth from the applet?)

small bug report: the "about" button doesn't do anything ;)

also: is it possible to make it so it doesn't ask for root password after first time? (is not very important, but would be nice)
 
Last edited by a moderator:
Sounds awesome.

IMHO this should definitely become part of the firmware when accepted standards of stability / usability are reached. Provided of course it can be kept fairly light weight.

What I'd eventually love to see is a very small core app (installed to Nand as part of default frimware) which supports plugins for various control scenarios that can be installed to the SD card.

It would be another killer feature for Pandora if you could use it as an iCP2 with phones / tablets etc.

I'd love to help with testing, do you have any specific requirements here?

_____________________

If someone who tests this has 2 Pandoras then please see if it is possible to control Pandora number 1 with Pandora number 2, for some reason this seems like a cool thing to me if it does prove to be possible.  :)
 
great! usb input works here (keyboard, mouse paired with linux machine), how do I use bluetooth? (do I have to enable bluetooth from the applet?)

small bug report: the "about" button doesn't do anything ;)

also: is it possible to make it so it doesn't ask for root password after first time? (is not very important, but would be nice)
The buttons on the right side are currently without function :) (it is intended to enable/disable specific devices). Root privileges are required for Bluetooth sockets. I think there is no way around it.

There is something I didn't consider. You can't pair the Pandora, while MC is running ( you can't enter the pin because of the input grabbing), but the partner cannot find the HID services while MC is not running. I will  upload a workaround for this issue.

Sounds awesome.

IMHO this should definitely become part of the firmware when accepted standards of stability / usability are reached. Provided of course it can be kept fairly light weight.

What I'd eventually love to see is a very small core app (installed to Nand as part of default frimware) which supports plugins for various control scenarios that can be installed to the SD card.

It would be another killer feature for Pandora if you could use it as an iCP2 with phones / tablets etc.

I'd love to help with testing, do you have any specific requirements here?

_____________________

If someone who tests this has 2 Pandoras then please see if it is possible to control Pandora number 1 with Pandora number 2, for some reason this seems like a cool thing to me if it does prove to be possible.  :)
I like this plugin idea. But let's get it stable and usable first. :)

I don't know anything about the iCP2. I guess it's not a HID, or is it?

At the Moment I need just general testing.  Maybe play around with the key maps to check if mapping works as intended.

Great !

That was unexpected.
Things always seem to happen when you least expect them :)
 
hmm, still no bluetooth here; I except some input devices to show up when scanning for a bluetooth device on the PC (should they?) after starting up master control (either after enabling bluetooth or not), only thing that shows up is the pandora as a 'computer,'

I am not using bluetooth often - so maybe I am doing something wrong... :unsure:
 
Just tried this, but doesn't work with bluetooth (and Windows) for me.

The HID device is seen and the connection can start, but once it is established everything I do in MasterControl is not seen by the PC.

Tried different times, even restarting the program more then once during the connection.
 
Can I use Right nub for mouse and Shoulder buttons for Shift/Ctrl?

I want the Pandora feeling :) .

I know it's  Alpha release so will this be possible in one of the next releases?
 
Tried on USB and works, but right nub mouse clicks commands doesn't work well... I did a left click after 5 presses, and a middle click after 20 trials, wasn't able to do a right click.
 
Can I use Right nub for mouse and Shoulder buttons for Shift/Ctrl?

I want the Pandora feeling :) .

I know it's  Alpha release so will this be possible in one of the next releases?
That's already possible :)

Add this to mastercontrol.conf:

("OUT.Keyboard.RightShift", "IN.Gamepad.Buttons.LeftShoulder"),


("OUT.Keyboard.RightCtrl", "IN.Gamepad.Buttons.RightShoulder"),


("OUT.Mouse.Left", "IN.RightNub.MouseMove.Left"),


("OUT.Mouse.Right", "IN.RightNub.MouseMove.Right"),


("OUT.Mouse.Up", "IN.RightNub.MouseMove.Up"),


("OUT.Mouse.Down", "IN.RightNub.MouseMove.Down"),

Be aware, that there are already mappings for the mouse. You have to delete them or comment them out.

And make sure, the right nub is configured to mouse movement (with nub configurator)
 
Last edited by a moderator:
Tried on USB and works, but right nub mouse clicks commands doesn't work well... I did a left click after 5 presses, and a middle click after 20 trials, wasn't able to do a right click.
The key map only contains some major keys (A-Z, 1.0, a mouse). The right nub is not mapped. You can do that yourself. See previous post.
 
Just tried this, but doesn't work with bluetooth (and Windows) for me.


The HID device is seen and the connection can start, but once it is established everything I do in MasterControl is not seen by the PC.


Tried different times, even restarting the program more then once during the connection.
There are still problems with Windows. Is the Bluetooth button's border turning green? Does Windows recognize the devices?
 
Can I use Right nub for mouse and Shoulder buttons for Shift/Ctrl?

I want the Pandora feeling :) .

I know it's  Alpha release so will this be possible in one of the next releases?
That's already possible :)

Add this to mastercontrol.conf:

("OUT.Keyboard.RightShift", "IN.Gamepad.Buttons.LeftShoulder"),


("OUT.Keyboard.RightCtrl", "IN.Gamepad.Buttons.RightShoulder"),


("OUT.Mouse.Left", "IN.RightNub.MouseMove.Left"),


("OUT.Mouse.Right", "IN.RightNub.MouseMove.Right"),


("OUT.Mouse.Up", "IN.RightNub.MouseMove.Up"),


("OUT.Mouse.Down", "IN.RightNub.MouseMove.Down"),

Be aware, that there are already mappings for the mouse. You have to delete them or comment them out.

And make sure, the right nub is configured to mouse movement (with nub configurator)
Nice.

I don't want right nub for movement but for buttons.
 
Nice.

I don't want right nub for movement but for buttons.
Then add this:

("OUT.Mouse.Buttons.Left", "IN.RightNub.MouseButtons.Left"),


("OUT.Mouse.Buttons.Right", "IN.RightNub.MouseButtons.Right"),


("OUT.Mouse.Buttons.Middle", "IN.RightNub.MouseButtons.Middle"),

You may check mastercontrol_keydefs.conf for valid key/move events
 
Last edited by a moderator:
Back
Top