transistorsoft / background-geolocation-console

A field-testing & analysis server for the Background Geolocation plugin
MIT License
150 stars 157 forks source link

What are the dependencies on running this server side? #11

Closed rwillett closed 8 years ago

rwillett commented 8 years ago

We're trying to install the background software on a dedicated Ubuntu 14.04 server. We have an issue in our code and we want to use the sample app and web server to try and pinpoint the problem.

We are not that familiar with node.js so its taking us significantly longer than one minute to get the web server installed. It appears to have dependencies on SQLite (which is fine, we know Sqlite very well), it also appears to require a version of node.js thats more recent than the default one that comes with Ubuntu 14.04 is V0.10.25. What else is required to get this up working? is there a list of dependencies and versions? It would be good to know minimum versions to save us guessing whats needed.

Thanks

Rob

christocracy commented 8 years ago

I just booted it from scratch in Ubuntu 12.04 running in Vagrant vm.

$ sudo apt-get remove --purge nodejs npm
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
$ sudo apt-get install -y nodejs
.
.
.
$ cd background-geolocation-console
$ rm -rf node_modules
$ npm install
.
.
.
$ npm start [CTRL][c] (just need to run this once to generate the javascript build)
$ node server.js
rwillett commented 8 years ago

Thank, we're doing much the same, though using node5.0 to see how it works. We had it partly working with the old version of node and npm but nothing seemed to be saved.

We figured it was a version of node/npm issue, we'll see if node5 works OK and report back on it.

Rob

christocracy commented 8 years ago

Are you seeing POSTs in the server log?

$ node server.js
*************************************************************************
* Background Geolocation Server listening at http://:::8080
*************************************************************************
.
.
.
---------------------------------------------------------------------
- POST /locations
 {
  "location": {
    "coords": {
      "speed": 0,
      "longitude": -73.6170079094112,
      "latitude": 45.51955943465747,
      "accuracy": 100,
      "heading": -1,
      "altitude": 76.25790405273438,
      "altitudeAccuracy": 3
    },
    "is_heartbeat": false,
    "is_moving": false,
    "odometer": 80.78865989844503,
    "uuid": "B6E3E5CA-52F9-409E-9470-13B991564C7F",
    "activity": {
      "type": "unknown",
      "confidence": 100
    },
    "battery": {
      "level": 0.76,
      "is_charging": false
    },
    "timestamp": "2016-04-05T15:59:27.000Z"
  },
  "device": {
    "serial": "unknown",
    "manufacturer": "Apple",
    "available": true,
    "platform": "iOS",
    "cordova": "4.1.0",
    "uuid": "3DD7C02A-1109-4F5A-8B69-CAC06DE447B9",
    "model": "iPhone8,1",
    "version": "9.3.1",
    "isVirtual": false
  }
}
rwillett commented 8 years ago

Chris,

Yes, we are.

- POST /locations
 {
  "location": {
    "coords": {
      "speed": -1,
      "longitude": -0.1283383,
      "latitude": 51.5073669,
      "accuracy": 5,
      "heading": -1,
      "altitude": 0,
      "altitudeAccuracy": -1
    },
    "is_heartbeat": false,
    "is_moving": false,
    "event": "motionchange",
    "odometer": 1034481.099668439,
    "uuid": "7F90F24A-99C5-4E13-9975-DF2AC8BF297C",
    "activity": {
      "type": "still",
      "confidence": 66
    },
    "battery": {
      "level": 0.96,
      "is_charging": true
    },
    "timestamp": "2016-04-06T14:38:31.190Z"
  },
  "device": {
    "serial": "unknown",
    "manufacturer": "Apple",
    "available": true,
    "platform": "iOS",
    "cordova": "3.8.0",
    "uuid": "XXXXXXXXXXXXXXXXXX",
    "model": "iPhone6,2",
    "version": "8.3",
    "isVirtual": false
  }
}

We can also see the database has been updated, it looks like that part is working. We can't seem to get the web interface working yet though. Just seems to hang with a blank screen.

The npm start command also just seemed to hang. Should it return or should that also be running as a background process? We haven;t dug into that code yet.

We ran node server.js and that was when we could see POST commands, we seem to be almost there but not quite.

Rob

rwillett commented 8 years ago

Belay that last comment on the web server just hanging. Its come back and displayed something though it took many minutes to do it :)

It looks enough for us to play with so thanks for the help. I can confirm that it works under node V5.0 as well.

Rob