A simple library that lets you control your Raspberry Pi from the web - Raspberry Pi Development

Hey guys, I wrote a simple library that lets you control your Raspberry Pi. It wraps popular I/O libraries like RPi.GPIO so you can use them server-side and has an easy way to build user interfaces. More information can be found here.
A full tutorial
Server side source
Client side source

Control your rpi over nat via http
The hopmsg.com allows you the make a free message channel by creating a random key for free (no registration,login,etc) which can be used to get status / send command to your rpi:
1, Simplest way to Send/Receive message from any kind of OS/browser/platform just by clicking on a link, only need to know the ID of your msg!
Example: set your message by opening a link : hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY&value=message
get your message from any device by opening: hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY
or use the Android App to get/set it.
2, Control your device inside Nat/Lan
Example: set your command by opening a link : hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY&value=command
get your command from any device by opening: hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY
or use the Android App to get/set it.
3, Basic monitoring system
Bash script checking uptime:
UP=`uptime | sed -e 's/ /_/g'`; curl "hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY&value=`echo ${UP}`"
and use the Android App or a browser to check the status of the device.
4, Get your IP address, the message source, poor man's dyndns
If you set some values, with src=1 parameter your IP and the UTC time also added to your message
Example:
hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY&value=VALUE&src=1
wget -qO- hopmsg.com/ctl.php?id=YOUR_UNIQUE_KEY > result.txt
to use with some script.

Re
on hopmsg.com now embedded keys can be used to create complex message or status report like:
ROOTKEY="My IOT dev. overview: uptime:|MY_UPTIME_KEY|, freespace:|MY_FREESPACE_KEY| end."
each key can be updated separately with https

a little bit like the pi html5 dashboard maybe ?

Related

[Q] TAP/Bridge mode VPN in jellybean

Has anyone successfully established a bridge mode VPN connection (using TAP) in any version of Jellybean, stock or custom?
It seems that every vpn app in the play store suggests that this can't be done in JB. I'd really like to upgrade to JB, but I really don't feel like reconfiguring my whole VPN setup, just to log on to my home server every once in awhile.
Hoping I'm wrong about this...
ushlambad said:
Has anyone successfully established a bridge mode VPN connection (using TAP) in any version of Jellybean, stock or custom?
It seems that every vpn app in the play store suggests that this can't be done in JB. I'd really like to upgrade to JB, but I really don't feel like reconfiguring my whole VPN setup, just to log on to my home server every once in awhile.
Hoping I'm wrong about this...
Click to expand...
Click to collapse
Yes all you need to do is search Open VPN Tun [short for tunnel and the name OpenVPN gives the setting] in the Android Play Store to find the Open VPN Settings app created by: Friedrich Schäuffelhut
[Found Here: Open VPN Settings]
When you run it it will run some checks and may ask you to download the following to install the ifconfig binary and the Open VPN binaries in to the system [ifconfig is installed as part of busybox so you maybe good may not but app checks and runs well].
Installer Link [which can also be run on it's own and also checks things and will tell you if you are good to go or if it needs to install things for you.
Open VPN Settings Installer
IF UNSURE USE /system/xbin for install location [first question] and accept defaults or the rest.
THIS WILL REQUIRE A ROOTED ANDROID DEVICE [due to it being a tunnel and not a tap interface you need root to set the connection up and make it usable within android the android VPN client itself only accepts TAP style interfaces due to possible security risks "casual" or "non-technical" users may not understand and thus to protect you from yourself it doesn't do TUN interfaces.
You can use either blah.ovpn OR blah.cfg [Windows servers use .ovpn as extension whereas Linux favors .cfg but both are the same text based profile file]. if I remember right just create /sdcard/openvpn/<whatever> [whatever is whatever directory name [if you want one] I use the client name that way all the keys and profiles are organized and not all jumbled in one folder [or if files have same name or different content then you will be forced to do this for something like multiple OpenVPN server profiles]. THE OpenVPN app tells you this if you open it and there is no /sdcard/openvpn folder found it says to create it in the middle of the main window area]
Also, it is easiest to edit your profiles so there is no absolute directory structure pointing to the files [the ca.crt, client.crt and client.key files].
This is very easy just remove all directories so the line ONLY has the filenames [See example profile in code box below].
Here to make this easy here is an example profile file I use [your server and port as well as if you choose to have it persist the IP addresses of clients across multiple connections may be different, up to you].
Code:
.
# Specify that this is a client
client
# Bridge device setting
dev tun
# Host name and port for the server (default port is 1194)
# note: replace with the correct values your server set up
remote some.domain.or.IP.address.here <whatever port you use here>
# Client does not need to bind to a specific local port
nobind
# Keep trying to resolve the host name of OpenVPN server.
## The windows GUI seems to dislike the following rule.
## You may need to comment it out.
## This MAY NOT be a good choice
## for most folks I use a private server
## without many clients so it doesn't
## affect me if they connect a bunch of times but any security systems
## may not like it if you connect too many times to quickly and you don't
## want your own server blocking your IP when you want to connect now do you :)
resolv-retry infinite
# Preserve state across restarts
persist-key
persist-tun
# SSL/TLS parameters - files created previously
ca ca.crt
cert client.crt
key client.key
# Specify same cipher as server
cipher <choose your cipher>
# [same as you set on your server don't make it different]
## Default here is usually BF-CBC if I remember right
# Use compression
## again make sure you enabled compression in the server profile or comment it out here
comp-lzo
# Log verbosity (to help if there are problems)
## I set it a little higher but not totally verbose
## I like a little info when there are problems
## to help fix them, up to you what you choose
## Can be different from server setting
verb 3
Hopefully this helps. I am unsure of your or anyone else who may like this posts technical skills so trying to be thorough. You could also use this profile to work backward filling in the same settings asked for in the server profile.
ONCE YOU GET THE profile on to the SDCARD and connect the first time the app will always bring it up and all you have to do is tap a checkbox to turn on the VPN Settings app and then once more to enable the profile you want [yes even if just one you have to check it, BUT, IF YOU uncheck the OpenVPN enable/disable checkbox at top the next time you enable it it will auto enable last used connection !
IT REALLY IS A VERY EASY TO USE AN NICE APP [AND ONLY ONE TO SUPPORT OPEN VPN TUN [TUNNEL] INTERFACE SETUPS!

[FREE][APP] CONSOLE WP8 - Shell Dos For Windows Phone 8

CONSOLE WP8
UPDATE: 1.8 - 2014-12-23 03:10:00
I'm excited to announce today the 1.8 update "WP8 Console"
- Added new command: [shortcut] to create tiles (shortcut) on the home screen link to a file
- Added new command: [set] to create / edit environment variable
- Adds new command: [tree] To list all files in the current folder and displayed in a tree
- Added new command: [reload] update all files are added, deleted or updated from the phone storage
- Added support batch file (.bat, .bat, .command) can execute the batch file with 'shell' easy to see the available commands please check the Help menu in the application
- Add support and management of files from the phone storage, edit, delete, rename, copy, move the file
- Add new examples files with commands 'batch' in (c: \ scripts)
- Improve in landscape view
- Add the new control loop [for], allowing wonderful combinations for scripts
- Improved performance and fixed some bugs in the user interface (language), network, local control, etc ..
WATCH OUT ! Apparently there is a problem to change the culture of application language for the "lite" version of "WP8 Console" with 1 missing images on the window "Wizzard". Will be corrected in the evening today!
Execute "shell" commands from your Windows Phone, manage your files, automated actions created scripts, created tile shortcuts to files, etc. The only application "console" on the store!
Access to over 45 functions with the controls ("MS-DOS")
- View the contents of a directory
- Read the contents of a file
- Modify a file
- Move a file
- Copy a file
- Rename file
- Print a file and email
- Delete files / folders
- Get information about the network
- Scripts write and run the .bat file script, .wpbat
- Ping - Ipconfig - net view (network control jack)
- Start programm windows phone from the shell
- View / execute files from the shell (music, photos, videos, audio, html, etc.)
- Use the loop function with "for"
- Etc ..
Example - Sample code you can use
Example batch file script 1:
//Ask a number to the user and loop on it
@echo off
echo (Enter a number to count please)
set /p /a loopNumber=
for /l %%i in (1,1,%loopNumber%) do echo %%i
Example batch file script 2:
//Remove all the files with the .txt extension from the current directy
for %%i in (*.txt) del %%i
Example batch file script 3:
//Ask the user how many fake folder he wank make
@echo off
echo (How many fake folder do you want make ?)
set /p numberOfFakeFolder=
for /l %%i in (1,1,%numberOfFakeFolder%) md fakeFolder_%%i
Example batch file script 4:
//Ping on google , save the result into a file and send the content by email
@echo off
ping google.com > res.txt
print res.txt
Click to expand...
Click to collapse
App link:
Console WP8 : http://www.windowsphone.com/en-us/store/app/console-wp8/8da96293-ec71-e011-81d2-78e7d1fa76f8
Console WP8 Lite : http://www.windowsphone.com/en-us/store/app/console-wp8-lite/2d27a82d-ef71-e011-81d2-78e7d1fa76f8
Click on the pictures to see more :good:
Wow, nice. Download link?
GoodDayToDie said:
Wow, nice. Download link?
Click to expand...
Click to collapse
Hi, Thank you and sorry . I just added now the link for my application in the Windows Phone Store
Update: 1.8 - 2014-12-23 03:10:00
UPDATE: 1.8 - 2014-12-23 03:10:00
I'm excited to announce today the 1.8 update "WP8 Console"
- Added new command: [shortcut] to create tiles (shortcut) on the home screen link to a file
- Added new command: [set] to create / edit environment variable
- Adds new command: [tree] To list all files in the current folder and displayed in a tree
- Added new command: [reload] update all files are added, deleted or updated from the phone storage
- Added support batch file (.bat, .bat, .command) can execute the batch file with 'shell' easy to see the available commands please check the Help menu in the application
- Add support and management of files from the phone storage, edit, delete, rename, copy, move the file
- Add new examples files with commands 'batch' in (c: \ scripts)
- Improve in landscape view
- Add the new control loop [for], allowing wonderful combinations for scripts
- Improved performance and fixed some bugs in the user interface (language), network, local control, etc ..
For more information , please check the first page, i edited the content presentation.
Update last corrections as requested by email.
- Problem for set the language in the 'lite' version :Console WP8 Lite
- Pictures missing in the "wizard" popup . The first use
- Problem, help menu no change the language dynamically after set a new language
New versions:
Console WP8 1.8.0.1
Console WP8 Lite 1.8.0.1
Thanks to Microsoft who have release my update very quickly ! (1 day)
Can i ping something with this tool ?
Stefan Caromov said:
Can i ping something with this tool ?
Click to expand...
Click to collapse
Hi Stefan , yes off course you can ping on internet or local machines
Examples:
ping 8.8.8.8
ping 192.168.1.5
ping google.com
start command is not working .
can you show the syntax of that command .
irshad2809 said:
start command is not working .
can you show the syntax of that command .
Click to expand...
Click to collapse
Hi, which order are you talking about ?
for [Ping] command for example with google, you just need tape :
ping google.com
and then ,tape "enter" button.
For more information, you can click on the "Help" button
kingmiddle said:
Hi, which order are you talking about ?
for [Ping] command for example with google, you just need tape :
ping google.com
and then ,tape "enter" button.
For more information, you can click on the "Help" button
Click to expand...
Click to collapse
look i have attached screen shot . the START command .
its not working
Mh you mean this command . Ok sorry
you can use the (start) command for execute or start different program
Example
Open new html page on specific url
start http://www.google.ch/search?q=lol
Open Power menu
start ms-settings-power
and again ....
After you can combine this code with a script etc..
kingmiddle said:
Mh you mean this command . Ok sorry
you can use the (start) command for execute or start different program
Example
Open new html page on specific url
start http://www.google.com?d=blablabla
Open Power menu
start ms-settings-power
and again ....
After you can combine this code with a script etc..
Click to expand...
Click to collapse
can i use uri of apps to open them using this
ho, sorry . You mean the "Start" command .
Ok no problem. With "Start" command , you execute/open different programm
For example :
// open a website with arguments
start http://google.com/search?q=test
// open new email
start mailto:[email protected]
// open Bluetooth menu
start ms-settings-Bluetooth
After you can mix and make a 'batch' script file , or create a shortcut tile link to this script
Example :
Step 1 - write the code into a file with (echo) for open Bluetooth menu
echo start ms-settings-Bluetooth >> c:\data\test.bat
Step 2 - execute the (shortcut) command for create a tile to the home screen (.ink)
shortcut /n myTileTItle /t c:\data\test.bat
/n => shortcut name
/t => target file
/i => icon picture
you can check the sample scripts to "c:\scripts" and try to open the code with the type command.
Example :
//Read the code
Type mySampleFile.bat
//Execute the batch file
mySampleFile.bat
@irshad2809
this is a very interesting question !
I know you can start all of this command :
http://msdn.microsoft.com/en-us/library/windows/apps/jj662937(v=vs.105).aspx
I don't know before , we can start another app with a uri shema . For now , i use the code "Windows.System.Launcher.LaunchUriAsync" like on the picture i attach, i don't know if you can use it or not for open a installed app . Please if you try , can you come back give me the result ?
Maybe i can add this feature to the next update
kingmiddle said:
@irshad2809
this is a very interesting question !
I know you can start all of this command :
http://msdn.microsoft.com/en-us/library/windows/apps/jj662937(v=vs.105).aspx
I don't know before , we can start another app with a uri shema . For now , i use the code "Windows.System.Launcher.LaunchUriAsync" like on the picture i attach, i don't know if you can use it or not for open a installed app . Please if you try , can you come back give me the result ?
Maybe i can add this feature to the next update
Click to expand...
Click to collapse
this feature is already there in your app ,
like if you type " start zune " : xbox music will open
or start whatsapp : whatsapp opens .
there is list of uri for almost apps on nokia wiki website .
. but i was looking for , something like "Native Toast Launcher " . can you look into that ?
irshad2809 said:
this feature is already there in your app ,
like if you type " start zune " : xbox music will open
or start whatsapp : whatsapp opens .
there is list of uri for almost apps on nokia wiki website .
. but i was looking for , something like "Native Toast Launcher " . can you look into that ?
Click to expand...
Click to collapse
Ok, i got it now. I will work on this new feature, and implement it for the next update . Between the middle and the end of january I agree with you , this feature can be interesting .
Thank you very much
i mean can i see the sent and reciecved packages ? example : ping google.com -t -l 1024
Invalid URI: The hostname could not be parsed.
.
.
.
can you explain about this .
@Stefan Caromov , sorry for now , you can only use the [w] and [n] arguments for set the timeout or how many packet will be send . By the way you can not see the size of packet size. I take not now for implemant this new feature in the next update
@irshad2809 Do you can please , show me wich 'hostname' you used ?
ping Google.com => is ok
ping 8.8.8.8 => is ok
ping 192.168.1.1 => is ok
ping http://www.google.com => is not ok ! As the true cmd command line
good game, this app is very nice

[Q] Finding CPU time for a web app

I want to measure the real, system and user time for running a web benchmark (Can't post the link right now because of forum rules). It basically runs some pre-stored site data emulating basic human interaction and contains index.html, results.html and some java script files.
I was able to modify the index.html to autostart without pressing a start button and then using android intents to start web browser.
Code:
time adb shell am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity -d file:///storage/emulated/0/benchmark/bbench/index.html
But the above code gives me the time for only the process which starts the index.html file. The time value is not for the entire benchmark run.
Possible solution: I can call the above intent in a script and then run the script using time function, the catch is that I need to get some kind of feedback or end of task status from the benchmark. I can't understand how to do it.
When I open results.html file, there is a for loop which basically runs the benchmark for some predefined number of iterations, I can perhaps modify this or get some status flag from here. BUT, the main question is can I poll a function/ variable in java script from shell script?
I am doing everything on android platform 4.2.2 .
Thanks!

[Updated: JUN 15] Easier XMir Setup (Now with Libertine!)

EDIT: I bring you the new OFFICIAL way of installing X11 applications, I've been neglecting this thread way too much and need to give it some love.
The old instructions (OLD METHOD) are no longer needed as of April on the rc and rc-proposed channels, this should work on all channels however (tested up to latest devel-proposed image)
NOTE: You still need a writable image for the first parts of this, after you install the tools, it can go back to read-only.
1) Open Terminal
2) Install the following packages: libertine libertine-tools python3-libertine-chroot
3) Open the Ubuntu Store and install the scope: libertine-scope
4) Open the Libertine application that's now available in your launcher and follow instructions, it will set up a Ubuntu Vivid chroot in your home directory, install the components needed, and drop you at the package management screen. From here, you can update and add PPAs to the container via the Settings Icon -> Manage Container, Install packages via the plus icon, etc.
5) Favorite the Libertine XApps scope by swiping up on the home screen and hitting the star, then open the scope and you'll see any applications you installed there.
If you cannot install your container via the Libertine application (I know that it didn't have support for chroot until recently, not sure if that version has landed yet), you can install your container via the teminal, so open your terminal but DO NOT sudo su. All Libertine-container-manager commands MUST be done as phablet.
To create a container (this line will likely change when Xenial drops as Libertine will be switching to LXC on Xenial):
Code:
libertine-container-manager --create -i <container id> -n <friendly name (this shows up in the Libertine app)> -t chroot
Using this command, the system will build the new libertine container, wait until it's finished and then you can continue by using the installed Libertine application.
Onscreen Keyboard in Libertine Applications
THIS CAN FINALLY BE DONE! The only con to it, is that it is mostly unusable in applications that open dialog boxes along the bottom of the screen, the XMir window does not scroll up like native applications do to give a better viewing window. (I have been told that this will change in OTA-12 when the keyboard support drops for Libertine/Puritine apps)
To install on-screen keyboard:
Open Libertine and add ppa:brandontschaefer/maliit to your container. Then hit update in Manage Containers. Once done, install the following, maliit-inputcontext-gtk2, maliit-inputcontext-gtk3, maliit-framework. After that, setup is complete in your container, now we need to do some extra work outside the container to make it pass the GTK_IM_MODULE variable we need over to Libertine. To do this, add this line to your .bashrc or if you have a writable image, you can add this to the systemwide profile (not sure if this will be replaced on OTA though):
Code:
export GTK_IM_MODULE=maliitphablet
Restart the tablet OS, Open an application such as Libreoffice Writer and BEHOLD!
Notes
You can also manage your container via the terminal with libertine-container-manager. To get a root shell without installing mate terminal (You can't get a root shell via this method (installing a term), Proot acts like fakeroot all over your container's rootfs), you can use the following:
- l-c-m exec -c bash (This command does not mount any user directories (/home/phablet will not exist) and is best used for making changes to the container's rootfs)
or if you only need a user shell:
- DISPLAY= libertine-launch <containerid (default is vivid)> bash (This mounts user directories, but is no different than if you installed something like mate-terminal and ran it. The reason we are passing an empty DISPLAY variable is because libertine-launch will refuse to start if DISPLAY isn't set, even it if doesn't exist.)
- DPI Hacks: To change the DPI of applications in Libertine, you need a new way to make the .Xdefaults file as only the XDG User directories get mounted inside the libertine container, not your entire Home. To do this, install your favorite editor inside of the libertine container (I find nano to be the easiest for new users), and open Terminal, then follow these instructions:
1) Open your editor to ~/.local/share/libertine-container/user-data/[my container id, default = vivid]/.Xdefaults and fill it with the following:
Code:
Xft.dpi: 175
or what your preferred DPI is. On the Nexus 7 flo the comfortable DPI is 175 with an application font size of 14 (I use Liberation Sans which comes from Libreoffice).
- You can make your applications look great still, you don't have to be stuck with the default Raleigh GTK style. Download and install LXAppearance in your container and add ppa:noobslab/themes then start installing themes. Enjoy! The Ubuntu Touch Themes are wonderful and FlatPlat works well with the system UI as well.
Some cons to this:
- It requires at least 3GBs available in your internal storage (wherever your home folder resides) to store a full, non-touch Ubuntu Vivid container.
Pros:
- It survives OTAs, the only thing able to break this would be a change to XMir, PRoot, or Libertine. Which is landing in the images shortly by default so there's not much of a chance to break this.
- Nothing you do will break your UTouch system. Unlike the old method, this only installs the items needed to run the container, which are to become standard inside the images very soon.
OLD METHOD
--------------------
EDIT: I have not tested this in stable, rc, rc-proposed yet. Only the dev-proposed channel.
So there is some questioning I see going on about how to run things like Firefox efficiently and well. So I figured I'd write up a little something for it.
First you'll want to set your DPI in ~/.Xdefaults, as I have a Nexus 7, mine looks similar to this:
Xft.dpi: 240
Note that you may need to do some additional tweaking.
Now that you have Xdefaults made, install the ubuntu-pocket-desktop and matchbox-window-manager packages (along with the program you wish to use, for this tutorial, I'll use libreoffice).
Create a file in /bin called wm-wrapper.sh (or whatever you choose here, just remember the name), fill it with:
Code:
#!/bin/bash
matchbox-window-manager -use_titlebar no -use_dialog_mode const-horiz &
exec [email protected]
and save it, then chmod a+x it.
EDIT: For this next part, I recommend copying the .desktop to ~/.local/share/applications to avoid them being overwritten on package updates.
Now, navigate to /usr/share/applications/ and open the .desktop file for the application you are wanting to run. Add the following lines under [Desktop]:
Code:
X-Ubuntu-Touch=true
X-Ubuntu-XMir-Enable=true
Change the Exec line so that your wrapper (in my case wm-wrapper.sh) is in front of the executable, such that the line becomes (or similar):
Code:
Exec=/bin/wm-wrapper.sh libreoffice %U
Save it, then search for your application in the Unity Scopes. Open it up and you should see your application running as an XMir app easy. For future applications, you will simply need to do the changes to it's .desktop file.
EDIT: A helpful redditor gave me this tip to enable sending touch events over to Xmir. Setting the GTK_TEST_TOUCHSCREEN environment variable to 1 will apparently remove hover events and the like (events that are not normally sent with a touch screen, but with a mouse). I have not had time to take a look at this yet however so YMMV.
Thanks man, gonna try this on my n4 later today. ?
thumbzzzz said:
Thanks man, gonna try this on my n4 later today.
Click to expand...
Click to collapse
No problem, Like I said, not sure if it works on other channels, but it works great on the dev-proposed channel. You will also want to close applications using their menu items as closing the Xmir root window will cause the application to terminate without asking to save anything. Libreoffice can get around this via Document Recovery though.
I had been working on this for a good solid week testing applications and different ways to get X11 applications working so I could make it a full workstation, so I figured why not post my findings since the Ubuntu forum doesn't seem to get much love.
Thanks for the matchbox tip! It works quite nicely, especially, it brings a nice onscreen keyboard with it. I use the following setup now:
~/.local/share/applications/gedit-mb.desktop
Code:
[Desktop Entry]
Name=GEdit in Matchbox
Type=Application
Terminal=false
Icon=/usr/share/gedit/logo/gedit-logo.png
X-Ubuntu-Touch=true
#X-Ubuntu-XMir-Enable=true
Exec=/home/phablet/bin/matchbox-wrapper.sh gedit
~/bin/matchbox-wrapper.sh
Code:
#!/bin/bash
export DISPLAY=:1
Xmir $DISPLAY &
sleep 1
# xlogo
# xeyes
# x11vnc -forever -nopw -quiet -display $DISPLAY &
matchbox-window-manager &
sleep 1
matchbox-keyboard &
[email protected]
~/.matchbox/kbdconfig
Code:
# http://unix.stackexchange.com/questions/223110/what-are-the-keyboard-shortcuts-for-matchbox-window-manager
<ctrl><alt>p=prev
<ctrl><alt>n=next
<ctrl><alt>d=!matchbox-desktop
<ctrl><alt>x=!xterm
<ctrl><alt>f=!firefox
Together with the Xft.dpi setting (I use 220) this gives me a quite usable editor. If you have any other tips ShadowEO, I'd love to hear them!
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
ShadowEO said:
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
Click to expand...
Click to collapse
Do you have a specific example? Which application are you looking at?
doniks said:
Do you have a specific example? Which application are you looking at?
Click to expand...
Click to collapse
Sorry, for some reason I wasn't subscribed to this post (weird.)
Anyway the specific application I was looking at was gedit, when started with the native GDK Mir backend, it is almost unusable with touch as the elements are so small. GDK_SCALE doesn't work and neither does any of the GTK dconf settings for scaling.
Also, I have switched to using rc-proposed, so any more changes I do will likely be able to be installed without worrying about the snapshot channel.
Also messing with some touch-screen specific .gtk2.0-rc entries seem to help, but since I reformatted, I don't quite have those offhand at the moment. I'll have to look them up again.
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
takri said:
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
Click to expand...
Click to collapse
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
ShadowEO said:
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
Click to expand...
Click to collapse
Thanks a lot for your answer. Sorry I don't know much yet about all this so my questions might be silly!
1) I installed touchegg but I don't know how to make it work
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Thank you very much!
takri said:
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Click to expand...
Click to collapse
If you use the matchbox setup I described above then you should have a keyboard.
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Click to expand...
Click to collapse
This website describes a tweak to put the apt cache on an external SD card. It's in German, but the command lines should be clear enough. Let us know how it goes.
https://wiki.ubuntuusers.de/Ubuntu_Touch/Terminal/#Freien-Speicher-beobachten
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Remember XMir is better used with a physical keyboard since it doesn't trigger the Ubuntu keyboard for everything.
You can also make the system img bigger if using MultiROM: you simply run e2fsck -fp /path/to/Ubuntu.IMG and resize2fs <target size> /path/to/Ubuntu.IMG.
ShadowEO said:
You would need to run touchegg in the wrapper.
Click to expand...
Click to collapse
I've played around with this a bit, but I can't get touchegg to work. I start an xmir application, then log in via ssh from my desktop. After setting the DISPLAY variable, I can start more X applications ok. After starting touchegg I see an output like this:
Code:
Reading config from "/home/phablet/.config/touchegg/touchegg.conf"
Try to make a multitouch gesture. If everything goes well the information about the gesture must appear
[+] Avaliable gesture:
Name -> Flick
[+] Avaliable gesture:
Name -> Drag
[+] Avaliable gesture:
Name -> Pinch
[+] Avaliable gesture:
Name -> Rotate
[+] Avaliable gesture:
Name -> Tap
[+] Avaliable gesture:
Name -> Touch
I assume that I am supposed to see some more output when a touch gesture is recognised by touchegg, but nothing ever shows up.
I can see touch events with either xinput or evtest
Code:
$ xinput test "xmir-fake-touch-pointer:0"
motion a[0]=36317 a[1]=42290
button press 1
motion a[0]=36590 a[1]=41730
motion a[0]=36645 a[1]=41275
motion a[0]=36536 a[1]=40469
motion a[0]=36263 a[1]=39524
motion a[0]=35935 a[1]=39034
motion a[0]=34897 a[1]=38019
motion a[0]=33532 a[1]=36934
motion a[0]=32713 a[1]=36303
motion a[0]=31839 a[1]=35778
motion a[0]=31293 a[1]=35533
motion a[0]=30856 a[1]=35323
motion a[0]=30638 a[1]=35253
motion a[0]=30419 a[1]=35148
motion a[0]=30255 a[1]=35078
motion a[0]=29928 a[1]=34903
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
button release 1
Code:
$ evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "elan-touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event type 3 (EV_ABS)
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 9
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 31
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 1343
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 2239
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event code 58 (ABS_MT_PRESSURE)
Value 0
Min 0
Max 255
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 9936.473027, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1159
Event: time 9936.473088, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 12
Event: time 9936.473088, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 27
Event: time 9936.473118, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 338
Event: time 9936.473118, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1059
Event: time 9936.473149, -------------- SYN_REPORT ------------
Event: time 9936.509709, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 11
Event: time 9936.509709, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 43
Event: time 9936.509709, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 351
Event: time 9936.509739, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1061
Event: time 9936.509739, -------------- SYN_REPORT ------------
Event: time 9936.512791, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 46
Event: time 9936.512791, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 357
Event: time 9936.512791, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1063
Some websites point to synclient for the configuration of touchegg, but that doesn't seem to work in Xmir:
Code:
$ synclient
Couldn't find synaptics properties. No synaptics driver loaded?
Does anyone else have more luck with touchegg?
While researching it, I stumbled over references to xSwipe, but I haven't looked into that any further.
ShadowEO said:
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Click to expand...
Click to collapse
Just to reiterate, the matchbox-keyboard works fine for me!
Oh, and one thing I wanted to share: The firefox extension Grab and Drag allows a more natural touch screen style drag-to-scroll.
I completely forgot the matchbox keyboard while writing that reply, I'm not sure what's going on with touchegg as I haven't had a chance to play with it on Ubuntu touch. It could be that XMir isn't actually passing that much information about touch events.
matchbox-window-manager struggle
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
eskizon said:
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
Click to expand...
Click to collapse
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
doniks said:
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
Click to expand...
Click to collapse
Thanks for sharing this info! I also own the M10 ubuntu tablet and try to run some X11 apps.
I am able to apt-get matchbox-window-manager. But it won't start and says it can't find the display.
Running either:
Code:
matchbox-window-manager
matchbox-window-manager -d :0
as a normal user or root always returns: "can't open display! check your DISPLAY variable.".
ubuntu-pocket-desktop is up to date and I also set the DPI in ~/.Xdefaults.
What could be the reason it can't find the display? What could I try?
Tazard4 said:
What could be the reason it can't find the display?
Click to expand...
Click to collapse
You don't have an X server running. At least not at :0.
What could I try?
Click to expand...
Click to collapse
Follow the instructions in the original post or in my post #4.
Bumping this thread as I've edited the OP with the official instructions for running Legacy X Applications on Ubuntu Touch. As well as information about getting the system maliit-based OSK showing in X Applications (It's not that great though, you still may have better luck with matchbox-keyboard/on-board, but not sure how you'd even start those in Libertine.)

Question how to use perfetto (or any equivalent known to mankind) offline ON ANDROID to READ a system trace

so I have been searching everything I could think of on the internet trying to figure out how to read a system trace natively made by Android 13 on my Pixel 6 on the phone itself because I'm not with my computer and can't use it and it doesn't seem to be possible. now there's a web page application but it requires that you be connected to the internet and requires that your system traces be minuscule tiny or that you learn how to use an Android phone without a graphic user interface because I'm sorry My bad I'm not a programmer I don't really want to be and they want me to code something into my browser on my phone I don't even know how to do that just so that I can open a file as large as the trace I made I just want to figure out why my phone is doing something that it shouldn't be doing(several somethings actually randomly failing to allow internet connection to my Xbox beta app randomly shutting down screen recordings in the middle and booting my screen black and kicking me out of Android so that I have to log back in randomly running a work profile I didn't install the list goes on) so I can stop it from doing that please if anyone out there knows anyway at all on this Earth to open and read a file who's extension is perfetto-Trace without plugging into a computer just like you know on my phone I swear to God I'll do anything I'm begging you please help a ***** out cuz this girl is on her last ragged edged nerve over all this it's too much for one girl to figure out
perfetto is an open source tool provided by google. you can download the binaries they already provided for android. you can download your device specific binaries
Release Perfetto v35.0 · google/perfetto
v35.0 - 2023-06-07: Tracing service and probes: * Compression has been moved from perfetto_cmd to traced. Now compression is supported even with write_into_file. The `compress_from_cli`...
github.com
you need to install a terminal emulator , I suggest the Termux from fdroid.
then setup and initialize everything in Termux (I can't explain now, you can google it)
the from the extracted zip file of perfetto binaries, copy them to termux
``cp -r [directory path of the extracted] .``
``cd [directory name of the extracted] ``
The supported output formats are:
text - protobuf text format: a text based representation of protos
json - Chrome JSON format: the format used by chrome://tracing systrace: the ftrace text format used by Android systrace
Converting to systrace text format
./traceconv systrace [input proto file] [output systrace file]
example, systrace format are more human readable and easier
./traceconv systrace sample-trace.perfetto-trace sample-trace.systrace
Same way,
Converting to Chrome Tracing JSON format which is so familiar
./traceconv json [input proto file] [output json file]
is this way it will give a human readable output. now you can view output with a text editor
although reading a big file of 50-100MB May not be possible because of chunk issue. but Mostly it will show otherwise no hope. there's very limited tools out there
You can inbox me if you need assistance.
[Its my first answer on XDA]

Categories

Resources