GithubHelp home page GithubHelp logo

googlemaps / transport-tracker Goto Github PK

View Code? Open in Web Editor NEW
568.0 84.0 439.0 8.45 MB

Applications for tracking moving assets on a live map

License: Apache License 2.0

HTML 2.72% JavaScript 46.85% Java 20.81% CSS 7.37% Makefile 0.44% Python 21.46% Dockerfile 0.34%
bus

transport-tracker's Introduction

NOTE: This demo application is no longer functional as it has multiple dependencies that must be updated.

Google Transport Tracker

Google Transport Tracker is a set of applications designed to track a range of moving assets (such as vehicles) and visualize them on a live map. The applications use a mixture of technologies - Android, Firebase, Google Maps, GTFS (General Transit Feed Specification), and more.

Note: This application implements asset tracking. For use in a production environment, you therefore need a Google Maps APIs Premium Plan license. For more information, see the Google Maps APIs terms of service.

Overview

This is the open source release for the I/O Bus Tracker.

The repository consists of a number of components, representing the individual moving parts of the bus tracking system. It includes an Android app, in /android, that's installed on Android devices and deployed on the tracked vehicles, along with a matching administration UI in /admin.

The repo also contains the display side of the system, designed to drive 60" LCD TVs. There is /backend, written in Node.js and running on Google Compute Engine, which receives the locations reported by the Android app, along with a time table provided in GTFS format, and makes regular updates to a Firebase Real Time Database. The client in /map receives the updates from the Firebase database and draws them on the LCD TV.

Getting started

See the developer documentation.

Directories in this repo

The project contains the following subdirectories, each housing a single component:

admin

A web interface for administrators to see a quick overview of all the assets being tracked.

android

The Android app that resides with each asset to be tracked. Once configured, this app keeps its location synced with Firebase, and reports on other metrics, such as battery life.

backend

The server-side component that manages the state of the Firebase database. For a tutorial on this component, please see Transport Tracker Backend codelab

map

The public web interface that displays schedule information and asset locations. For a tutorial on this component, please see Transport Tracker Map codelab

This is not an official Google product.

transport-tracker's People

Contributors

domesticmouse avatar jpoehnelt avatar sarahmaddox avatar stephenmcd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transport-tracker's Issues

Deleting Child in raw-bus-location after 10 seconds

I'm trying to delete child (Trip) in raw-bus location (Firebase) after 10 seconds. But getting errors in code, still learning node js. Any help is much appreciated.

exports.DeleteChild = class {
constructor(timeRef, rawBusLocationsRef, cutoff, oldItemsQuery ){
this.timeRef = timeRef;
this.rawBusLocationsRef = rawBusLocationsRef;
this.cutoff = cutoff;
this.oldItemsQuery = oldItemsQuery;

// Change the panel once every ten seconds
this.timeTimerId = setInterval(() => {
  this.deleteChild();
}, 10000);

}

deleteChild(){
this.cutoff = this.timeRef - 10000;
this.oldItemsQuery = this.rawBusLocationsRef.orderByChild('timestamp').endAt(this.cutoff);
return this.oldItemsQuery.once('value').then((snapshot) => {
// create a map with all children that need to be removed
const updates = {};
snapshot.forEach(child => {updates[child.key] = null;});
// execute all updates in one go and return the result to end the function
return this.rawBusLocationsRef.update(updates);
});
}};

and the error is:

/*

  • Error: Query.endAt failed: first argument contains NaN in property 'raw-bus-location'
    at validateFirebaseData (/home/maphilak/server4r/node_modules/@firebase/database/dist/index.nod
    e.cjs.js:1443:15)
    at validateFirebaseDataArg (/home/maphilak/server4r/node_modules/@firebase/database/dist/index.
    node.cjs.js:1421:5)
    at Query.endAt (/home/maphilak/server4r/node_modules/@firebase/database/dist/index.node.cjs.js:
    4985:9)
    at exports.DeleteChild.deleteChild (/home/maphilak/server4r/delete_child.js:23:74)
    at Timeout.timeTimerId.setInterval [as _onTimeout] (/home/maphilak/server4r/delete_child.js:16:
  1. at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] main: node main.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] main script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/maphilak/.npm/_logs/2018-11-30T10_50_04_443Z-debug.log
    */

Map is not coming in my setup

Hi Their,

I have setup the backend and map application on my server. Both applications are running fine. But when i am seeing the map application, i am only seeing the html part. Nothing is happening their. Below is the URL where i setup my application. Can you please help me identifying the error which i am making.
http://35.162.108.80:8080/

error when try to "npm install" on backend ?

Hi
Please i try to run this project on my windows 10 laptop so i have create firebase account and added data in the json file as read me file and when i try "npm install" on backend folder i got this erros:

[email protected] install D:\Trans\backend\node_modules\fibers
node build.js || nodejs build.js
D:\Trans\backend\node_modules\fibers>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
fibers.cc
coroutine.cc
win_delay_load_hook.cc
d:\trans\backend\node_modules\fibers\src\fibers.cc(464): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [D:\Trans\backend
node_modules\fibers\build\fibers.vcxproj]
c:\users\ahmed amin.node-gyp\11.1.0\include\node\v8.h(2991): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
d:\trans\backend\node_modules\fibers\src\fibers.cc(686): error C2660: 'v8::Script::Compile': function does not take 1 arguments [D:\Trans\backend\node
_modules\fibers\build\fibers.vcxproj]
c:\users\ahmed amin.node-gyp\11.1.0\include\node\v8.h(1359): note: see declaration of 'v8::Script::Compile' (compiling source file ..\src\fibers.cc
)
d:\trans\backend\node_modules\fibers\src\fibers.cc(701): error C2660: 'v8::TryCatch::StackTrace': function does not take 0 arguments [D:\Trans\backend
\node_modules\fibers\build\fibers.vcxproj]
c:\users\ahmed amin.node-gyp\11.1.0\include\node\v8.h(8872): note: see declaration of 'v8::TryCatch::StackTrace' (compiling source file ..\src\fibe
rs.cc)
d:\trans\backend\node_modules\fibers\src\fibers.cc(701): error C2672: 'uni::Reset': no matching overloaded function found [D:\Trans\backend\node_modul
es\fibers\build\fibers.vcxproj]
d:\trans\backend\node_modules\fibers\src\fibers.cc(701): error C2780: 'void uni::Reset(v8::Isolate *,v8::Persistent<T,v8::NonCopyablePersistentTraits<
T>> &,v8::Local)': expects 3 arguments - 2 provided [D:\Trans\backend\node_modules\fibers\build\fibers.vcxproj]
d:\trans\backend\node_modules\fibers\src\fibers.cc(126): note: see declaration of 'uni::Reset'
d:\trans\backend\node_modules\fibers\src\coroutine.cc(138): warning C4552: '!': result of expression not used [D:\Trans\backend\node_modules\fibers\bu
ild\fibers.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd D:\Trans\backend\node_modules\fibers
gyp ERR! node -v v11.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: sudo apt-get install g++ build-essential
Alpine users please run: sudo apk add python make g++
'nodejs' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node build.js || nodejs build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

so please how can i fix that ?

Error while running backend

I am setting up backend, after running npm run main I am getting below error:

at Array.map ()
at _await.panelConfig.map.panel (D:\projects\transport-tracker\backend\time_table.js:61:35)
at Array.map ()
at exports.TimeTable.publishTimeTables (D:\projects\transport-tracker\backend\time_table.js:58:24)
at _async (D:\projects\transport-tracker\backend\time_table.js:45:16)
at tryBlock (D:\projects\transport-tracker\backend\node_modules\asyncawait\src\async\fiberManager.js:39:33)
at runInFiber (D:\projects\transport-tracker\backend\node_modules\asyncawait\src\async\fiberManager.js:26:9)
TypeError: Cannot read property 'legs' of undefined
at exports.TimeTable.tripsLookup (D:\projects\transport-tracker\backend\time_table.js:122:23)
at left.panel.routesGroups.(anonymous function).map.route_id (D:\projects\transport-tracker\backend\time_table.js:62

Pls help

Will it run in background?

Will it run in background? (i.e) will the tracking persist even when the app is swipe closed from app switcher?

Integrating Real Bus Data

Hello @domesticmouse , I am following the google transport tracker tutorial as well, and I would like to use the real bus location data. I have the android app set up following this , and I have changed this to "simulation": false. The part where I'm stuck is here;
if (trackerConfig.simulation) {
const {BusSimulator} = require('./bus_simulator.js');
const generatedPaths = require('./paths.json');
new BusSimulator(timeRef, gtfs, busLocationsRef, generatedPaths);
} else {
// Exercise for the reader: integrate real bus location data
}

andriod project doesnt compile

Error:Execution failed for task ':app:processDebugGoogleServices'.

File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
D:\src\transport-tracker\android\app\src\debug\google-services.json
D:\src\transport-tracker\android\app\google-services.json

[Feature Request]: Support for React Native & Flutter .

I am working on an app that deals with tracking of vehicle & showing them in mobile devices & web app . can you guys please provide support for it to use it in react native, react & flutter. Or provide me with some help how to bridge it in React Native.

unable to android tracker app

On UI it keep saying Connecting
and here LogCat

Please help me to findout, whats wrong with it

11-21 01:06:05.889 4951-4971/com.google4.transporttracker V/FA: Inactivity, disconnecting from the service
11-21 01:06:10.107 4951-4991/com.google4.transporttracker I/FirebaseCrash: Sending crashes
11-21 01:06:30.728 4951-4974/com.google4.transporttracker W/InstanceID/Rpc: No response
11-21 01:06:30.730 4951-4974/com.google4.transporttracker D/FirebaseInstanceId: background sync failed: TIMEOUT, retry in 10s
11-21 01:07:10.756 4951-4995/com.google4.transporttracker W/InstanceID/Rpc: No response
11-21 01:07:10.757 4951-4995/com.google4.transporttracker D/FirebaseInstanceId: background sync failed: TIMEOUT, retry in 20s
11-21 01:08:10.614 4951-5000/com.google4.transporttracker W/InstanceID/Rpc: No response
11-21 01:08:10.615 4951-5000/com.google4.transporttracker D/FirebaseInstanceId: background sync failed: TIMEOUT, retry in 40s
11-21 01:08:56.958 4951-5003/com.google4.transporttracker D/FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 80s
11-21 01:10:20.611 4951-5016/com.google4.transporttracker D/FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 160s

que

please help me to solve this error

Error: Cannot find module './gtfs.js'

Can not launch backhend "npm install" transport tracker

Hello,

I have a big mistake throwing the npm run hand.

First of all I run an install npm with the current version of node and npm and here are the errors I had:

root@**********:/var/www/html/backend# npm install
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.

> [email protected] install /var/www/html/backend/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v67-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v67-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI) (falling back to source compile with node-gyp) 
make: Entering directory '/var/www/html/backend/node_modules/sqlite3/build'
make: Entering directory '/var/www/html/backend/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  TOUCH Release/obj.target/deps/action_before_build.stamp
Release/obj.target/deps/action_before_build.stamp Stats {
  dev: 2049,
  mode: 33188,
  nlink: 1,
  uid: 0,
  gid: 0,
  rdev: 0,
  blksize: 4096,
  ino: 794068,
  size: 0,
  blocks: 0,
  atimeMs: 1553161469000,
  mtimeMs: 1553161469000,
  ctimeMs: 1553161469860,
  birthtimeMs: 1553161469860,
  atime: 2019-03-21T09:44:29.000Z,
  mtime: 2019-03-21T09:44:29.000Z,
  ctime: 2019-03-21T09:44:29.860Z,
  birthtime: 2019-03-21T09:44:29.860Z }
Release/obj.target/deps/action_before_build.stamp Stats {
  dev: 2049,
  mode: 33188,
  nlink: 1,
  uid: 0,
  gid: 0,
  rdev: 0,
  blksize: 4096,
  ino: 794068,
  size: 0,
  blocks: 0,
  atimeMs: 1553161469000,
  mtimeMs: 1553161469000,
  ctimeMs: 1553161469864,
  birthtimeMs: 1553161469864,
  atime: 2019-03-21T09:44:29.000Z,
  mtime: 2019-03-21T09:44:29.000Z,
  ctime: 2019-03-21T09:44:29.864Z,
  birthtime: 2019-03-21T09:44:29.864Z }
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw Stats {
  dev: 2049,
  mode: 33188,
  nlink: 1,
  uid: 0,
  gid: 0,
  rdev: 0,
  blksize: 4096,
  ino: 922088,
  size: 119,
  blocks: 8,
  atimeMs: 1553161563000,
  mtimeMs: 1553161563000,
  ctimeMs: 1553161563816,
  birthtimeMs: 1553161563816,
  atime: 2019-03-21T09:46:03.000Z,
  mtime: 2019-03-21T09:46:03.000Z,
  ctime: 2019-03-21T09:46:03.816Z,
  birthtime: 2019-03-21T09:46:03.816Z }
./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw Stats {
  dev: 2049,
  mode: 33188,
  nlink: 1,
  uid: 0,
  gid: 0,
  rdev: 0,
  blksize: 4096,
  ino: 922088,
  size: 119,
  blocks: 8,
  atimeMs: 1553161563000,
  mtimeMs: 1553161563000,
  ctimeMs: 1553161563824,
  birthtimeMs: 1553161563824,
  atime: 2019-03-21T09:46:03.000Z,
  mtime: 2019-03-21T09:46:03.000Z,
  ctime: 2019-03-21T09:46:03.824Z,
  birthtime: 2019-03-21T09:46:03.824Z }
sed: can't read ./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw: No such file or directory
  AR(target) Release/obj.target/deps/sqlite3.a
rm: cannot remove './Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw': No such file or directory
deps/sqlite3.target.mk:129: recipe for target 'Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o' failed
make: *** [Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o] Error 1
make: Leaving directory '/var/www/html/backend/node_modules/sqlite3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 3.16.0-7-amd64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64"
gyp ERR! cwd /var/www/html/backend/node_modules/sqlite3
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/www/html/backend/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:988:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Linux 3.16.0-7-amd64
node-pre-gyp ERR! command "/usr/local/bin/node" "/var/www/html/backend/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/www/html/backend/node_modules/sqlite3
node-pre-gyp ERR! node -v v11.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64' (1)
  COPY Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/database.o
In file included from ../src/database.h:10:0,e [email protected]~install: Failed to exec install script
                 from ../src/database.cc:4:
../../nan/nan.h:148:53: fatal error: nan_callbacks.h: No such file or directory
compilation terminated.
Cannot create temporary file in /var/www/html/backend/node_modules/sqlite3/: No such file or directory
node_sqlite3.target.mk:121: recipe for target 'Release/obj.target/node_sqlite3/src/database.o' failed
make: *** [Release/obj.target/node_sqlite3/src/database.o] Aborted
make: Leaving directory '/var/www/html/backend/node_modules/sqlite3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 3.16.0-7-amd64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/var/www/html/backend/node_modules/sqlite3/lib/binding/node-v67-linux-x64"
gyp ERR! cwd /var/www/html/backend/node_modules/sqlite3
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-21T09_46_04_812Z-debug.log

Then I'm moving to a version of node in 6.17.0
The installation of dependencies is very good but at the time of launching "npm run main" here are my mistakes:

> [email protected] main /var/www/html/backend
> node main.js

module.js:478
    throw err;
    ^

Error: Cannot find module './heart_beat.js'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/html/backend/main.js:41:21)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
    at bootstrap_node.js:507:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] main: `node main.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] main script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-21T09_22_45_755Z-debug.log

I wanted to know if someone had solved the problems?
What do you need as a prerequisite to start the backhend?

Running `npm run main` for the deployment of display-client has an error

Hello!
When I follow https://developers.google.com/maps/solutions/transport-tracker/start to the fifth step.
I am running npm run main for the deployment of display-client but there was an error.
system: Ubuntu 16.04.2 LTS ;

> [email protected] main /home/nick/transport-tracker-map
> gulp serve

[11:43:47] Using gulpfile /home/nick/transport-tracker-map/gulpfile.js
[11:43:47] Starting 'less-compile'...
[11:43:47] Finished 'less-compile' after 114 ms
[11:43:47] Starting 'serve'...
[11:43:47] Finished 'serve' after 3.63 ms
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRNOTAVAIL ::1:8080
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1246:19)
    at listen (net.js:1295:10)
    at net.js:1405:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] main: `gulp serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] main script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-05-23T03_43_47_693Z-debug.log

2017-05-23T03_43_47_693Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/root/node-v6.9.5-linux-x64/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'main' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'premain', 'main', 'postmain' ]
5 info lifecycle [email protected]~premain: [email protected]
6 silly lifecycle [email protected]~premain: no script for premain, continuing
7 info lifecycle [email protected]~main: [email protected]
8 verbose lifecycle [email protected]~main: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~main: PATH: /root/node-v6.9.5-linux-x64/lib/node_modules/npm/bin/node-gyp-bin:/home/nick/transport-tracker-map/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle [email protected]~main: CWD: /home/nick/transport-tracker-map
11 silly lifecycle [email protected]~main: Args: [ '-c', 'gulp serve' ]
12 silly lifecycle [email protected]~main: Returned: code: 1  signal: null
13 info lifecycle [email protected]~main: Failed to exec main script
14 verbose stack Error: [email protected] main: `gulp serve`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/root/node-v6.9.5-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/root/node-v6.9.5-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/nick/transport-tracker-map
17 verbose Linux 4.4.0-63-generic
18 verbose argv "/root/node-v6.9.5-linux-x64/bin/node" "/usr/local/bin/npm" "run" "main"
19 verbose node v6.9.5
20 verbose npm  v4.6.1
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] main: `gulp serve`
23 error Exit status 1
24 error Failed at the [email protected] main script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Unable to load Admin index.html

when i try to execute index.html from admin folder its shows the loading bar and get stuck.
I checked the console and I found this error

Uncaught TypeError: Cannot set property 'id' of undefined
    at main.js:37
    at Array.map (<anonymous>)
    at main.js:35
    at VM92 firebase.js:1
    at Ue (VM92 firebase.js:1)
    at t.raise (VM92 firebase.js:1)
    at t.raiseQueuedEventsMatchingPredicate_ (VM92 firebase.js:1)
    at t.raiseEventsForChangedPath (VM92 firebase.js:1)
    at t.onDataUpdate_ (VM92 firebase.js:1)
    at e.onDataPush_ (VM92 firebase.js:1)
(anonymous) @ main.js:37
(anonymous) @ main.js:35
(anonymous) @ index.esm.js:4458
Ue @ index.esm.js:684
t.raise @ index.esm.js:9720
t.raiseQueuedEventsMatchingPredicate_ @ index.esm.js:9674
t.raiseEventsForChangedPath @ index.esm.js:9658
t.onDataUpdate_ @ index.esm.js:12760
e.onDataPush_ @ index.esm.js:12060
e.onDataMessage_ @ index.esm.js:12054
t.onDataMessage_ @ index.esm.js:11331
t.onPrimaryMessageReceived_ @ index.esm.js:11325
(anonymous) @ index.esm.js:11226
t.appendFrame_ @ index.esm.js:10831
t.handleIncomingFrame @ index.esm.js:10881
mySock.onmessage @ index.esm.js:10778
setTimeout (async)
Ue @ index.esm.js:688
t.raise @ index.esm.js:9720
t.raiseQueuedEventsMatchingPredicate_ @ index.esm.js:9674
t.raiseEventsForChangedPath @ index.esm.js:9658
t.onDataUpdate_ @ index.esm.js:12760
e.onDataPush_ @ index.esm.js:12060
e.onDataMessage_ @ index.esm.js:12054
t.onDataMessage_ @ index.esm.js:11331
t.onPrimaryMessageReceived_ @ index.esm.js:11325
(anonymous) @ index.esm.js:11226
t.appendFrame_ @ index.esm.js:10831
t.handleIncomingFrame @ index.esm.js:10881
mySock.onmessage @ index.esm.js:10778

error

npm run main fails.

Thank you for sharing the amazing piece of your work,

I followed your well explained steps to reach here, but i couldn't npm run main to the backend.
I am continuously receiving the error,

TypeError: Cannot read property 'legs' of undefined

image

As suggested by few fellow programmers, i upgraded the npm version to 6.2 but still couldn't get any solution then i even downgraded to the version 4.6.1 still i am not getting anywhere.
Any help will be highly appreciated. Thank You

Unable to render map

Hi everybody,

I have successfully started both the backend and the map servers with no error shown in the terminal. Nevertheless I am trying to see the results on my localhost:8080 and only the rendering of static files from the title are shown. I have not initialized any other devices.

screenshot from 2018-09-24 14-20-08

Android project doesn't build

Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b08 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6

captura de pantalla 2018-01-06 a las 23 42 46

Tracker Map running locally

I'm running the tracker example locally on my computer.

Set up the backend, in trial mode the firebase database is being updated with the simulated data. So that seems to be working fine.

I tried setting up the map app and running it from npm. It was successfully served at localhost:8080, however the page isn't loading. Its stuck and won't load the google map, or display any of the data from the firebase db.

Has anyone done this on their local machine? I'm not sure what I'm missing out.

screen shot 2017-12-17 at 8 39 17 pm

SyntaxError on Step 5 of Backend

Could you help me resolve this issue? thank you
after running npm run main, i get the following error:

module.js:646
throw err;
^
SyntaxError: /home/timscoh/transport-tracker-server/tracker_configuration.json: Unexpected string in JSON at position 74
at JSON.parse ()
at Object.Module._extensions..json (module.js:643:27)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (/home/timscoh/transport-tracker-server/main.js:2:23)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] main: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] main script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/timscoh/.npm/_logs/2018-01-02T04_38_13_506Z-debug.log

Failed to start: NPM RUN MAIN

Hello Author,

Thank you for sharing your transport-tracker code.

I am having an issue with starting the Server. Attached a log for reference.

Node.js and NPM installed OK, android code compiled fine, Google Maps API keys included in the code and the project is connected to the database (tested the connection fine).
However the server fails to start:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'main' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'premain', 'main', 'postmain' ]
5 info lifecycle [email protected]premain: [email protected]
6 silly lifecycle [email protected]
premain: no script for premain, continuing
7 info lifecycle [email protected]main: [email protected]
8 verbose lifecycle [email protected]
main: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]main: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\CSTransportTracker\display-server\node_modules.bin;C:\ProgramData\Oracle\Java\javapath;;C:\Program Files\Autodesk Git Bundle\cmd;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Common Files\Autodesk Shared;C:\WINDOWS\system32\config\systemprofile.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\nodejs;C:\Users\t_zarun\AppData\Roaming\npm
10 verbose lifecycle [email protected]
main: CWD: C:\CSTransportTracker\display-server
11 silly lifecycle [email protected]main: Args: [ '/d /s /c', 'nodemon main.js' ]
12 silly lifecycle [email protected]
main: Returned: code: 1 signal: null
13 info lifecycle [email protected]~main: Failed to exec main script
14 verbose stack Error: [email protected] main: nodemon main.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\CSTransportTracker\display-server
17 error Windows_NT 6.1.7601
18 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "main"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] main: nodemon main.js
22 error Exit status 1
23 error Failed at the [email protected] main script 'nodemon main.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the display-server package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error nodemon main.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs display-server
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls display-server
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

How to run android app on lollipop version 5.1

I am not able to run the android app on v5.1

I have updated the minSdkVersion to 22 in build.gradle in app folder. The app build successfully but getting an error in emulator as "Unfortunately, Transport Tracker has stopped."

map - 127.0.0.1:8080 - page shows header and no content

hello,

i have successfully setup the "backend", "android app" and these are running on my local desktop nodejs server and successfully updating the firebase database.

i followed all instructions for "map" module and "npm install" and "npm run main" executed without errors. Then it shows me "server started at http://127.0.0.1:8080" but when i open this url in chrome browser it shows the header and 3 grey circles at the bottom, but no content is shown....when i check the javascript console didn't show any error.

please advise what could be my mistake.

thanks.

Deployment to Firebase hosting

In codelab https://codelabs.developers.google.com/codelabs/transport-tracker-map/#0 can not deploy anymore after geting a 410 error. After upgrading tools to version 6.x.y it still reports the same issue and the codelab can not be completed.

Step 3 of 5 of Codelab

=== Deploying to 'fbase-xxxx-transport-tracker'...

i deploying database, hosting
i database: checking rules syntax...
โœ” database: rules syntax for database fbase-snorek-transport-tracker is valid
i hosting: preparing public directory for upload...
Error: HTTP Error: 410, This version of the Firebase CLI is no longer able to deploy to Firebase Hosting. Please upgrade to a newer version (>= 4.1.0). If you have further questions, please reach out to Firebase support.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] firebase-deploy: firebase deploy
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] firebase-deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/xxxx/.npm/_logs/2019-03-17T16_11_35_172Z-debug.log

Cannot show tracked vehicle on map

The admin only showing the simulated tracking vehicle, i already disable the simulation at tracker_configuration.json for backend. The vehicle movement points are successfully stored at firebase thought.

What are the additional steps required to show my tracked vehicle on the map?

not showing live tracking of bus on map

Hey @quarky912 are you able to show locations of buses on map I'm also facing the same problem. I'm getting those locations in raw data but it's not showing in web app please tell me if you got this I've been working on it from weeks but I'm not getting how to show those locations on map

How to bring up admin module

I did npm install for admin module also added API key and call.

I don't see any index.js file. I tried to run npm main.js , got below error

ReferenceError: firebase is not defined.

If i open the index.html page, nothing shows up. in debug, I can see this error:
Uncaught TypeError: Cannot convert undefined or null to object firebase.js:320 Uncaught TypeError: Cannot convert undefined or null
at Function.keys ()
at main.js:36
at firebase.js:424
at ub (firebase.js:320)
at Rb (firebase.js:308)
at Sb (firebase.js:307)
at Object.G (firebase.js:493)
at firebase.js:465
at Pg.g.wd (firebase.js:470)
at Ce.wd (firebase.js:372)

Any inputs pls?

Api key expired

I'm getting this error, so the map is not showing up

Google Maps API error: ExpiredKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error

Missing script in transport-tracker/admin/package.json

transport-tracker/admin/>npm run main
npm ERR! missing script: main

transport-tracker/admin/package.json
"main": "index.js"

{
  "name": "admin",
  "version": "1.0.0",
  "description": "Transport Tracker admin",
  "main": "index.js",
  "author": "Stephen McDonald <[email protected]>",
  "license": "Apache-2.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/googlemaps/transport-tracker.git"
  },
  "dependencies": {
    "ejs": "2.5.5"
  }
}

Unable to locate ejs.min.js

Hello there,
Is this an error, or am I missing something>?

<script src="./node_modules/ejs/ejs.min.js"></script>

in
index.html.

Thanks in advance
I'm using windows without npm installation.

Admin view not working

After putting in my API credentials, I'm getting errors from dependencies not declared i.e. "firebase is unknown." This comes up after I ran node main.js.

What the benefits?

I am really confused, what the benefits of such an app over normal GPS trackers!!!
because i was going to start digging but soon i realized the existence of (GPS trackers devices) so please enlighten me.

Error With Backend

I have tried the things listed in the other comments on why backend isnt working and I still am having problems trying to run backend "npm run main" I am getting.
npm ERR! path /home/jtstmary2023/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/jtstmary2023/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jtstmary2023/.npm/_logs/2018-11-02T19_14_24_032Z-debug.log

Can anyone help?

Google Services Plugin

File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:

Why not GTFS data in Firebase?

GTFS data is stored in SQLite. I'm just wondering why not store them in Firebase, so everything is in single database. Correct me if my question is silly. Thanks in advance.

How to integrate admin section.

I am implemented the back-end and Map section from this Link.
Back-end and Map section worked fine but i am confuse about Admin section. How we integrate the Admin section with rest of the section. ? Where i need to deploy admin section. ? How we can see the live tracking of vehicle.? Currently on map all markers are initialize first time and then don't change with respect to change the location.
Thanks

Error: Cannot find module './paths.json'

1 week trying installing google map, and the map not showing at all

finally im using now google cloud shell its must be without error

but in backend installing process go this
npm ERR! [email protected] main: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] main script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

and in map process the process stuck

i think there something wrong with this I tried all the steps many times and many alternative link, just this one not working with me the others showing the map

please any help!

www.gps.jernascenter.com in this link you will see the third test how its not showing the map and admin panel also

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.