Coder Social home page Coder Social logo

telefonicaid / fiware-device-simulator Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 13.0 491 KB

Simulator of FIWARE-compatible devices (UltraLight 2.0, JSON & NGSIv2)

License: GNU Affero General Public License v3.0

JavaScript 96.93% HTML 0.41% CSS 1.17% Shell 1.28% Dockerfile 0.21%

fiware-device-simulator's People

Stargazers

 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

fiware-device-simulator's Issues

uncaughtException: TypeError: theFromDate.getTime is not a function

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.

Node v10 migration issues

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).

Error launching simulation: Error: EINVAL: invalid argument, readlink '/etc/localtime'

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!

Error in CLI tool without arguments in dockerized version

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#

Random coordinates interpolator given an area

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.

google-spreadsheet dep version is going to be deprecated soon

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

error in resolvePath in fiwareDeviceSimulatorCLI

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 "."

Broken link to readthedocs

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!

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.