lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Raspberry Remote Control

Sat Oct 19, 2013 11:59 am

Hi

I created this app to control your raspberry pi using your android phone

It works through SSH and values are refreshed every 5 seconds (You can change the refresh rate)
Multi-profile

Let me know your thoughts

Images:
ImageImageImageImageImageImageImageImageImage


Download:
Apk Only: http://www.mediafire.com/?du0ydrnynk8j9xc (Updated 06/01/2014)
Source Code on GitHub: https://github.com/LorenzoRogai/RaspberryRemoteControl

Changelog
19/10/2013: Initial release
20/10/2013: Cpu infos (load, clock), storage infos, added the possibility to change refresh rate, bugfix
21/10/2013: Added profiles feature & new icon. Thanks to dan3008 for the icon
26/10/2013: Fix for non-root user and send custom command. Thanks to DougieLawson for the fix
29/10/2013: Some fix
06/01/2014: Converted infos array to List<Info>, Added net infos (Internal IP, External IP, Received Mb, Sent Mb, Total Mb, Active connections), Fixed bug on Raspberry shutdown command, Added devices section for future features
Last edited by lorigio on Mon Jan 06, 2014 9:46 am, edited 12 times in total.

User avatar
ZacharyI123
Posts: 263
Joined: Sun Jun 17, 2012 1:09 pm
Location: Ilford, Essex
Contact: Website

Re: Raspberry Remote Control

Sat Oct 19, 2013 1:00 pm

lorigio wrote:Hi

I created this app to control your raspberry pi using your android phone

It works through SSH and values are refreshed every 5 seconds

Let me know your thoughts

Images:
ImageImageImage

Download:
Apk Only: http://www.mediafire.com/download/du0yd ... elease.apk
Source Code on GitHub: https://github.com/LorenzoRogai/RaspberryRemoteControl

Very cool! Its great that you shared the code, now people can modify it for control particular projects! Does it have an option to simply control your pi (send commands)?
Don't be mean, I'm only thirteen 8-)

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Sat Oct 19, 2013 1:19 pm

Yes soon, this is only a initial release more features are coming soon

User avatar
DougieLawson
Posts: 36571
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Remote Control

Sat Oct 19, 2013 3:24 pm

lorigio wrote:Yes soon, this is only a initial release more features are coming soon
When I import this into the Eclipse ADK it triggers Windows Defender (Trojan:AndroidOS/FakeLook.A detected in ..\bin\classes.dex) when I try to run it. Can you explain why that happens and why it appears there's a Trojan in your GIT repo?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Sat Oct 19, 2013 3:48 pm

Classes.dex is generated when you compile the app. It's a false positive as you can see by searching in Google.
I use AVG and I don't get any warning.

User avatar
DougieLawson
Posts: 36571
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Remote Control

Sat Oct 19, 2013 11:53 pm

It was a good thing getting that false positive. I'd just upgraded from Win8 to Win8.1 and Avast (the free virus program I use) had been completely uninstalled by Microsoft's update. Fixed that now and there's no more trouble from your git clone.

I've now imported your source into the Android ADK and run it in the AVD emulator (not yet tried it on my Tesco Hudl).

I found a bug `cat /proc/uptime` returns a string that you don't handle correctly.

Code: Select all

[email protected] ~ # cat /proc/uptime
3781.40 3490.14
sometimes gets an invalid double exception.

I've also had an invalid float exception from `cat /sys/class/thermal/thermal_zone0/temp`

The second bug is when you trap that in

Code: Select all

builder.setPositiveButton("Change settings",
						new DialogInterface.OnClickListener() {
							public void onClick(DialogInterface dialog,
									int which) {
								ShowSetupDialog();
							}
						});
I can't get rid of that ERROR menu (which stays hidden behind the setup dialog) without closing the application and restarting.

I added loads of Log.d(TAG, "string"); trace points to get stuff out on the LogCat. If you want my modified source just ask.

The trigger for most of the errors seems to be re-opening the settings dialog while the app is running.

The other amusing error happened when I connected to my Ubuntu server rather than my RPi. That's something you may want to add a check for. The RPi says:

Code: Select all

Linux pi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l
when I connect.

My x86 Ubuntu server says:

Code: Select all

Welcome to Ubuntu 12.10 (GNU/Linux 3.2.0-54-generic i586)
It doesn't have /sys/class/thermal/thermal_zone0/ directory. So we won't ever get a valid result from that cat command and that causes a loop.

And last but not least. If I don't connect with my root userid I can't shutdown or reboot the system. My "normal" pi userid can't run a shutdown command without using sudo.

Code: Select all

ExecuteCommand("shutdown -h now");
Needs to become

Code: Select all

ExecuteCommand("sudo shutdown -h now");
and the same for `shutdown -r now`.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Raspberry Remote Control

Sun Oct 20, 2013 12:18 am

Sometimes the simplest ideas are the best :)

I use VNC to remote into my RPi and sometimes the connection goes wonky and then my VNC client won't re-connect and I just end up pulling power from the RPi (with the attendant probablities of SD Card corruption - 1 in 1000 if working at home - 50:50 if in a class of kids waiting to get re-started on their coding :)

Its never occurred to me to try ssh-ing in and do a soft shutdown - I'm a GUI person :)

And now - a simple app to do the job :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 8:09 am

New version available! Check the first post

@DougieLawson I know there are many bugs if you want to help me you can open a pull request on GitHub. Thanks for you testing

@simplesi Thanks for your opinion!

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Raspberry Remote Control

Sun Oct 20, 2013 10:35 am

Hi Lorigo
Just installed it (11:28) and tried the reboot and it came up with
Error
Can't communicate with the Raspberry Pi through SSH

Everthing else looked fine - I got all the info on my RPi - very nice

Do you just need to add the sudo bit as mentioned above? :)

Simon
PS I'm not speaking on behalf of anyone but maybe a good idea to use a different icon for the app rather than the offical RPi logo :)
Other people do things like this
http://mcrraspjam.org.uk/
https://www.modmypi.com/image/data/logo.png
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 11:05 am

If you want a new logo making, send me the size and i can do it :)
dan3008 wrote:Pays your money, takes your choice

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 11:14 am

@simplesi Yes if you don't login as root you have to use sudo. However that error will appear even if you login as root because the app can't communicate through SSH while the raspberry pi is rebooting.

@dan3008 The icon size is 72x72

I know the icon is the same of RPi but that was the last of my thoughts

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Raspberry Remote Control

Sun Oct 20, 2013 11:24 am

Yes if you don't login as root you have to use sudo. However that error will appear even if you login as root because the app can't communicate through SSH while the raspberry pi is rebooting.
I understand the bit about getting an error when its reboots but at the moment that's my last problem :) as its not rebooting :)

I'd just like to press the reboot and have the RPi reboot if possible please :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 12:16 pm

@simplesi I just tested reboot with my phone. I get the error but my RPi reboots successfully. Do you login as root?

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Raspberry Remote Control

Sun Oct 20, 2013 3:22 pm

no - I wasn't using root

It works now I've set a password using

Code: Select all

sudo -i
passwd root
:)

This could save a LOT of SD card corruptions on being able to do an easy remote shutdown/reboot :)

Maybe a good idea to trap the error when it reboots and just display the sort of thing you get with routers - e.g please wait 1min before tyring again

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
DougieLawson
Posts: 36571
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Remote Control

Sun Oct 20, 2013 7:16 pm

simplesi wrote:Its never occurred to me to try ssh-ing in and do a soft shutdown - I'm a GUI person :)
Ah, the youth of today :lol:
I'm a dinosaur and rarely, if ever, do this new graphics stuff. I even found an excellent SSH client (JuiceSSH) for my Hudl which gives me something that's just like PuTTY (which I use every day).
lorigio wrote:@DougieLawson I know there are many bugs if you want to help me you can open a pull request on GitHub. Thanks for you testing
It's something I do for my day job. I'll see if I can marshall git into submission (I've never tried pull, I'm always using `git clone ...`).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 8:17 pm

4 designs, took about 5 min lol

1 - my personal favorite, actually made this little beauty by accident
Image

2 - something a little more "normal", this is what i was working towards when i made 1 lol
Image

3 - a twist on a normal wifi logo, not my cup of tea but you might like it
Image

4 - I'm all for taking something "traditional" and reshaping it to make something epic, and thats how i made this, its the pi logo without the leaves and then a wifi wave on top
Image

--edit--
forgot to say. PM me with an email address if you want the originals, and i'll email them to you in whatever format you need :)
or if you want something diffrent, let me know, I love playing with photoshop
dan3008 wrote:Pays your money, takes your choice

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Raspberry Remote Control

Sun Oct 20, 2013 8:24 pm

Well - we know where to come for logo's now :)

Excellent designs :)
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 9:05 pm

simplesi wrote:Well - we know where to come for logo's now :)

Excellent designs :)
Simon
Yeh, if anyone wants a logo, I'm more than willing to help. Usually my turnaround wont be that quick though. Few days rather than a few hours lol. I just happened to have the day off today, so was available to have a play lol
dan3008 wrote:Pays your money, takes your choice

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Sun Oct 20, 2013 11:38 pm

Added comment... lol

I've just finished trying this on both my android phone and tablet, on the phone, I find the UI to be a little small and fiddly, but thats probably just my phone and its tiny touchscreen

On my tablet however, I love it.

potential future addition. maybe let it have multiple profiles. I have 2 pi's running at the moment, and having to enter all there settings every time i want to change pi's is a pain. So letting it hold connection details for more than one pi would be cool.

I really should learn java properly, then I'd offer to help :/
dan3008 wrote:Pays your money, takes your choice

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Mon Oct 21, 2013 7:43 am

Thanks for the icons!
I choosed this
Image
because it renders the idea of "remote"

I'll try to add multi-profile as soon as possible, i'm a bit busy at the moment

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Mon Oct 21, 2013 9:16 am

Pm'd you :)

The download link is in your inbox now :)
dan3008 wrote:Pays your money, takes your choice

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Mon Oct 21, 2013 9:45 am

Thanks it looks good! i'm working on profile system.
I think to finish for this evening

lorigio
Posts: 68
Joined: Tue Aug 20, 2013 8:38 pm

Re: Raspberry Remote Control

Mon Oct 21, 2013 6:53 pm

Posted the new version with the multi-profile feature (Require app reinstall) :D

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Raspberry Remote Control

Tue Oct 22, 2013 5:35 pm

Brill, I'll take it for a spin later. Unfortunaitally, due to a power cut, BOTH my pi's SD's ended up corrupted, (unlucky i know) so i've got to reflash them, so it'll be tomorrow before i can be bothered to start them up lol

--edit--
scratch that. had one up and running tonight just to test it, Dont know what was cooler, the app, or seeing my logo on my tablet :D lol
dan3008 wrote:Pays your money, takes your choice

User avatar
DougieLawson
Posts: 36571
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Remote Control

Fri Oct 25, 2013 12:35 pm

I've got the first code fix written.

Code: Select all

	public String ExecuteCommand(String command) {
		try {
			Log.d(TAG, "ExecuteCommand.try"); // LogCat logging for debugging
			String username = prefs.getString("sshusername", null);
			if (!username.equals("root")) {
				command = "sudo " + command;
			}
			Log.d(TAG, command);
That checks whether you've logged on a root (or something else like pi) and commands are prefixed with "sudo " if needed. (I don't discriminate one which commands get the prefix.)
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Other projects”