vitalidze / traccar-web

Traccar Web UI mod
http://traccar.litvak.su/
152 stars 145 forks source link

Traccar Web UI 3.7 can use with Traccar 3.8 ? #958

Open umikoyogi opened 7 years ago

umikoyogi commented 7 years ago

Please kindly advise how to use web mod on Traccar 3.8

vitalidze commented 7 years ago

I haven't tried it myself yet. You can try and report whether it works for you.

gpproton commented 7 years ago

Hi @vitalidze and @umikoyogi i tried it now although with Oracle DB but everything seem ok, but i'm performing some test to see if anything is wrong.

Fleetracking commented 7 years ago

Dear gpproton After an upgrade from 3.3 to 3.8 my web server didn't start (cf issue ). Do you have any advice regarding this issue, and how did you use "default.xml" and "traccar.xml" files, which one to configure for Mysql connection and update of DB scheme according to su gui procedure? BR

gpproton commented 7 years ago

HI @Fleetracking to get it to work i placed every other configuration in default.xml and database connection in traccar.xml , this is a sample below for your mysql connection.

Default.xml

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

true 8082 ./web old traccar-web.war true google true all ./logs/tracker-server.log false false false false false false false false com.mysql.jdbc.Driver jdbc:mysql://[HOST]:3306/[DATABASE]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode='' [USER] [PASSWORD] SELECT * FROM server UPDATE server SET registration = :registration, readonly = :readonly, map = :map, bingKey = :bingKey, mapUrl = :mapUrl, distanceUnit = :distanceUnit, speedUnit = :speedUnit, latitude = :latitude, longitude = :longitude, zoom = :zoom, twelveHourFormat = :twelveHourFormat, attributes = :attributes WHERE id = :id SELECT * FROM users WHERE email = :email SELECT id, login AS name, email, readOnly AS readonly, admin FROM users INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat, coordinateFormat, disabled, expirationTime, deviceLimit, token, attributes) VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat, :coordinateFormat, :disabled, :expirationTime, :deviceLimit, :token, :attributes) UPDATE users SET name = :name, email = :email, admin = :admin, map = :map, distanceUnit = :distanceUnit, speedUnit = :speedUnit, latitude = :latitude, longitude = :longitude, zoom = :zoom, twelveHourFormat = :twelveHourFormat, coordinateFormat = :coordinateFormat, disabled = :disabled, expirationTime = :expirationTime, deviceLimit = :deviceLimit, token = :token, attributes = :attributes WHERE id = :id UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id DELETE FROM users WHERE id = :id SELECT u.id AS userId, d.id AS deviceId FROM users u, devices d WHERE u.admin=1 UNION SELECT ud.users_id AS userId, ud.devices_id AS deviceId FROM users_devices ud INNER JOIN users u ON ud.users_id=u.id WHERE u.admin=0 AND u.readOnly=0 SELECT userId, groupId FROM user_group SELECT * FROM devices INSERT INTO devices (name, uniqueId, groupId, attributes, phone, model, contact, category) VALUES (:name, :uniqueId, :groupId, :attributes, :phone, :model, :contact, :category) UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId, attributes = :attributes, phone = :phone, model = :model, contact = :contact, category = :category WHERE id = :id UPDATE devices SET status = :status, lastUpdate = :lastUpdate WHERE id = :id; DELETE FROM devices WHERE id = :id DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId SELECT * FROM groups INSERT INTO groups (name, groupId, attributes) VALUES (:name, :groupId, :attributes) UPDATE groups SET name = :name, groupId = :groupId, attributes = :attributes WHERE id = :id DELETE FROM groups WHERE id = :id INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId) DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other) VALUES (:deviceId, :protocol, :now, :deviceTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes) SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime, valid, latitude, longitude, altitude, speed, course, address, other AS attributes FROM positions WHERE id IN (SELECT latestPosition_id FROM devices) UPDATE devices SET latestPosition_id = :id WHERE id = :deviceId; SELECT * FROM events WHERE id = :id INSERT INTO events (type, serverTime, deviceId, positionId, geofenceId, attributes) VALUES (:type, :serverTime, :deviceId, :positionId, :geofenceId, :attributes) SELECT * FROM events WHERE deviceId = :deviceId AND serverTime BETWEEN :from AND :to ORDER BY serverTime SELECT * FROM geofences INSERT INTO geofences (name, description, area, attributes) VALUES (:name, :description, :area, :attributes) UPDATE geofences SET name = :name, description = :description, area = :area, attributes = :attributes WHERE id = :id DELETE FROM geofences WHERE id = :id SELECT userId, geofenceId FROM user_geofence INSERT INTO user_geofence (userId, geofenceId) VALUES (:userId, :geofenceId) DELETE FROM user_geofence WHERE userId = :userId AND geofenceId = :geofenceId SELECT groupId, geofenceId FROM group_geofence INSERT INTO group_geofence (groupId, geofenceId) VALUES (:groupId, :geofenceId) DELETE FROM group_geofence WHERE groupId = :groupId AND geofenceId = :geofenceId SELECT deviceId, geofenceId FROM device_geofence INSERT INTO device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId) DELETE FROM device_geofence WHERE deviceId = :deviceId AND geofenceId = :geofenceId SELECT * FROM notifications INSERT INTO notifications (userId, type, attributes) VALUES (:userId, :type, :attributes) UPDATE notifications SET userId = :userId, type = :type, attributes = :attributes WHERE id = :id DELETE FROM notifications WHERE id = :id DELETE FROM positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM devices) SELECT * FROM attribute_aliases INSERT INTO attribute_aliases (deviceId, attribute, alias) VALUES (:deviceId, :attribute, :alias) UPDATE attribute_aliases SET deviceId = :deviceId, attribute = :attribute, alias = :alias WHERE id = :id DELETE FROM attribute_aliases WHERE id = :id SELECT * FROM statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime INSERT INTO statistics (captureTime, activeUsers, activeDevices, requests, messagesReceived, messagesStored, attributes) VALUES (:captureTime, :activeUsers, :activeDevices, :requests, :messagesReceived, :messagesStored, :attributes) true 150 true true true 2 5001 5002 5003 5004 5005 5006 false 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127
Fleetracking commented 7 years ago

Dear gpproton I tried to put as you described mysql DB connection parameters at "traccar.xml". And all other parameters at "default.xml" file, the connection problem persist : no connection to the traccar server ( no traccar opened port indicated by "netstat -l" command):

`<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

./conf/default.xml com.mysql.jdbc.Driver jdbc:mysql://127.0.0.1:3306/[DB]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes &characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES [USER] [PASSWORD] ` File "default.xml": ` true 80 /opt/traccar/web old /opt/traccar/traccar-web.war true google true all /opt/traccar/logs/tracker-server.log false false false false false false false false com.mysql.jdbc.Driver jdbc:mysql://127.0.0.1:3306/[DB]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes &characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES [USER] [PASSWORD] SELECT * FROM server UPDATE server SET registration = :registration, readonly = :readonly, map = :map, bingKey = :bingKey, mapUrl = :mapUrl, distanceUnit = :distanceUnit, speedUnit = :speedUnit, latitude = :latitude, longitude = :longitude, zoom = :zoom, twelveHourFormat = :twelveHourFormat, attributes = :attributes WHERE id = :id SELECT * FROM users WHERE email = :email SELECT id, login AS name, email, readOnly AS readonly, admin FROM users; INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelve HourFormat, coordinateFormat, disabled, expirationTime, deviceLimit, token, attributes) VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelv eHourFormat, :coordinateFormat, :disabled, :expirationTime, :deviceLimit, :token, :attributes) UPDATE users SET name = :name, email = :email, admin = :admin, map = :map, distanceUnit = :distanceUnit, speedUnit = :speedUnit, latitude = :latitude, longitude = :longitude, zoom = :zoom, twelveHourFormat = :twelveHourFormat, coordinateFormat = :coordinateFormat, disabled = :disabled, expirationTime = :expirationTime, deviceLimit = :deviceLimit, token = :token, attributes = :attributes WHERE id = :id UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id DELETE FROM users WHERE id = :id SELECT u.id AS userId, d.id AS deviceId FROM users u, devices d WHERE u.admin=1 UNION SELECT ud.users_id AS userId, ud.devices_id AS deviceId FROM users_devices ud INNER JOIN users u ON ud.users_id=u.id WHERE u.admin=0 AND u.readOnly=0 SELECT userId, groupId FROM user_group SELECT * FROM devices INSERT INTO devices (name, uniqueId, groupId, attributes, phone, model, contact, category) VALUES (:name, :uniqueId, :groupId, :attributes, :phone, :model, :contact, :category) UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId, attributes = :attributes, phone = :phone, model = :model, contact = :contact, category = :category WHERE id = :id UPDATE devices SET status = :status, lastUpdate = :lastUpdate WHERE id = :id; DELETE FROM devices WHERE id = :id DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId SELECT * FROM groups INSERT INTO groups (name, groupId, attributes) VALUES (:name, :groupId, :attributes) UPDATE groups SET name = :name, groupId = :groupId, attributes = :attributes WHERE id = :id DELETE FROM groups WHERE id = :id INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId) DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other) VALUES (:deviceId, :protocol, :now, :deviceTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attri butes); SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime, valid, latitude, longitude, altitude, speed, course, address, other AS attributes FROM positions WHERE id IN (SELECT latestPosition_id FROM devices); UPDATE devices SET latestPosition_id = :id WHERE id = :deviceId; SELECT * FROM events WHERE id = :id INSERT INTO events (type, serverTime, deviceId, positionId, geofenceId, attributes) VALUES (:type, :serverTime, :deviceId, :positionId, :geofenceId, :attributes) SELECT * FROM events WHERE deviceId = :deviceId AND serverTime BETWEEN :from AND :to ORDER BY serverTime SELECT * FROM geofences INSERT INTO geofences (name, description, area, attributes) VALUES (:name, :description, :area, :attributes) UPDATE geofences SET name = :name, description = :description, area = :area, attributes = :attributes WHERE id = :id DELETE FROM geofences WHERE id = :id SELECT userId, geofenceId FROM user_geofence INSERT INTO user_geofence (userId, geofenceId) VALUES (:userId, :geofenceId) DELETE FROM user_geofence WHERE userId = :userId AND geofenceId = :geofenceId SELECT groupId, geofenceId FROM group_geofence INSERT INTO group_geofence (groupId, geofenceId) VALUES (:groupId, :geofenceId) DELETE FROM group_geofence WHERE groupId = :groupId AND geofenceId = :geofenceId SELECT deviceId, geofenceId FROM device_geofence INSERT INTO device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId) DELETE FROM device_geofence WHERE deviceId = :deviceId AND geofenceId = :geofenceId SELECT * FROM notifications INSERT INTO notifications (userId, type, attributes) VALUES (:userId, :type, :attributes) UPDATE notifications SET userId = :userId, type = :type, attributes = :attributes WHERE id = :id DELETE FROM notifications WHERE id = :id DELETE FROM positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM devices) SELECT * FROM attribute_aliases INSERT INTO attribute_aliases (deviceId, attribute, alias) VALUES (:deviceId, :attribute, :alias) UPDATE attribute_aliases SET deviceId = :deviceId, attribute = :attribute, alias = :alias WHERE id = :id DELETE FROM attribute_aliases WHERE id = :id SELECT * FROM statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime INSERT INTO statistics (captureTime, activeUsers, activeDevices, requests, messagesReceived, messagesStored, attributes) VALUES (:captureTime, :activeUsers, :activeDevices, :requests, :messagesReceived, :messagesStored, :attributes) 5001 5002 5003 5004 5005 5006 false 5007 5008 5009 5010 5011 5012 5013 600 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 `
Fleetracking commented 7 years ago

Hi Problem resolved folowing Tananev suggestion . In fact, a reinstalled traccar and after that i adapted only "traccar.xml" file including DB connection parameters. No changes for "default.xml" file. BR

vitalidze commented 7 years ago

I have just posted installation instructions for 3.8: http://traccar.litvak.su/installation.html