I found a solution!#######################
FIRST PART
#######################
Here the instructions:
Open terminal and access to your MiniMad
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
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! #######################
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:
If you want to run it at startup:
and add this line
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/raspihttp://webiopi.trouch.com/issues/140https://forums.connectedly.com/raspberry-pi-f179/how-controlling-gpio-pins-via-internet-2884/https://github.com/doublebind/raspi/issues/3UINPUThttp://tjjr.fi/sw/python-uinput/USEFUL WEBIOP COMMANDSEDIT 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