Networking 2
Tuesday, December 21, 2010
Powerpoint
My presentation is at http://rmdir.org/Net.pptx . This gives you a description of the entire project.
Tuesday, November 30, 2010
Update on the project
So yesterday I was cleaning up things with the program and decided that it was worthy of being on my phone(the Original DROID), so I signed a package and copied it over. To my surprise, everything works perfectly, on WiFi and 3G. Usually when you copy over to a program to a specific device, something doesn't work for no apparent reason, at least thats my experience with the android platform. But I used the techniques that I have used in the past and things seemed to work fine. I also opened the server up to the outside so that you can access the data and manipulate it. There is one issue with this that I haven't resolved, and likely wont have time to. That is security. I really need to make it so the only way you can access these files is if you login somehow, which you can do through apache, or php sessions/cookies, but I decided that with the time constraints and the fact that no one knows any of my naming schemes that for the moment I will be safe. And the worst thing that can happen, at the moment, is if someone figures it out they can mess up a sever that runs this program specifically.
Well this is all for now, considering I cant sleep and my stomach is killing me. So now I have the ability to mess with my php bot all with my phone.
Monday, November 22, 2010
Working App
So I have been working on the app for the past couple of days and I have made a lot of progress. The app has the ability to update the settings of the bot, start and stop it, which works OK, but sometimes the servers wont let you connect for stupid reasons so it can be hit and miss. Beyond that you can get the settings by hitting the links on the menu. I'm going to move all the commands to the menu I believe, I think ill also move the run a command dialog to its own class. Here is what it looks like at the moment.
\


Wednesday, November 17, 2010
Update with pictures!
Tuesday, November 16, 2010
Update on the Bot
I successfully got the bot running all on its own. It starts with a web script and you can kill it with a web script. Now there is more that I want to do with this, but this is a start. Now I am going to try to make a android app that can start and stop the script.
Start script:
shell_exec("/usr/bin/php /var/www/bot.php & ");
echo "Bot Started Successfully";
Stop Script: (some code is borrowed from the php manual thanks to Ashraf M Kaabi)
function kill($PID){
if(is_running($PID)){
exec("kill -KILL$PID");
return true;
}else return false;
}
function is_running($PID){
exec("ps $PID", $ProcessState);
return(count($ProcessState) >= 2);
}
$output = shell_exec("ps | grep php | awk '{print $1}'");
if ($output != null) {
kill($output);
echo "Killed process id:/" $output /"";
} else {
echo "Output Null";
}
Networking 2 Project - Whats been done so far.
For my networking 2 project I am making a php bot that can be controlled remotely by an android application. So far what I have done is the following.
1. Created a virtual machine that was running Ubuntu 10.10
2. Created the bot PHP script and linked it to MySQL to log all the data, maybe for future use.
3. Migrated to a hardware server.
4. Created an app as proof that the idea can pull information from the database.
What I started today:
1. Started to look into starting the php script from command line like so:
/usr/bin/php /var/www/bot.php &
2. Now that it can be run from command line I am going to make a script that can be run to kill the bot and one that can be run to start the bot all from a web site.
I have decided that the core of this project is that the scripts will reside on the server side and the App will likely just trigger remote scripts. I am doing this because it is really hard to get the Android device to run the necessary things to interface with my scripts.
Also found this which will be helpful for me soon.
"if this is UNIX then you can do an exec() or system() call or something like
`./executethisfile > out.log &` "
`./executethisfile > out.log &` "
Subscribe to:
Posts (Atom)






