eusonlito / GPS-Tracker

GPS Tracker platform for Sinotrack, Coban, Teltonika, Concox, Jimilab, OsmAnd and Queclink devices built with Laravel 11 + PHP 8.2 and MySQL 8. Plataforma GPS Tracker para dispositivos Sinotrack Sinotrack, Coban, Teltonika, Concox, Jimilab, OsmAnd y Queclink creada con Laravel 11 + PHP 8.2 y MySQL 8.
https://tracker-demo.lito.com.es/
MIT License
137 stars 62 forks source link

Syntax error or access violation: 1305 FUNCTION gpstracker.ST_Longitude does not exist #18

Closed bossmanpl closed 1 year ago

bossmanpl commented 1 year ago

Deployed your system on raspberry pi, all seems to work even in logs have seen my sinotrack 906 was sending gps coords.

But having problem on main and notification screen:

SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION gpstracker.ST_Longitude does not exist (Connection: mysql, SQL: select
`id`, `name`, `type`, `config`, `closed_at`, `sent_at`, `created_at`, `updated_at`,
`telegram`, `date_at`, `date_utc_at`,
`alarm_id`, `position_id`, `trip_id`, `vehicle_id`,
ROUND(ST_Longitude(`point`), 5) AS `longitude`, ROUND(ST_Latitude(`point`), 5) AS `latitude`
from `alarm_notification` where `vehicle_id` = 1 and `closed_at` is null order by `alarm_notification`.`id` desc)

in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Connection.php ](http://192.168.2.15/)(line 795)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Connection.php ](http://192.168.2.15/)-> runQueryCallback (line 755)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Connection.php ](http://192.168.2.15/)-> run (line 424)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php ](http://192.168.2.15/)-> select (line 2736)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php ](http://192.168.2.15/)-> runSelect (line 2724)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php ](http://192.168.2.15/)-> Illuminate\Database\Query\{closure} (line 3278)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php ](http://192.168.2.15/)-> onceWithColumns (line 2725)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php ](http://192.168.2.15/)-> get (line 717)
in [/var/www/html/gps/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php ](http://192.168.2.15/)-> getModels (line 701)
Builder->get()
in [/var/www/html/gps/app/Domains/Dashboard/Service/Controller/Index.php ](http://192.168.2.15/)(line 225)
            ->withAlarm()            ->withVehicle()            ->withPosition()            ->withTrip()            ->list()            ->get();    }}

Can you help me ?

Also is there a way to add new commands ?, i have 906 model which has a possibility to switch off engine, i would like to add it to system.

eusonlito commented 1 year ago

You need MySQL 8.0.12 or higher.

Commands are not fixed, you can write any command as message text.

bossmanpl commented 1 year ago

Installed version is sufficient:

MariaDB 10 (Localhost via UNIX socket) MariaDB Server version: 10.3.32-MariaDB - Source distribution Protocol ver: 10

Any other tips where i can search a problem ? Like i said, every other page in system works, only dashboard and notifications does not work (sql error)

eusonlito commented 1 year ago

MariaDB is not supported because GIS functions only included in MySQL 8.0.12 or higher. You should check the README requirements.

bossmanpl commented 1 year ago

Alright, so it seems you can close it. Thanks.