Hi Guys, thanks for investigating these DroidScript issues, it’s been helpful. I saw you struggling and decided to sort DroidScript out and get it working on VIM since it’s such an awesome piece of kit. So VIM/VIM2 will be officially supported by DS from now on
The VIM devices are a major find for me and I can’t believe I didn’t know they existed till about a week ago! I was trying to build my own Android alternative to the Raspberry Pi out of cheap S905 based TV boxes and laser cut acrylic when I stumbled upon the khadas web site… OMG this is exactly what I’ve been looking for
I’ve got myself a VIM pro and I’ll be ordering a VIM2 soon but I expect the latest alpha version will work on the VIM2 as well (let me know).
The latest alpha release of DroidScript which provides support for VIM can be found here:- http://androidscript.org/alpha/DroidScript_159a2
(Tested on Vim_Nougat_Root_170421)
Note1: You need to uninstall any older copies of DS (DroidScript) before you install the alpha or your will get locked out by a password dialog)
Note2: The DroidScript IDE can be used remotely over Wifi, just type IP address of your VIM into a browser and add port 8088 to the url (eg. http://192.168.1.48:8088). You can also use a config file to make DS auto-start so that you can run headless (check the DS forum for more info)
Here’s an example of flipping the GPIOH5 pin from a native Android toggle button:-
//Called when application is started.
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a toggle button.
tgl = app.CreateToggle( "Toggle Button", 0.4 );
tgl.SetMargins( 0, 0.02, 0, 0 );
tgl.SetOnTouch( tgl_OnTouch );
lay.AddChild( tgl );
//Add layout to app.
app.AddLayout( lay );
//Setup the GPIO pin.
sys = app.CreateSysProc("su");
sys.Out( "echo " + 176 + " > /sys/class/gpio/export\n" );
sys.Out( "echo out > /sys/class/gpio/gpio" + 176 + "/direction\n" );
//Called when user touches our toggle button.
function tgl_OnTouch( isChecked )
if( isChecked )
sys.Out( "echo 1 > /sys/class/gpio/gpio" + 176 + "/value\n" );
sys.Out( "echo 0 > /sys/class/gpio/gpio" + 176 + "/value\n" );