Notices


Reply
Thread Tools
danx's Avatar
Posts: 304 | Thanked: 20 times | Joined on Jan 2010 @ irvine
#21
Jeez this would be great to have, I would love to see the theifs face when he see me in the front door !!!
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#22
would gitorious be an option for you? I bet that someone can make a package from your scripts etc and add cron tasks via postinst script etc so that it would be simple one click install if you just ask.
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
Posts: 12 | Thanked: 5 times | Joined on Mar 2010
#23
hi,
no news about, I hope mr jvesiluoma has well ended his job and can takes time for all us. :-)
many thanks.
 
jvesiluoma's Avatar
Posts: 28 | Thanked: 58 times | Joined on Jan 2010
#24
Hello,

I promised to release instructions earlier, but there was some variables on the way. Well, here it finaly is. Sorry about the delay.

These are the steps needed to make everything work, most of the examples are run from command line, because I like to do things from there. Of course you can install these apps from application manager also. Scripts are pretty 'raw' because at first this was just my leisure project, but scripts work, thats the main thing right? =) There may be some errors, but just let me know about them and I'll try to fix them. Basicly this is just a compilation of different programs that are used via simple scripts.

When I first made this, there was not php5 package in repositories, so I found another way to do this (see section 3 Install PHP, url). I tried to install php5 from repositories and made this work, but didn't find pdo and pdo_sqlite modules for it. I had it working already, so didn't bother to research it very much, maybe someone knows how to install php5 package from repositories with pdo and pdo_sqlite modules? Anyway, the php-cgi and php.ini file that you need is inside the .zip file (see bottom of the post).

Feel free to make your own scripts and add them to your own interface. Hope you release your .php and/or .py scripts here too.



Okay, here is somekind of tutorial how to make this work (hopefully!).

1. Install rootsh
- from application manager

2. Install and configure lighttpd
- apt-get install lighttpd
- mkdir /var/log/lighttpd
- mkdir /var/www/passwd
- mkdir /var/www/htdocs
- when you install lighttpd, it automatically makes /wwwPHP folder, I prefer to move it away from there, it's up to you how you configure your server.
- edit following lines of /etc/lighttpd.conf - file:
o server.document-root = "/var/www/htdocs/" # Change and create to whatever you want, remember to change doc_root in php.ini to match this.
o server.errorlog = "/var/log/lighttpd/error.log" # for error logs
o accesslog.filename = "/var/log/lighttpd/access.log" # for access logs
o server.tag = "N900 WWW-interface server" # name of your web server
o server.port = 80 # You can also change this if you like, I prefer to keep my www-interface port to something else than 80, just remember to point your browser to a port you assign.
o #auth.backend = "plain" #comment this line
o #auth.backend.plain.userfile = "/etc/lighttpd.user" #comment this line
o Add folowing lines before "auth.require = ("
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/var/www/passwd/.htpasswd"
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "Quick share folder",
"require" => "valid-user"
)
)

- Now we have to make a password file above a line with "auth.backend.htpasswd.userfile = "/var/www/passwd/.htpasswd"" says where we store password.
* You can easily make a .htpasswd file here: http://www.htaccesstools.com/htpasswd-generator/
* Copy paste resulting text to a .htpasswd file and save it to /var/www/passwd/.htpasswd
o Copy .php and .html files (from .zip - file below) to a /var/www/htdocs/ - directory.
o Make shared folder to memory card, issue:
* mkdir /media/mmc1/www-share
* now make a symlink to that folder from your htdocs folder. As root, issue "ln -s /media/mmc1/www-share /var/www/htdocs/share".




3. Install PHP
- Copy files included in the .zip file to following locations:
* php-cgi ==> /usr/bin/php-cgi
* php.ini ==> /etc/php.ini
- php-cgi executable is from a .deb file from here: http://talk.maemo.org/showpost.php?p...4&postcount=19 , thanks jolouis

- php-cgi included in the .zip file includes necessary modules to read from sqlite database (calls and messages). php packages in repositories don't have these modules (as far as I know).


4. Install 'phone-control' for locking, taking photos etc.
- apt-get install phone-control
- Thanks to Mohammad ( http://maemo.org/packages/view/phone-control/ )




4. Install python-location for GPS to work via web interface.
- apt-get install python-location
- Link: http://wiki.maemo.org/PyMaemo/Using_Location_API


5. Install x11vnc to enable remote control of N900.
- apt-get install x11vnc

6. Install gstreamer-tools for taking photos with front / back camera.
- apt-get install gstreamer-tools


7. Start lighttpd
- as root, issue "lighttpd -f /etc/lighttpd.conf


To-Do:
* Clean and make contacs display nicer
* Add functionality, stop / start services etc (althought this is allready possible by issuing a custom command..)
* Improve GPS script
* Improve everything =)


And here is the .zip file that includes all the necessary files: http://www.vesiluoma.com/n900-www-interface-1.0.zip

To test it, point your N900 browser to 127.0.0.1 (if you changed your port to anything other than 80, point it to 127.0.0.1:## where ## is the port you assigned). You can also install a widget that shows your N900 ip-number on your devices desktop and check the interface from a desktop computer. And of course if you don't like to install any widgets, open terminal and issue 'ifconfig' and get your IP-address from there...or you can point your N900 browser to http://www.whatismyip.org/ and get your IP-address from there. Whatever suits you best. =)

Here is the blog post (same as this) http://www.vesiluoma.com/development...rol-interface/

Have fun!
__________________
JMV
www.jmv.fi
"Duct tape is like the Force. It has a light side, a dark side, and it holds the universe together...."

Last edited by jvesiluoma; 2013-08-22 at 11:12. Reason: Added more details to guide
 

The Following 14 Users Say Thank You to jvesiluoma For This Useful Post:
jvesiluoma's Avatar
Posts: 28 | Thanked: 58 times | Joined on Jan 2010
#25
And here is a modified get-location.py script, if you update get-location.py file with this, you get a google maps links to your (device) location. A little bit easier and faster to get your devices location.

It takes a while to get the location, so be patient after you click the GPS button from the interface...



Code:
#!/usr/bin/python

## Base version from http://wiki.maemo.org/PyMaemo/Using_Location_API
##
## Modified by JMV
## Version 1.01

import location
import gobject
import time
import sys

xi = 1

def on_error(control, error, data):
    print "location error: %d... quitting" % error
    data.quit()

def on_changed(device, data):
    global xi
    if not device:
        return
    if device.fix:
        xi = xi + 1
        if device.fix[1] & location.GPS_DEVICE_LATLONG_SET:
#            print "http://maps.google.com/maps?f=q&source=s_q&hl=fi&geocode=&q=E%f,+N%f&sll=37.0625,-95.677068&sspn=53.696917,114.169922&ie=UTF8&z=17""><b>maps.google.com</A>" % device.fix[4:6]
            sys.stdout.write('<A href="http://maps.google.com/maps?f=q&source=s_q&hl=fi&geocode=&q=E%f' % device.fix[5])
            sys.stdout.write(',+N%f&sll=37.0625,-95.677068&sspn=53.696917,114.169922&ie=UTF8&z=17""><b>maps.google.com</A>' % device.fix[4])
            print ""
#V1.0            print "http://maps.google.com/maps?f=q&source=s_q&hl=fi&geocode=&q=E%f" % device.fix[5],
#V1.0            print ",+N%f&sll=37.0625,-95.677068&sspn=53.696917,114.169922&ie=UTF8&z=17""><b>maps.google.com</A>" % device.fix[4]
            print "altitude = %f" % device.fix[7]
            print "horizontal accuracy: %f meters" % (device.fix[6] / 100)
            print "Satellites in view: %d, in use: %d" % (device.satellites_in_view, device.satellites_in_use)
            if xi == 10:
                loop.quit()

def on_stop(control, data):
    print "quitting"
    data.quit()

def start_location(data):
    data.start()
    return False

loop = gobject.MainLoop()
control = location.GPSDControl.get_default()
device = location.GPSDevice()
control.set_properties(preferred_method=location.METHOD_USER_SELECTED,
                       preferred_interval=location.INTERVAL_10S)
#control.set_properties(preferred_method=location.METHOD_AGNSS,
#                       preferred_interval=location.INTERVAL_1S)
control.connect("error-verbose", on_error, loop)
device.connect("changed", on_changed, control)
control.connect("gpsd-stopped", on_stop, loop)
gobject.idle_add(start_location, control)

loop.run()
__________________
JMV
www.jmv.fi
"Duct tape is like the Force. It has a light side, a dark side, and it holds the universe together...."
 

The Following 2 Users Say Thank You to jvesiluoma For This Useful Post:
Posts: 185 | Thanked: 62 times | Joined on Sep 2010 @ Veitshöchheim, Germany
#26
Okay i have some problems with it.

1. Once i installed ligthttpd, it created a folder /wwwPHP and i guess in your case, you have /var/www/ already. However, i just used the wwwPHP folder and continued with installation.

2. Lighttpd doesnt start at all (when i try to access it via browser, nothing comes up but i can ping my phone). I also tried to access it local via MicroB but it says same as Mozilla on my normal computer "cant establish a connection to the server at 127.0.0.1 (or 192.168.0.172)
 
Posts: 185 | Thanked: 62 times | Joined on Sep 2010 @ Veitshöchheim, Germany
#27
ok second issue solved.. had to start the server first (thought its going to start automatically) with the command "lighttpd -f /etc/lighttpd.conf"

next problem: always when i click on a menu, it wants to download the php file

Last edited by tebsu; 2010-11-04 at 15:14.
 
Posts: 185 | Thanked: 62 times | Joined on Sep 2010 @ Veitshöchheim, Germany
#28
okay got that php to work with this help: http://talk.maemo.org/showthread.php?t=62575

now everything works so far, the server, the php and i can access it. now, the major problem. the script doesnt work. i get "Parse error: syntax error, unexpected T_STRING in /wwwPHP/htdocs/messages.php on line 1" and so on. some functions like lock and ps-x work but not the calls, messages, front-cam (gives 404), contact and almost everything else on the commands page
 
jvesiluoma's Avatar
Posts: 28 | Thanked: 58 times | Joined on Jan 2010
#29
Originally Posted by tebsu View Post
ok second issue solved.. had to start the server first (thought its going to start automatically) with the command "lighttpd -f /etc/lighttpd.conf"

next problem: always when i click on a menu, it wants to download the php file
Yeah, sorry. Forgot to mention that on that small guide.. Have to add that. I'll update it after this post.


Originally Posted by tebsu View Post
okay got that php to work with this help: http://talk.maemo.org/showthread.php?t=62575

now everything works so far, the server, the php and i can access it. now, the major problem. the script doesnt work. i get "Parse error: syntax error, unexpected T_STRING in /wwwPHP/htdocs/messages.php on line 1" and so on. some functions like lock and ps-x work but not the calls, messages, front-cam (gives 404), contact and almost everything else on the commands page
I tried to install PHP via that guide also, but the problem is that that version does not have necessary modules for database access to work. So that explains why the calls.php and messages.php pages wont work. To fix it, use the php-cgi that is in the .zip file and make sure your lighttp.conf points to that php-cgi and you use the php.ini included in the .zip - file also.

Hmm, front-cam button tires to output the photo to /media/mmc1/www-share/ - directory. You can change this to be whatever you want in comm_imgfront.php, but I found a 'bug' in my guide. First make a directory (for example 'mkdir /media/mmc1/www-share') and than make a symlink to that directory from your htdocs folder, in your case 'ln -s /media/mmc1/www-share /wwwPHP/htdocs/share'. That should fix the front cam.

Hope this helps, just ask if you have more problems and I'll try to help.
__________________
JMV
www.jmv.fi
"Duct tape is like the Force. It has a light side, a dark side, and it holds the universe together...."
 
Posts: 185 | Thanked: 62 times | Joined on Sep 2010 @ Veitshöchheim, Germany
#30
nice, thanks for the good support. will try it out in some minutes
 
Reply


 
Forum Jump


All times are GMT. The time now is 16:30.