Remote Keyboard
  • mungle
    junior Member
    Posts: 4
    Joined: Wed Apr 19, 2017 12:10 am

    Remote Keyboard

    by mungle » Wed Jul 26, 2017 12:59 am

    Hello,
    I need to manage playback and mapping remotely.
    The best solution will be to be connected to my miniMAD:

    - via browser with a page that have some button that will trigger/simulate keystrokes
    or
    - via VNC

    I made some try without success...
    could you help me please?

    PS: bluetooth keyboard aren't a solution.
  • Pierre Guilluy
    garageCube team
    Posts: 451
    Joined: Mon Oct 12, 2015 1:50 pm

    Re: Remote Keyboard

    by Pierre Guilluy » Tue Aug 01, 2017 8:59 am

    You can program an Arduino Leonardo to simulate keystrokes in response to Midi, DMX or any other protocol.
  • mungle
    junior Member
    Posts: 4
    Joined: Wed Apr 19, 2017 12:10 am

    Re: Remote Keyboard

    by mungle » Sat Aug 05, 2017 4:49 pm

    I found a solution!

    #######################
    FIRST PART :!:
    #######################

    Here the instructions:
    Open terminal and access to your MiniMad

    Code: Select all

    ssh pi@your.pi.ip.address

    pssword: raspberry

    Code: Select all

    cd ~
    sudo apt-get install rpi.gpio
    wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
    tar xvzf WebIOPi-0.7.1.tar.gz
    cd WebIOPi-0.7.1
    wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
    patch -p1 -i webiopi-pi2bplus.patch
    sudo ./setup.sh


    Delete the password to access Webiop web interface

    Code: Select all

    sudo mv /etc/webiopi/passwd /etc/webiopi/passwdOLD


    Create directories and uplad files you can find attached to this post (sftp is the way I prefere)

    Code: Select all

    cd ~
    mkdir mmcontrol
    cd mmcontrol
    mkdir html
    mkdir html/img
    mkdir html/js
    mkdir html/css


    Edit config file

    Code: Select all

    sudo nano /etc/webiopi/config


    In config file find this line

    Code: Select all

    # Use doc-root to change default HTML and resource files location
    #doc-root = /home/pi/webiopi/examples/scripts/macros


    comment that line if not alreay commented as above and add this one

    Code: Select all

    doc-root = /home/pi/mmcontrol/html


    Start Webiop with debug

    Code: Select all

    sudo webiopi -d -c /etc/webiopi/config


    You will read a line with an http address like http://192.168.0.100:8000 visit it and you will se the remote web UI

    Everythink should works! :D


    #######################
    SECOND PART :?:
    #######################

    From here everything works, now I would like to simulate a keyboard so I can use "crop" and "select media" features

    I tried to add two buttons as test so they can simulate keystrokes. Everything looks right but I'm unable to send any fake keyboard output...to have a try just follow these steps:

    when everything works, open your terminal, login via ssh to your minimad ad launch these commands:

    Code: Select all

    cd mmcontrol/html
    mkdir macros
    cd mmcontrol/html/macros
    git clone https://github.com/tuomasjjrasanen/python-uinput.git
    cd mmcontrol/html/macros/python-uinput
    sudo python3 setup.py build
    sudo python3 setup.py install


    when everything is installed run this command:

    Code: Select all

    modprobe uinput


    If you want to run it at startup:

    Code: Select all

    sudo nano /etc/modules

    and add this line

    Code: Select all

     uniput


    now open script.js (the JS file be careful!!!) and uncomment the commented lines
    save the file and upload it in js folder

    now go to mmcontrol/html/macros and add the script.py (the python file attached to this post)

    relaunch webiop with

    Code: Select all

    sudo webiopi -d -c /etc/webiopi/config


    Everything should works without issue but the fake keyboard (even if I didn't found any log errors) it doesn't works...you can see in terminal that when you press the 1 or 2 button you get print output but keystrokes aren't sent to minimad.... maybe somone more expert then me could fine a solution?

    PS: If I made some transcriction errors please tell me and I will edit!

    USEFUL LINKS:
    Webiop:
    https://github.com/doublebind/raspi
    http://webiopi.trouch.com/issues/140
    https://forums.connectedly.com/raspberry-pi-f179/how-controlling-gpio-pins-via-internet-2884/
    https://github.com/doublebind/raspi/issues/3

    UINPUT
    http://tjjr.fi/sw/python-uinput/

    USEFUL WEBIOP COMMANDS
    EDIT PASSWORD
    sudo webiopi-passwd

    DELETE PASSWORD
    sudo mv /etc/webiopi/passwd /etc/webiopi/passwdOLD

    START WITH DEBUG
    sudo webiopi -d -c /etc/webiopi/config

    START
    sudo /etc/init.d/webiopi start

    STOP
    sudo /etc/init.d/webiopi stop

    STATUS
    sudo /etc/init.d/webiopi status

    RESTART
    sudo /etc/init.d/webiopi restart

    START AT BOOT
    sudo update-rc.d webiopi defaults

    DELETE START AT BOOT
    sudo update-rc.d webiopi remove
    Attachments
    script.py.zip
    PYTHON SCRIPT
    (416 Bytes) Downloaded 351 times
    Files to upload.zip
    Files to upload
    (2.62 KiB) Downloaded 386 times

Who is online

Users browsing this forum: No registered users and 8 guests