[Architecture] Context aware server integration ready to test

Guillem Serra Autonell gserra at bdigital.org
Sat Jan 17 12:24:14 EST 2015


Kasper,

That's great news indeed! Thank yo so much for your last effort! I am
preparing the network and sensors so they can work in the demo. I will
bring them with me.

Regarding the name, it's not a big issue, because we can change it. In
fact, the gpii could deal with that using its transformation capabilities.

2015-01-17 16:45 GMT+01:00 Kasper Markus <kasper at raisingthefloor.org>:

>  Hi Guillem
>
> So I believe we now have support for the CAS - given that the output from
> the CAS with real sensors is the same as when running the mock sensors
>
> The pull request can be found here:
> https://github.com/GPII/universal/pull/314
>
> Would you be able to pull down my branch and try the system out with the
> live sensors? The branch you should use is the GPII-572 of my
> (kaspermarkus) universal repository and you should be able to see messages
> being retrieved in the FM by looking at the log.
>
> One thing that is currently not clear to me - and that might need to be
> changed when hooking it up to the real sensors is the conversion from the
> names you use, and the ones that the rest of the context system uses. So
> the sensor mock sent names like "light", whereas the rest of the system
> uses http://registry.gpii.net/common/environment/visual.luminance. Where
> currently doing a mapping between these here:
> https://github.com/GPII/universal/pull/314/files#diff-285726ff063f4ed01e99ab723c908280R110
> .. There is no problem in doing this mapping - I just wanted to point it
> out in case you use other sensor names in production mode - if so we should
> update that mapping.
>
> ~Kasper
>
>
>
>
> On 1/16/15 12:13 PM, Guillem Serra Autonell wrote:
>
> Dear Kasper,
>
>  I've updated the git. I've added in README the instructions needed
> step-by-step to make it work. It is essential first to remove the devdb
> from Mongodb (so you are starting from scratch). Also, it's important to
> update the git, not only follow the readme without updating because I've
> changed a config file.
>
>  The steps are:
>
>
> https://github.com/barcelonadigital/Cloud4All---Context-Aware-Server#an-introduction-example
>
>
>
> 2015-01-16 11:33 GMT+01:00 Guillem Serra Autonell <gserra at bdigital.org>:
>
>> Sorry,
>>
>>  Give me some minutes and I send you a full step-by-step
>>
>> 2015-01-16 11:12 GMT+01:00 Kasper Markus <kasper at raisingthefloor.org>:
>>
>>>  Hi Guillem,
>>>
>>> I made a bit more progress - after dropping attempting to install
>>> mongodb on linux (which was causing me significant grief), I switched to
>>> windows and managed to install everything. I'm now able to run app.js but
>>> am bumping into another issue. I tried running the mock sensor
>>> (tools/sensor-mockup.js) - after some trial and error I figured it needed
>>> an id (I used --id=sensor1) - but I'm now receiving this error:
>>>
>>> CastError: Cast to ObjectId failed for value "sensor1" at path "_id"
>>> at ObjectId.cast
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\schema\objectid.js:116:13)
>>> at ObjectId.castForQuery
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\schema\objectid.js:165:17)
>>> at Query.cast
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\query.js:2340:32)
>>> at Query.findOne
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\query.js:1118:10)
>>> at Function.findOne
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\model.js:1064:13)
>>> at Function.findById
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\mongoose\lib\model.js:1001:15)
>>> at exports.postData
>>> (C:\Users\kasper\dev\gpii\CAS\controllers\sensor.js:79:10)     at
>>> callbacks
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\express\lib\router\index.js:161:37)
>>> at param
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\express\lib\router\index.js:135:11)
>>> at param
>>> (C:\Users\kasper\dev\gpii\CAS\node_modules\express\lib\router\index.js:132:11) POST
>>> /sensors/sensor1/data 500 0ms
>>> Would it be possible for you to give me some more
>>> clear/detailed/explicit instructions on how to do this (perhaps spin up a
>>> fresh windows or linux box or somehow mimic fresh user/DB's)? Unless one
>>> knows the code, it's for example not obvious that one should pass the
>>> sensor mock an id, nor in how parameters are passed, nor if there is any
>>> requirement to the value of the parameter, etc.
>>>
>>> What I'd like to know is: How do I get the system to a state where
>>>
>>>    - it runs
>>>    - retrieves periodical sensor input
>>>    - potentially specify what the type of sensor is (ie. if I want to
>>>    test with luminance)
>>>    - It's open for connections from eg. flowmanager
>>>    - basically where I can simply start the socket connection from the
>>>    FM and then retrieve input from the CAS.
>>>
>>> And besides that - any information you think would be helpful for
>>> someone who's never used your code before.
>>>
>>> Cheers,
>>> ~Kasper
>>>
>>> On 1/15/15 3:21 PM, Guillem Serra Autonell wrote:
>>>
>>> You need mongodb installed and running!
>>> El 15/01/2015 15:13, "Kasper Markus" <kasper at raisingthefloor.org>
>>> escribió:
>>>
>>>>  Hey Guillem,
>>>>
>>>> Ok - made a bit of progress again (Thanks Antranig!) - it turns out
>>>> NODE_ENV was set to "pilot2" - removing that, I'm now getting the following
>>>> error:
>>>>
>>>> [kasper at localhost cas]$ node app.js Test client listening on port 8889
>>>> in "development" mode Server listening on port 8888 in "development"
>>>> mode events.js:72         throw er; // Unhandled 'error' event
>>>> ^ Error: failed to connect to [127.0.0.1:27017]     at
>>>> null.<anonymous>
>>>> (/home/kasper/gpii/cas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74)
>>>> at emit (events.js:106:17)     at null.<anonymous>
>>>> (/home/kasper/gpii/cas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
>>>> at emit (events.js:98:17)     at Socket.<anonymous>
>>>> (/home/kasper/gpii/cas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10)
>>>> at Socket.emit (events.js:95:17)     at net.js:440:14     at
>>>> process._tickDomainCallback (node.js:463:13)
>>>> What is expected to be running on port 27017?
>>>>
>>>> I do have redis running (installed by 'sudo yum install redis') on it's
>>>> default port, which is 6379..
>>>>
>>>> ~K
>>>> On 1/15/15 2:02 PM, Guillem Serra Autonell wrote:
>>>>
>>>> We can remove them. They are not important (I should have removed them
>>>> before). They should be used to unit test client, but I am not using them.
>>>>
>>>>  The other issue it's the first time I've seen it.
>>>>
>>>>  g.
>>>>
>>>> 2015-01-15 13:00 GMT+01:00 Kasper Markus <kasper at raisingthefloor.org>:
>>>>
>>>>>  Ok - got past this issue, by updating my package.json file to have:
>>>>>
>>>>>     "karma-requirejs": "~0.2.0",
>>>>>     "karma": "~0.12.8",
>>>>>
>>>>> But when attempting to launch it, I'm getting this error:
>>>>>
>>>>> /home/kasper/gpii/cas/app.js:15   CFG_SERVER = envConfig.server,
>>>>> ^ TypeError: Cannot read property 'server' of undefined     at
>>>>> Object.<anonymous> (/home/kasper/gpii/cas/app.js:15:25)     at
>>>>> Module._compile (module.js:456:26)     at
>>>>> Object.Module._extensions..js (module.js:474:10)     at Module.load
>>>>> (module.js:356:32)     at Function.Module._load (module.js:312:12)
>>>>> at Function.Module.runMain (module.js:497:10)     at startup
>>>>> (node.js:119:16)     at node.js:906:3
>>>>> Could you confirm that you have tried the installation procedure out
>>>>> from a fresh checkout? Also, does the above error message ring any bells?
>>>>>
>>>>> Cheers,
>>>>> ~Kasper
>>>>>
>>>>>
>>>>>
>>>>> On 1/15/15 12:39 PM, Kasper Markus wrote:
>>>>>
>>>>> Hi Guillem,
>>>>>
>>>>> I've attempted to install the CAS but am running into some issues...
>>>>> I'm running Fedora 20 as the OS, node and NPM are 0.10.32 and 1.3.6
>>>>> respectively.. I followed the instructions from
>>>>> https://github.com/barcelonadigital/Cloud4All---Context-Aware-Server
>>>>> but there are some problems with the NPM interdependencies... on 'npm
>>>>> install' I get the following error message:
>>>>>
>>>>> npm ERR! peerinvalid The package karma-requirejs does not satisfy its
>>>>> siblings' peerDependencies requirements! npm ERR! peerinvalid Peer
>>>>> karma at 0.10.10 wants karma-requirejs@~0.2.0
>>>>> npm ERR! System Linux 3.12.10-300.fc20.x86_64 npm ERR! command "node"
>>>>> "/usr/bin/npm" "install" npm ERR! cwd /home/kasper/gpii/cas npm ERR!
>>>>> node -v v0.10.32 npm ERR! npm -v 1.3.6 npm ERR! code EPEERINVALID
>>>>> Updating the version of karma-requirejs (eg. as described here:
>>>>> https://github.com/HabitRPG/habitrpg/issues/3061) results in a whole
>>>>> slew of errors:
>>>>>
>>>>>
>>>>>
>>>>>    npm ERR! peerinvalid The package karma does not satisfy its
>>>>> siblings' peerDependencies requirements! npm ERR! peerinvalid Peer
>>>>> karma-script-launcher at 0.1.0 wants karma@>=0.9 npm ERR! peerinvalid
>>>>> Peer karma-firefox-launcher at 0.1.4 wants karma@>=0.9 npm ERR!
>>>>> peerinvalid Peer karma-chrome-launcher at 0.1.7 wants karma@>=0.9.3 npm
>>>>> ERR! peerinvalid Peer karma-html2js-preprocessor at 0.1.0 wants karma@
>>>>> >=0.9 npm ERR! peerinvalid Peer karma-jasmine at 0.1.5 wants karma@>=0.9 npm
>>>>> ERR! peerinvalid Peer karma-requirejs at 0.2.2 wants karma@>=0.9 npm
>>>>> ERR! peerinvalid Peer karma-coffee-preprocessor at 0.1.3 wants karma@
>>>>> >=0.9 npm ERR! peerinvalid Peer karma-phantomjs-launcher at 0.1.4 wants
>>>>> karma@>=0.9 npm ERR! peerinvalid Peer karma-mocha at 0.1.10 wants karma@
>>>>> >=0.12.8 npm ERR! peerinvalid Peer karma-chai at 0.0.1 wants karma@>=0.9
>>>>> npm ERR! System Linux 3.12.10-300.fc20.x86_64 npm ERR! command "node"
>>>>> "/usr/bin/npm" "install" npm ERR! cwd /home/kasper/gpii/cas npm ERR!
>>>>> node -v v0.10.32 npm ERR! npm -v 1.3.6 npm ERR! code EPEERINVALID
>>>>> Have you experienced this issue before? Is a fresh npm install working
>>>>> for you? I am using the master branch of your repo, is that correct?
>>>>>
>>>>> ~Kasper
>>>>>
>>>>>
>>>>>  _______________________________________________
>>>>> Architecture mailing listArchitecture at lists.gpii.nethttp://lists.gpii.net/cgi-bin/mailman/listinfo/architecture
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Kasper Galschiot Markus
>>>>> Lead Research Engineer,
>>>>> Raising the Floor - International,www.raisingthefloor.org
>>>>>
>>>>>
>>>>
>>>>
>>>>  --
>>>>
>>>>
>>>> *GUILLEM SERRA AUTONELL *
>>>> *Head of Health Market  *
>>>> *BARCELONA DIGITAL TECHNOLOGY CENTRE **www.bdigital.org
>>>> <http://www.bdigital.org/>*
>>>>   *Phone**. *+34 93 553 45 40  Ext. *2224*
>>>> * M. *619 28 78 14
>>>> *TW: *@norbak
>>>> gserra at bdigital.org    <http://twitter.com/bdigital>
>>>> <http://www.linkedin.com/groups?gid=3755107&trk=hb_side_g>
>>>> <http://www.youtube.com/user/BarcelonaDigital?feature=mhum>
>>>> <http://www.flickr.com/photos/barcelonadigital/>
>>>> <http://www.bdigital.org/> <http://www.acc10.cat/tecnio>
>>>> *In Barcelona  (headquarters):*
>>>> Media-TIC building.
>>>> C/ Roc Boronat 117, 5th floor
>>>> 08018 Barcelona (Spain)
>>>> Phone (+34) 93 553 45 40
>>>> Fax (+34) 93 553 45 41 *In Lleida:*
>>>> Scientific and Technological Agro-food Park.
>>>> Gardeny Park.
>>>> ICT building, ground floor
>>>> 25071 Lleida (Spain)
>>>> Phone (+34) 973 19 36 60 *In Girona:*
>>>> Scientific and Technological
>>>> Park of Girona University.
>>>> Narcís Monturiol building.
>>>> C/ Emili Grahit, 91
>>>> 17003 Girona (Spain)
>>>> Phone (+34) 972 41 64 78
>>>>
>>>>
>>>>
>>>> --
>>>> Kasper Galschiot Markus
>>>> Lead Research Engineer,
>>>> Raising the Floor - International,www.raisingthefloor.org
>>>>
>>>>
>>>
>>> --
>>> Kasper Galschiot Markus
>>> Lead Research Engineer,
>>> Raising the Floor - International,www.raisingthefloor.org
>>>
>>>
>>
>>
>>  --
>>
>>
>> *GUILLEM SERRA AUTONELL *
>> *Head of Health Market  *
>> *BARCELONA DIGITAL TECHNOLOGY CENTRE **www.bdigital.org
>> <http://www.bdigital.org/>*
>>   *Phone**. *+34 93 553 45 40  Ext. *2224*
>> * M. *619 28 78 14
>> *TW: *@norbak
>> gserra at bdigital.org    <http://twitter.com/bdigital>
>> <http://www.linkedin.com/groups?gid=3755107&trk=hb_side_g>
>> <http://www.youtube.com/user/BarcelonaDigital?feature=mhum>
>> <http://www.flickr.com/photos/barcelonadigital/>
>> <http://www.bdigital.org/> <http://www.acc10.cat/tecnio>
>> *In Barcelona  (headquarters):*
>> Media-TIC building.
>> C/ Roc Boronat 117, 5th floor
>> 08018 Barcelona (Spain)
>> Phone (+34) 93 553 45 40
>> Fax (+34) 93 553 45 41 *In Lleida:*
>> Scientific and Technological Agro-food Park.
>> Gardeny Park.
>> ICT building, ground floor
>> 25071 Lleida (Spain)
>> Phone (+34) 973 19 36 60 *In Girona:*
>> Scientific and Technological
>> Park of Girona University.
>> Narcís Monturiol building.
>> C/ Emili Grahit, 91
>> 17003 Girona (Spain)
>> Phone (+34) 972 41 64 78
>>
>
>
>
>  --
>
>
> *GUILLEM SERRA AUTONELL *
> *Head of Health Market  *
> *BARCELONA DIGITAL TECHNOLOGY CENTRE **www.bdigital.org
> <http://www.bdigital.org/>*
>   *Phone**. *+34 93 553 45 40  Ext. *2224*
> * M. *619 28 78 14
> *TW: *@norbak
> gserra at bdigital.org    <http://twitter.com/bdigital>
> <http://www.linkedin.com/groups?gid=3755107&trk=hb_side_g>
> <http://www.youtube.com/user/BarcelonaDigital?feature=mhum>
> <http://www.flickr.com/photos/barcelonadigital/>
> <http://www.bdigital.org/> <http://www.acc10.cat/tecnio>
> *In Barcelona  (headquarters):*
> Media-TIC building.
> C/ Roc Boronat 117, 5th floor
> 08018 Barcelona (Spain)
> Phone (+34) 93 553 45 40
> Fax (+34) 93 553 45 41 *In Lleida:*
> Scientific and Technological Agro-food Park.
> Gardeny Park.
> ICT building, ground floor
> 25071 Lleida (Spain)
> Phone (+34) 973 19 36 60 *In Girona:*
> Scientific and Technological
> Park of Girona University.
> Narcís Monturiol building.
> C/ Emili Grahit, 91
> 17003 Girona (Spain)
> Phone (+34) 972 41 64 78
>
>
>
> --
> Kasper Galschiot Markus
> Lead Research Engineer,
> Raising the Floor - International,www.raisingthefloor.org
>
>


-- 


*GUILLEM SERRA AUTONELL*
*Head of Health Market *
*BARCELONA DIGITAL TECHNOLOGY CENTRE**www.bdigital.org
<http://www.bdigital.org/>*
 *Phone**. *+34 93 553 45 40  Ext. *2224*
*M. *619 28 78 14
*TW: *@norbak
gserra at bdigital.org <http://twitter.com/bdigital>
<http://www.linkedin.com/groups?gid=3755107&trk=hb_side_g>
<http://www.youtube.com/user/BarcelonaDigital?feature=mhum>
<http://www.flickr.com/photos/barcelonadigital/> <http://www.bdigital.org/>
<http://www.acc10.cat/tecnio>
*In Barcelona (headquarters):*
Media-TIC building.
C/ Roc Boronat 117, 5th floor
08018 Barcelona (Spain)
Phone (+34) 93 553 45 40
Fax (+34) 93 553 45 41*In Lleida:*
Scientific and Technological Agro-food Park.
Gardeny Park.
ICT building, ground floor
25071 Lleida (Spain)
Phone (+34) 973 19 36 60*In Girona:*
Scientific and Technological
Park of Girona University.
Narcís Monturiol building.
C/ Emili Grahit, 91
17003 Girona (Spain)
Phone (+34) 972 41 64 78
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gpii.net/pipermail/architecture/attachments/20150117/1649af9a/attachment-0001.html>


More information about the Architecture mailing list