Git Product home page Git Product logo

liota's People

Contributors

apurvah avatar arunnswamy avatar arunv10 avatar bfrggit avatar dananourie avatar dnance avatar dstefka avatar gregbollella avatar kohlidev avatar piyushmasrani avatar tompscanlan avatar venkat2811 avatar vmware-haoyuli avatar warthog9 avatar winniex1 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

liota's Issues

Vrops(DataCenterComponent) is modifying the Gateway passed to it in register()

Now when vrops_gateway = self.vrops.register(gateway) happens, the gateway object passed to it is changed and contains vROps specific properties.

This behavior is harmful in the package manager context, because we may want different DCCs to use the same Gateway object/representation. Therefore, the Gateway object should contain only Gateway specific configuration, parameters, etc. and should NOT contain any DCC specific parameters.

Using **kwargs in _connect() of DeviceComms and DccComms

Data members required for establishing connection in Transport layer are stored in init() method of DeviceComms and DccComms, so that self._connect() can be called. This results in duplication.

Why don't we use **kwargs in abstract _connect() method, so that it can take dynamic arguments instead ?

Reconnect using Exponential Back-off mechanism

When connection between gateway and DCC is broken, LIOTA should try establishing connection using exponential back-off mechanism. This saves some compute at gateway and also reduces load on DCC when hundreds of gateways try to re-establish connection at the same time.

Use of `heapq` in liota/core/metric_handler.py

On Ln 58 def put_and_notify(self, item, block=True, timeout=None), it seems that it gets the smallest item every time using heapq.nsmallest(1, self.queue)[0] (Ln 64,87). It is confusing that we are using a "PriorityQueue" (Ln 52) but still needs heapq.nsmallest to sort them.

Problems installing Liota on a Python virtualenv

Hello

We started working with Liota a few weeks ago, developing my own packages and sending information to my own DCC. So far, we managed to send data through HTTP but since you added the MQTT implementation we tried to work with it. Our problem comes with the Liota installation through pip, we got some errors because our packages with MQTT implementation don't find the MQTT files from Liota (can't resolve the imports), and our package files are on the package folder inside the installed Liota, are we doing maybe something wrong?

We are used to develop using virtualenv and the idea is continue the same process with Liota unless you think it's a bad idea. We've created our own requirements.txt file to create the virtualenv based on the file included with Liota, but I decided to download Liota from Github in order to have the latest Liota, work with MQTT and resolve the import issue. But through this method, Liota doesn't install correctly, doesn't appear on the virtualenv libraries and I get "ImportError: No module named liota.core.package_manager" each time I try to run the liotad.py file. Any advice on how can install Liota on a virtualenv and use MQTT?

P.D: this is how mi requirements.txt looks like
aenum==1.4.5
appdirs==1.4.0
linux-metrics==0.1.4
packaging==16.8
paho-mqtt==1.2
Pint==0.7.2
pyparsing==2.1.10
six==1.10.0
websocket-client==0.37.0
-e git+https://github.com/vmware/liota.git@e2427c533db363aeccb5ad34c5b37e97330db06f#egg=liota

MQTT DCC comms fails with manually constructed MqttMessagingAttributes

When initializing MQTT DCC comms, I was trying to provide an MqttMessagingAttributes object I constructed myself, using

iotcc = IotControlCenter(MqttDccComms(
    edge_system_name=edge_system.name,
    url=config['BrokerIP'],
    port=config['BrokerPort'],
    identity=identity,
    tls_conf=tls_conf,
    enable_authentication=True,
    mqtt_msg_attr=MqttMessagingAttributes( # manually construct attribute object
        edge_system_name=edge_system.name,
        pub_qos=0
    )
))

Got this error:

Traceback (most recent call last):
  File "./mqtt_debug_plus_qos.py", line 183, in <module>
    pub_qos=0
  File "/usr/local/lib/python3.5/dist-packages/liota-0.3-py3.5.egg/liota/dcc_comms/mqtt_dcc_comms.py", line 113, in __init__
  File "/usr/local/lib/python3.5/dist-packages/liota-0.3-py3.5.egg/liota/dcc_comms/mqtt_dcc_comms.py", line 122, in _connect
  File "/usr/local/lib/python3.5/dist-packages/liota-0.3-py3.5.egg/liota/lib/transports/mqtt.py", line 177, in __init__
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 491, in __init__
    raise ValueError('A client id must be provided if clean session is False.')
ValueError: A client id must be provided if clean session is False.

smartquotes in README.md cause problems in setup.py install

I'm testing on various systems, and sometimes will get errors like this when running python setup.py install:

(venv) root [ /tmp/liota ]# python  setup.py  install
Traceback (most recent call last):
  File "setup.py", line 44, in <module>
    long_description = f.read()
  File "/tmp/liota/venv/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4822: ordinal not in range(128)

Turns out the README has some smartquotes. Removing those and replacing with simple quotes fixes the problem.

scripts/autostartliota doesn't stop

Stop is not implemented in the startup script. Causes problems when installing via ansible and restarting service after changing config files.

Local disk caching of collected metrics if connection to DataCenter is broken

Connection between the EdgeSystem and the DataCenter could be broken temporarily and during this time, Liota shall store the collected data on the local disk. Once connection is reestablished, send the data to the DataCenter.

The amount of storage used per device should be configurable and once the threshold is reached, older data is deleted, replacing with newer data.

Change the path of Liota generated files to /var/liota folder

As per OSS team we need to change path of all the liota generated files to "/var/tmp/liota" folder. The "/var/tmp" directory is made available for programs that require temporary files or directories that are preserved between system reboots:

  1. "/etc/liota/conf/devs" to "/var/tmp/liota/devs"

  2. "/etc/liota/conf/entity" to "/var/tmp/liota/entity"

  3. "/etc/liota/conf/iotcc.json" tp "/var/tmp/liota/iotcc.json"

I think we can remove "uuid.ini" as we are going to use "iotcc.json" going forward.

Logging formatter issue to remove new lines

Logs are not readable and /n appears everywhere in case of error traceback. This issue occurs after the PR #120 merge, needs to be resolved before Next Liota release:

2017-05-05 12:34:43 UTC 5966 ERROR [MainThread] liota.lib.transports.web_socket.connect_soc(60) - Traceback (most recent call last):\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 58, in connect_soc__\n__ self.WebSocketConnection()\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 71, in WebSocketConnection__\n__ if self.identity.root_ca_cert:\n__AttributeError: 'bool' object has no attribute 'root_ca_cert'\n__
2017-05-05 12:41:54 UTC 5994 INFO [MainThread] liota.lib.utilities.utility.setup_logging(242) - created logger with /etc/liota/conf/logging.json
2017-05-05 12:41:54 UTC 5994 INFO [MainThread] liota.lib.utilities.utility.get_disk_name(140) - Disk name is : fd0
2017-05-05 12:41:54 UTC 5994 ERROR [MainThread] liota.lib.transports.web_socket.connect_soc(60) - Traceback (most recent call last):\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 58, in connect_soc__\n__ self.WebSocketConnection()\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 71, in WebSocketConnection__\n__ if self.identity.root_ca_cert:\n__AttributeError: 'bool' object has no attribute 'root_ca_cert'\n__
2017-05-05 12:59:22 UTC 6023 INFO [MainThread] liota.lib.utilities.utility.setup_logging(242) - created logger with /etc/liota/conf/logging.json
2017-05-05 12:59:22 UTC 6023 INFO [MainThread] liota.lib.utilities.utility.get_disk_name(140) - Disk name is : fd0
2017-05-05 12:59:22 UTC 6023 ERROR [MainThread] liota.lib.transports.web_socket.connect_soc(60) - Traceback (most recent call last):\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 58, in connect_soc__\n__ self.WebSocketConnection()\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 67, in WebSocketConnection__\n__ self.ws = create_connection(self.host, enable_multithread=True,\n__AttributeError: WebSocket instance has no attribute 'host'\n__
2017-05-05 13:02:19 UTC 6052 INFO [MainThread] liota.lib.utilities.utility.setup_logging(242) - created logger with /etc/liota/conf/logging.json
2017-05-05 13:02:19 UTC 6052 INFO [MainThread] liota.lib.utilities.utility.get_disk_name(140) - Disk name is : fd0
2017-05-05 13:02:19 UTC 6052 ERROR [MainThread] liota.lib.transports.web_socket.connect_soc(60) - Traceback (most recent call last):\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 58, in connect_soc__\n__ self.WebSocketConnection()\n File "build/bdist.linux-x86_64/egg/liota/lib/transports/web_socket.py", line 68, in WebSocketConnection__\n__ sslopt={"cert_reqs": ssl.CERT_NONE})\n File "/usr/local/lib/python2.7/dist-packages/websocket_client-0.37.0-py2.7.egg/websocket/core.py", line 489, in create_connection_\n__ websock.connect(url, **options)\n File "/usr/local/lib/python2.7/dist-packages/websocket_client-0.37.0-py2.7.egg/websocket/core.py", line 219, in connect_\n__ self.handshake_response = handshake(self.sock, *addrs, **options)\n File "/usr/local/lib/python2.7/dist-packages/websocket_client-0.37.0-py2.7.egg/websocket/handshake.py", line 67, in handshake_\n__ status, resp = _get_resp_headers(sock)\n File "/usr/local/lib/python2.7/dist-packages/websocket_client-0.37.0-py2.7.egg/websocket/handshake.py", line 123, in get_resp_headers\n__ raise WebSocketBadStatusException("Handshake status %d", status)\n__WebSocketBadStatusException: Handshake status 404\n__

Simulated thermistor does not run itself upon __init__

In liota/entities/devices/thermistor_simulated.py, the __init__ method should end with self.run(), or this simulation will not start.

According to what we are doing in the bike simulator liota/entities/devices/bike_simulated.py and other demo scripts and corresponding liota package (i.e. those scripts do not call run() after creating the simulator device object), adding run() in __init__ should be the quickest fix.

I already did this in my branch. Tested. Not submitted yet.

What is the IoTCC?

Hi,
I can't find any information about IoTCC.
Can anyone tell me what is IoTCC and project web site or other information.

Thanks.

Many files marked executable in repo, while they are actually not

Most of the files listed below should not be executable --

$ find . -executable -type f -name "*.py"
./packages/graphite.py
./packages/cal_sha1sum.py
./packages/dev_disc/liota_devsim_load.py
./packages/dev_disc/dev_disc.py
./packages/liotad.py
./liota/core/device_discovery.py
./liota/core/discovery_simulator.py
./liota/disc_listeners/named_pipe.py
./liota/disc_listeners/coap.py
./liota/disc_listeners/__init__.py
./liota/disc_listeners/socket_svr.py
./liota/disc_listeners/discovery_listener.py
./liota/disc_listeners/mqtt.py
./liota/dccs/iotcc.py
./liota/dev_sims/named_pipe.py
./liota/dev_sims/coap.py
./liota/dev_sims/__init__.py
./liota/dev_sims/device_simulator.py
./liota/dev_sims/socket_clnt.py
./liota/dev_sims/mqtt.py

Marking them executable does not affect functionality when running in the normal way, but that looks misleading. Also, some text files like requirements.txt are also marked executable, which should be fixed altogether.

Docstring documentation

Docstring styled documentation for all classes and methods. Currently, only few classes have these. This will enable us to use documentation generator like Sphinx in future.

Metrics collected are stored infinitely in Collector Queue

While testing reconnect back-off mechanism we see that, metrics are collected and stored infinitely in Collector Queue as send thread will always be busy with re-try mechanism. If connection is established within minutes, we'll be fine. If it takes days, it might run out of memory.

@KohliDev

REST Support & ThingWorx DCC

REST as Communication layer (Transports, DCCComms and DeviceComms) in Liota. Example will be based on ThingWorx DCC

Contributors:
@nkanchas
@ashish-vmware

Pip puts data files in the wrong place in the directory hierarchy

Installing liota (0.1) on Snappy Ubuntu and Wind River IDP we noticed that the data files (in conf and example) directories are going to the wrong place in the hierarchy. They are supposed to go in /etc/liota but end up in /usr/lib/python2.7/site-packages/etc/...

Pip uninstall Liota succeeds, but throws an error message

Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pip/init.py", line 221, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 252, in main
pip_version_check(session)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/outdated.py", line 102, in pip_version_check
installed_version = get_installed_version("pip")
File "/usr/local/lib/python2.7/dist-packages/pip/utils/init.py", line 848, in get_installed_version
working_set = pkg_resources.WorkingSet()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 619, in init
self.add_entry(entry)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 675, in add_entry
for dist in find_distributions(entry, True):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 1942, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 1824, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 1704, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/init.py", line 1644, in load
mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/liota-0.3.1-py2.7.egg'

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.