marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Fri Jan 06, 2012 8:48 pm

do you have an iphone / android app lol. not at my computer and using an samsung g3.

which has an v6 arm processor. capable of running debian. should be fun.

Is there a Rpi emu Too lazy to search.
When i get my netbook back off friend i will happily test windows and linux for you.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Fri Jan 06, 2012 8:59 pm

Great stuff. Thanks marc

There is a way to get qemu to emulate arm and the Pi I think. You'd have to search the forums though.

The only problem with distributing my Java program at the moment is that it needs to be run as root because (fdisk -l) to list disks wont be available to a standard user. So it will need to be run as root for testing (for now). Will get it all working first and then worry about distributing it

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Fri Jan 06, 2012 9:05 pm

Simple fix. On the root.

sudo fdisk-l in the code it will popup admin login password. Also won"t need root password just user pass as su stands for Super User and grants root access to standard user when used in that way.

Tomo2k
Posts: 127
Joined: Mon Dec 19, 2011 10:00 pm

Re: PiCard - GUI SD Preparation Tool

Fri Jan 06, 2012 9:23 pm

Excellent work!

Some "safety" that I think would be useful:

1) When listing the devices, if the target already has any filesystem recognised by the host computer, it would be great if it could show the partition label(s) of the devices as well.
- This will make it easier for the user to select the right "blank" card.

2) It should auto-select the smallest capacity device discovered, as that is most likely to be the SD Card and is least likely to be an important device on the host computer.

3) Devices bigger than 32GB (max. SDHC card size) should not be listed by default.
- The user can click a button to show them, labelled something like "My SDXC Card is bigger than 32GB".
- Again, the host computer hard drive is very likely to be bigger than 32GB (with Windows XP and newer its practically certain!), and SDXC cards >32GB are still fairly rare and expensive – more than an RPi!

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Fri Jan 06, 2012 9:28 pm

Great suggestions. I'll probably order them smallest first too. I don't think anything larger than 32gig is supported anyway. Yeah that was the next step. Have to run mount on Unix and Mac and run some diskpart commands on windows to get the mount points.

I think I'll wait a bit to release for testing as there isn't really anything to test yet . That's enough work for tonight though! More tomorrow at some point.

Cheers,

Liam.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 8:20 pm

Well if your using someone elses computer to flash your card it does need to be idiot proof.

Especially when most people don"t think to or know how to do an incremental backup of their system state on regular occaisions.

or indeed able to restore an image after they made the image. Supposed to store on either external hdd or dvd. But most people store on local disk and when sector 0 gets zapped all partitions are useless.

Sad but true. qemu and dsl (damn small linux) or puppy or equivlent could be a way to do things hassel free? using fdisk-l to get partition list will bring up unmounted volumes as well as mounted ones.

Just a suggestion for the linux program. Find another way to list mounted devices, incorp into livecd/liveusb small distro which won"t mount native system volumes and will only mount what you want it too.

Can work on win machine.

Don"t know what to do about mac os but users of mac for most part are familiar with hdd and partitions.

I could make as small liveiso as possible just to run pi card prep tool. if anyone is interested and could host a mirror or primary download of it.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 8:26 pm

Hi marc. I'm pretty busy at the moment with college work and stuff... plus trying to get this Java release going. Maybe bradburts is the one to talk to about a livecd because he initially wanted to go down that route. I'm sure he'll read this as it's his thread

About VM's... Initially my idea was to have a linux only version that was coded in python and run in virtualbox. However, it was pointed out that internal card readers wouldn't work with that... and also some usb readers might not connect.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 8:39 pm

Cool. Keep up your school work its important.

All i am offering is liveiso as small as i can get it to run your software. As a way for novice users to flash an sdcard without fear they will damage their 300+ home pc and have to call someone like me to come fix it. btw it costs 30-45 to reinstall a pc.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 8:49 pm

marc said:


Cool. Keep up your school work its important.

All i am offering is liveiso as small as i can get it to run your software. As a way for novice users to flash an sdcard without fear they will damage their 300+ home pc and have to call someone like me to come fix it. btw it costs 30-45 to reinstall a pc.



Yeah I take your point. I'm having so many issues at the moment with the development. The app requires you to be as admin/root beause DD for windows and all of the disk commands need it... On xp - you need to run as an admin... check for that and error message if your not admin. 1 down.

Mac and Linux - start with sudo (graphical version)... not tested but implemented.

Windows Vista and above - Run java binary with UAC... and works fine...? Nope not at all. Command execution doesn't return stdout anymore... Never noticed because I disabled UAC years ago.

Working on a fix...

Also, mac osx lion is throwing some kind of java error related to objective C but after continuing it seems to work fine. Something to do with the swing gui libary I think

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 9:03 pm

Wow seems like a pickle.

maybe run it in xp mode as admin? on vista / seven

can"t understand error on mac lion.

so linux is running sudo command or on run sudo su?

psst. I will make the iso anyway as another option this will in no way effect your hard work on the program as it will still be using your program to flash the sd card. just be in a bubble

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 9:11 pm

marc said:


Wow seems like a pickle.

maybe run it in xp mode as admin? on vista / seven

can"t understand error on mac lion.

so linux is running sudo command or on run sudo su?

psst. I will make the iso anyway as another option this will in no way effect your hard work on the program as it will still be using your program to flash the sd card. just be in a bubble



Sounds great marc . If I can't find a way around it I might just have to get the user to disable UAC but I'm pretty sure it must be possible... just depends on how much work it will be... What do you think?


marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 9:38 pm

Last time i am going to edit a post in html!
buggy.

archive.msdn.microsoft.com/elevatedprivilegeuac

Theres the full link again for uac programing with link to code if its useful to you.

Asking end users to disable any security features is a bad idea and risky too. if they already have got rid of that pesky popup and allowed their other security software such as norton take over etc there is no problem. in either case uac needs to be supported on a wide distro.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 9:50 pm

Direct link to source code for uac

http://www.devzest.com/blog/po.....geUAC.aspx

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 9:54 pm

Yeah I guess you are right... it should be something easy.

The best way I can come up with is output it to a file and then read that back. The actual java app will not run as administrator... but it's child processes will display a UAC prompt. It's a bit messy but it works. Let's be honest - the nature of the task was never going to allow a pretty perfect solution.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:04 pm

Spank the parent lol.

Sure who cares if it asks for uac password during process as long as it does what it needs to unhindred by the uac.

Of course linux is easier. 50mb iso sounds good.

just finished building an 12v to 5v circuit to run rpi on 8 1.5 AA cells. And picked up 15.4" hd tv for 35 quid. just need mini kb with trkmouse on usb unless can get it to work wirelessly.

Then the final componant when released. I could use a setup like this for the POS s.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:08 pm

I've had enough for tonight but at least I know how to do that now... this should all be a lot easier than it has been. Once I have all this down the foundations are there and fairly robust.

Time for a beer.

Cheers marc,

Liam.

P.S That source code looks great but it's not for Java... and the way I execute a process has to be specific because I need to capture the output. Thanks anyway though

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:11 pm

I did realise that but some code is generic once you have translated it.

3+3= err 33

Tomo2k
Posts: 127
Joined: Mon Dec 19, 2011 10:00 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:14 pm

Liam Fraser said:

The actual java app will not run as administrator... but it's child processes will display a UAC prompt. It's a bit messy but it works. Let's be honest - the nature of the task was never going to allow a pretty perfect solution.
Well, that's the way it should be - there is no excuse these days for a program that must be "run as administrator" to work.

As it needs low-level hardware access, then it's always going to need promoting to admin, and the UAC popup is the approved way to do it.

There are better ways to pass the data back and forth. The easiest cross-platform method is to send a UDP packet to 127.0.0.1, as the 'proper' way is different between platforms.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:21 pm

The way I'm having to do it is to elevate a command prompt which will run a batch script that executes the command I want and pipes the output. Don't want to start doing networking from a batch script.

To be honest I don't have the time to do that! I'll definitely try my best to tidy this all up in future versions of course. Eventually I'll turn my batch script into a completely seperate program (native) and use UDP or something similar to communicate between it and the Java app.

Mac is fine as long as you are running as one of their admin group. Linux - I'm going to gksudo the whole java app (Gparted and Synaptic do it... so will i )

@Marc - Circuit sounds good will be interesting to hear about battery life on that!

and yeah Java is a bit of a special case when it comes to code. Because it runs in it's own virtual machine, code that is platform specific is a bit harder to do.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:37 pm

Expecting depletion of individual cells to deplete below 1.0v as 4 AA will stop working at 1.2v for a 5v circuit battery total will drop below 5v.

1.0 v is what most devices stop working on depending on circuit. Then you need a jeule theif to get them down to 0.3v.

This circuit gets them down to 0.6v so they last longer than using just 4+4.

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sat Jan 07, 2012 10:41 pm

charging android phone off it atm.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sun Jan 08, 2012 12:55 pm

marc said:


charging android phone off it atm.



Sounds good mate ! Fixed the UAC problem after a good night of sleep... Came up with a bat script to execute the Jar file under UAC and it works great . Works on every PC and account I have in the house. All with UAC enabled and works great on the ones without it too !

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Sun Jan 08, 2012 7:01 pm

Great stuff. Sounding more like patchwork programming rather than modular lol not that its a bad thing.

Your doing well with mixing different languages to make something work its a rare trait i see in people these days.

Hopefully gettting netbook back later or tomorrow so can start work on single app distro for liveiso. Its not as simple as one thinks.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Sun Jan 08, 2012 7:31 pm

Thanks marc. It's always going to be a little messy but it's working out okay so far. Yeah I can imagine! Will be interesting to see what you come up with. What distro will you base it on? Also it will need java and parted (any obviously any dependencies)... might be nice to include GParted for people wanting to manually partition the image themselves (an option unique only to Linux version)

Return to “Other projects”