tomyvi / php-tracks-recorder Goto Github PK
View Code? Open in Web Editor NEWPHP front & backend for owntracks & overland payload
License: GNU General Public License v3.0
PHP front & backend for owntracks & overland payload
License: GNU General Public License v3.0
I get this error: Call to undefined method mysqli_stmt::get_result()
.
Here:
https://stackoverflow.com/questions/8321096/call-to-undefined-method-mysqli-stmtget-result
I read I miss a driver but cannot install drivers on my web host.
But isn't it easier to use PDO?
Would it be possible to add the TID to the Marker popup?
I have it tracking 3 phones and i'd like to know which one is which :)
I see a reference to map_points.php which is not in the repository. Very nice framework. How does the app get map data?
Thanks for posting this project. Great work.
My owntrack is only providing these fields:
{"batt":85,"lon":-71.xxxx,"acc":65,"p":100.028526,"vac":10,"lat":42.xxxx,"topic":"owntracks/mqtt/sjf_iphone","t":"u","conn":"w","tst":1541,"alt":100,"_type":"location","tid":"sf"}
and is missing these: cog, desc, event, rad. So database fails to write and code returns 500 to client.
It would be best to change the code so that each field is initialized to null/false/blank that way the db will write correctly if fields are not sent by client and won't fail.
I really like the idea of a self hosted server to gather the data, nice work.
I saw the #9 issue and it made me think if it would be possible to copy the Garmin GroupTrack feature and allow to see others on the watch or to navigate to them live.
If you think it would be feasible, I could maybe look into it.
Hi, I got the code to work. However, the record_log.txt shows an error about "duplicate location found for epoch". All of the time stamps are having the same number. Here is my config.inc.php:
`<?php
//RENAME TO config.inc.php
setlocale(LC_TIME, 'de_DE.utf8');
//overland / owntracks
$_config['recorder'] = 'owntracks';
// MySQL / MariaDB
$_config['sql_type'] = 'mysql';
$_config['sql_host'] = 'localhost';
$_config['sql_user'] = '***';
$_config['sql_pass'] = ****';
$_config['sql_db'] = '***';
$_config['sql_prefix'] = '';
// SQLite
//$_config['sql_type'] = 'sqlite';
//$_config['sql_db'] = 'owntracks.db3';
$_config['log_enable'] = True;
$_config['default_accuracy'] = 1000; //meters
$_config['default_trackerID'] = 'all';
$_config['geo_reverse_lookup_url'] = "http://193.63.75.109/reverse?format=json&zoom=18&accept-language=fr&addressdetails=0&[email protected]&";
$_config['geo_reverse_boundingbox_url'] = "http://nominatim.openstreetmap.org/reverse?format=json&osm_type=W&osm_id=";
?>`
I've tried different settings for setlocale(). Does not have any effects. I'm using the latest git version.
I would be happy for any support!
Best regards
Sven
Hey, i was trying to make something like this myself, but gave up when i found yours..
I'm trying to get it going but my client on Android isn't logging anything in the database.. it's also not returning any type of http code in the client status..
any ideas?
Edit : I've just found this in my php logs :
PHP Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in /var/www/html/maps/record.php:38\nStack trace:\n#0 {main}\n thrown in /var/www/html/maps/record.php on line 38
Edit 2: Fixed it.. you'r specifying a table called log_locations in record.php rather than using the prefix from the config.inc.php... i'll do a pull and fix that if you like?
Hey, i know you said you were working on this.. is that why there are documented geo location settings in the config or are they for something else?
I've set up php-tracks-recorder on my server. When visiting /record.php, I get this:
[{"_type":"cmd","action":"action","content":"No data to read"}]
In the Owntracks app (on iOS), I have setup 'Authentication' to 'off', and have the app point to /record.php on my server. The status as reported by the app is this:
error HTTP Response 500 The operation couldn't be completed (HTTP Response error 500) {}
If I switch to Overland, I do not get presented with any error messages, but, in Overland, the 'Last sent' does not change from 'n/a', and no data appears to come in to the recorder.
How to fix this?
I'm trying to start using your work but do have some problems.
There's link to map_points.php in header: <script src="./map_points.php?dateFrom ...
But in the git there is no such file ...
Any ideas what to do and how to get pass that?
Regards,
Martin
The UI looks so much better and more usable than the original Docker image. Too bad that this isn't available as a Docker image too!
The ability to track and display multi users on the front end interface, using the TID field sent in the payload by owntracks app.
Current state :
TID field data is already stored in database
Future state :
Backend :
To be implemented in dev branch
thanks for the tool. On your screenshot there is only the last waypoint seen as a marker. How can I choose to see more or less markers.
Hello. I configured php-tracks-recorder on my server, set up the database, and the front-end is working nicely (with a blank map since there's no data yet). However, no data is making it through. In OwnTracks, I have it configured to use HTTP connection, and it is set to be (obviously an example) "http://www.myserver.com/mydirectory/record.php" (with nothing entered under "Identification").
Under "Status," however, I get "HTTP status 200: JsonParseException" as the Endpoint Status Message. ("Idle" is the Endpoint state. in case that matters.)
At some point in the future, I hope to enable HTTPS and boost security, but for now I just want to troubleshoot and get it working, and I can't even get any data posted. What am I doing wrong?
I run your code on a my webhoster (strato). Unfortunatly I get an error while fetching the markers:
Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::get_result() in [SERVER]/lib/db/MySql.php:50 Stack trace: #0 [SERVER]/lib/db/AbstractDb.php(97): MySql->query('SELECT * FROM l...', Array) #1 [SERVER]/rpc.php(53): AbstractDb->getMarkers(1566856800, 1566943199, 500) #2 {main} thrown in [SERVER]/lib/db/MySql.php on line 50
I don't have much influence on the php-version / mysql-server, because it's a webhoster. Where could I dig into?
Thanks
Hello, i am getting this error when I open owntracks app and upload my position to server:
[Mon Feb 10 17:55:04.901548 2020] [:error] [pid 11687] [client xxxxx:63983] PHP Notice: Undefined variable: sql in /var/www/map/public_html/lib/recorder/OwntracksRecorder.php on line 114
[Mon Feb 10 17:55:04.901581 2020] [:error] [pid 11687] [client xxxxx:63983] PHP Fatal error: Uncaught Error: Call to a member function getFriends() on null in /var/www/map/public_html/lib/recorder/OwntracksRecorder.php:114\nStack trace:\n#0 /var/www/map/public_html/record.php(78): OwntracksRecorder->getFriendsLocation(Object(OwntracksRecordStructure))\n#1 {main}\n thrown in /var/www/map/public_html/lib/recorder/OwntracksRecorder.php on line 114
any idea what could be the cause ?
I am running on:
Apache/2.4.25 (Debian)
libmysql - mysqlnd 5.0.12-dev
PHP: 7.0.33-0+deb9u6
10.1.44-MariaDB-0+deb9u1 - Debian 9.11
also i've noticed maybe error on line 26 in record.php - there is .php twice
require_once('lib/db/MySqlPdo.php.php');
Btw great work :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.