telefonicaid / fiware-device-simulator Goto Github PK
View Code? Open in Web Editor NEWSimulator of FIWARE-compatible devices (UltraLight 2.0, JSON & NGSIv2)
License: GNU Affero General Public License v3.0
Simulator of FIWARE-compatible devices (UltraLight 2.0, JSON & NGSIv2)
License: GNU Affero General Public License v3.0
When using --from/--to with Date-parsable strings, such as bin/fiwareDeviceSimulatorCLI -f 2019-08-20T00:00:00.0Z -t 2019-08-20T23:59:59.9Z
(or via -x), the CLI fails with the following exception:
{"lvl":"ERROR","msg":"error event: { error: 'uncaughtException: TypeError: theFromDate.getTime is not a function' }"}
Bug present with both non-Docker Node v8.12.0 and the latest Docker image. PR incoming.
It seems that a problem with eval 0.1.2 module is precluding fiware-device-simulator unit test to work fine with Node v10.
In particular, we are getting errors 22 errors, most one like this one:
TypeError [ERR_INVALID_ARG_TYPE]: The "options.filename" property must be of type string. Received type object
at new Script (vm.js:62:13)
at module.exports (node_modules/eval/eval.js:72:18)
at Object.collect (lib/collectors/fiwareDeviceSimulatorCollector.js:38:12)
at Context.<anonymous> (test/unit/collectors/fiwareDeviceCollector_test.js:33:22)
If we hack the eval.js 0.1.2 code this way:
$ diff -u node_modules/eval/eval.js node_modules/eval/eval.js.orig
--- node_modules/eval/eval.js 2018-11-14 11:32:15.258076938 +0100
+++ node_modules/eval/eval.js.orig 2018-11-14 11:32:10.362076780 +0100
@@ -57,10 +57,6 @@
filename: filename,
displayErrors: false
}
- if (options.filename == null)
- {
- options.filename = '';
- }
if (isBuffer(content)) {
content = content.toString()
The all test pass ok.
Looking to eval git repository it seems, the following PR pierrec/node-eval#17 will fix the problem (it seems to be a kind of "clean version" of my hack).
Hi team,
When I run this config /examples/urbo-simulation-environment.json
raise this error:
{"time":"2017-05-12T09:36:02.580Z","lvl":"INFO","msg":"info event: Simulation configuration transpiling successfully completed!"}
{"time":"2017-05-12T09:36:03.891Z","lvl":"INFO","msg":"stop event"}
{"time":"2017-05-12T09:36:03.898Z","lvl":"INFO","msg":"end event"}
Fri, 12 May 2017 09:37:46 GMT time extending Date constructor
Fri, 12 May 2017 09:37:46 GMT time attempting to resolve timezone directory.
Fri, 12 May 2017 09:37:46 GMT time checking if directory exists: /usr/share/zoneinfo
Fri, 12 May 2017 09:37:46 GMT time found timezone directory at: /usr/share/zoneinfo
Fri, 12 May 2017 09:37:46 GMT time `process.env.TZ` not initially set, attempting to resolve
Fri, 12 May 2017 09:37:46 GMT time Error: EINVAL: invalid argument, readlink '/etc/localtime'
at Error (native)
at Object.fs.readlinkSync (fs.js:1014:18)
at Object.<anonymous> (/usr/src/fiware-device-simulator/node_modules/time/index.js:107:34)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
Fri, 12 May 2017 09:37:46 GMT time "currentTimezone" still not set. Checking "/etc/timezone"
Fri, 12 May 2017 09:37:46 GMT time resolved initial timezone: Etc/UTC
Fri, 12 May 2017 09:37:46 GMT time Date#setTimezone(Etc/UTC, undefined)
Fri, 12 May 2017 09:37:46 GMT time current timezone is not "Etc/UTC", calling tzset()
Fri, 12 May 2017 09:37:46 GMT time set the current timezone to: Etc/UTC
Do you know what could be happening? It has started to happen suddenly.
Thanks!
I have just installed the dockerized version of the simulator. When I execute de CLI tool, without arguments, I get this error:
root@7c60a8ea4ad4:/opt/fiware-device-simulator# ./bin/fiwareDeviceSimulatorCLI
/opt/fiware-device-simulator/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/opt/fiware-device-simulator/node_modules/request/node_modules/hawk/lib/index.js:5:33)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
root@7c60a8ea4ad4:/opt/fiware-device-simulator#
We have /v1/queryContext in this point
https://github.com/search?q=repo%3Atelefonicaid%2Ffiware-device-simulator%20queryContext&type=code
It seems the the attribute-function-interpolator()
functionality is ignoring the "ngsiVersion": "2.0"
setting.
I'll suggest to implement the following interpotalor (in fact, nothing has to be interpolated).
Given an area (a square defined by the two vertices of a diagonal, a circle given its center and raidus...), generate random coordinates within the given area.
This could be useful when defining entities based on the count
and entity_type
fields. In that case, current position interpolators assume all the entities are walking the same path. Nevertheless, by using this new interpolator entities will be walking different (random) paths.
root@iot-device-simulator:/opt/fiware-device-simulator# ./bin/fiwareDeviceSimulatorCLI
WARNING! You must upgrade to the latest version of google-spreadsheet!
Google's deprecation date for the v3 sheets API is March 3rd 2020
Bad news - this version of this module will stop working on that date :(
Good news - the new version of the module uses the newer v4 api :)
However, there are breaking changes, so please see the docs site
https://theoephraim.github.io/node-google-spreadsheet
Because of the implementation of this function in the case the path is relative, the configuration file can only be inside the ROOT_PATH. For example, this command is not accepted even when it is correct:
$ fiwareDeviceSimulatorCLI -c ../<dir1>/<config_file.json>
The function assumes that a relative path is always this way: ./<path>
when the first character of the path is "."
We need to compatibilize this component for nodejs version 12.
The npm module is failing for nodejs 12.
Reference:
Hi team,
This new interpolator (Multiline Bearing Interpolator) does not work. I see very fast what is the problem and I fixed with PR #25.
Thanks!
Hi team,
The link to readthedocs is broken (link is pointing to fiware-sth-comet):
https://github.com/telefonicaid/fiware-device-simulator/blob/master/fiware-sth-comet.readthedocs.io
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.