Giter Club home page Giter Club logo

iot-lab-mqtt's Introduction

IoT-LAB Main Repository

This repository contains common IoT-LAB resources, such as experiments management tools, deployment tools, dev. env. setup.

Overall documentation is available at https://github.com/iot-lab/iot-lab/wiki

To perform the initial setup of your development environment, run make.

iot-lab-mqtt's People

Contributors

cladmi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iot-lab-mqtt's Issues

Issue with --iotlab-password

--iotlab-password is a bad idea as every iot-lab users can see the other users commands arguments.
Its also a bigger problem as agents run for a long time so easier to spot.

It would be a good idea to remove it and replace it with an environment variable.

And maybe allow configuring with a configuration file as done for manager in #5

Not loading firmware for A8 nodes

I'm trying to boot a firmware for a A8 node on my experiment but I'm getting this error message:

(Cmd) update a8 34 gnrc_border_router.elf
IoT-LAB Request 'update' error: 'HTTP Error 500: 
	Invalid nodes list'

The following are the relevant data of the experiment:

$ experiment-cli get -p
{
    "associations": null, 
    "deploymentresults": {
        "0": [
            "a8-34.grenoble.iot-lab.info", 
            "m3-368.grenoble.iot-lab.info", 
            "m3-369.grenoble.iot-lab.info"
        ]
    }, 
    "duration": 360, 
    "firmwareassociations": null, 
    "mobilities": null, 
    "name": "exp4_tests", 
    "nodes": [
        "a8-34.grenoble.iot-lab.info", 
        "m3-368.grenoble.iot-lab.info", 
        "m3-369.grenoble.iot-lab.info"
    ], 
    }, 
    "reservation": null, 
    "siteassociations": null, 
    "state": "Running", 
    "type": "physical"
}

And the status from Grenoble:

fuentess@grenoble:~$ open-a8-cli wait-for-boot
Cannot connect to IoT-LAB server on site "grenoble.iot-lab.info", check your SSH configuration.
{
    "wait-for-boot": {
        "1": [
            "node-a8-34.grenoble.iot-lab.info"
        ]
    }
}

However, I can access to the node-a8-34 and load the firmware manually

fuentess@grenoble:~$ ssh root@node-a8-34
...
root@node-a8-34:~# flash_a8_m3 A8/gnrc_6br_a8.elf
...
shutdown command invoked
Return Value: 0

Tox and travis

It's seems there is a problem with the current configuration with tox and Travis.

This is what Travis is getting currently at master:

  py27-paho12-pep8: commands succeeded
  py27-paho12-lint: commands succeeded
  py27-paho12-tests: commands succeeded
ERROR:   py27-paho12-flake8: commands failed
  py27-paholatest-pep8: commands succeeded
  py27-paholatest-lint: commands succeeded
ERROR:   py27-paholatest-tests: commands failed
ERROR:   py27-paholatest-flake8: commands failed
  py35-paho12-pep8: commands succeeded
  py35-paho12-lint: commands succeeded
  py35-paho12-tests: commands succeeded
ERROR:   py35-paho12-flake8: commands failed
  py35-paholatest-pep8: commands succeeded
  py35-paholatest-lint: commands succeeded
ERROR:   py35-paholatest-tests: commands failed
ERROR:   py35-paholatest-flake8: commands failed

Tests with flake8 are failing due to iotlabmqtt/asyncconnection.py#L59 (and introduced in e7a0dc6). A simple PR will fix this. However, py27-paholatest-tests and py35-paholatest-tests"should be being OK in the PR #11 Yet, is not the case and is because of conflicts with the mock clients in the tests. Probably, a separated PR is required for them.

Finally, two minor comments

1- the tests with Pep8 are not being redundant with the ones with Flake8?
2- pep8 is almost legacy now (the name is changed to pycodestyle)

Sidenote

I was getting different outputs on my local machines with Tox, so I'm leaving this like a note for future references.

apt-get install graphviz
pip install tox graphviz sphinx

Issue with iotlab-mqtt-clients serial

This is a bug, but in certain way expected to happen. And, probably putting a warning in the documentation should be enough.

The conditions for triggering are:

  1. Experiment is already running
  2. Server side is already running the MQTT serial counterpart
  3. Client side is already running iotlab-mqtt-clients serial and the command linestart was already introduced.
  4. User uses the node-cli command for manually updating the firmware.

This provokes a callback error on the client side. And sometimes, the python instance is frozen, forcing to close the terminal or sending the process to the background.

This is the error generated:

(Cmd) Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2580, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1378, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 897, in loop
    rc = self.loop_read(max_packets)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1177, in loop_read
    rc = self._packet_read()
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1766, in _packet_read
    rc = self._packet_handle()
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2239, in _packet_handle
    return self._handle_publish()
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2414, in _handle_publish
    self._handle_on_message(message)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2568, in _handle_on_message
    t[1](self, self._userdata, message)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/mqttcommon.py", line 206, in _wrapper
    return callback(msg, **fields)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/clients/common.py", line 104, in _wrapped
    ret = func(*args, **kwargs)
  File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/clients/serial.py", line 91, in line_handler
    line = message.payload.decode('utf-8')
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 2: invalid start byte

conflicts with paho-mqtt 1.3

I just identified a problem with iotlab-mqtt-node. The option for poweron, poweroff, reset and update crashes in the server side with the following error:

callback(self, self._userdata, message)
File "/senslab/users/fuentess/.local/lib/python3.6/site-packages/iotlabmqtt/mqttcommon.py", line 327, in _wrapper
msg.reply_publisher = mqttc.publisher(reply_topic)
AttributeError: 'MQTTMessage' object has no attribute 'reply_publisher'

This means that the culprit is the upgraded made to paho-mqtt. I'm able to avoid the problem by forcing the use of paho-mqtt 1.2 yet, I suppose that we need to fix the root of the problem for the latest version.

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.