Giter VIP home page Giter VIP logo

openmtc's Introduction

FIWARE IoT Agents License: Eclipse Support badge
Documentation badge Build Status Coverage Status Known Vulnerabilities Status

The OpenMTC SDK aims to provide developers with a convenient yet flexible tool to write oneM2M compliant applications. This includes network applications (NAs), gateway application (GAs), device applications (DAs), as well as interworking proxy entities (IPEs).

This project is part of FIWARE. For more information check the FIWARE Catalogue entry for the IoT Agents.

:octocat: Git Repository 🐳 Docker Hub πŸ“š Documentation πŸ“„ Site πŸŽ“ Academy

Content

Install

Information about how to install the JSON IoTAgent can be found at the corresponding section of the Installation & Administration Guide.

Usage

Information about how to use the IoT Agent can be found in the User & Programmers Manual.

Training

Information about our Training can be found in the Training Section.

API

Information about the REST API can be found in the API Section

Python

The OpenMTC SDK is written in and for the Python programming language. Users should therefore have at least a certain knowledge of Python and its paradigms. For this matter, the following material is recommended:

Feedback

Please create issues for any problems and direct any comments or feedback you are having to [email protected]

Please let us know what you think. We are also very interested in any use case you are not able to implement with the SDK or if you find it difficult to do so.

Quality Assurance

This project is part of FIWARE and has been rated as follows:

  • Version Tested:
  • Documentation:
  • Responsiveness:
  • FIWARE Testing:

Contributing

Contribution guidelines are detailed in the CREDITS file.

License

The OpenMTC SDK is licensed under the Eclipse Public License (EPL) version 1.

Β© 2018-2019 OpenMTC

openmtc's People

Contributors

aor-fokus avatar ckl-fokus avatar jason-fox avatar rst-fokus 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

Watchers

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

openmtc's Issues

create-binary-docker not working in macOS Catalina

Hello,

create-binary-docker image is not working in macOS Catalina. When I try to execute $ ./create-binary-docker gateway inside the OpenMTC directory, the following appears:

error_macOS

I also tried specifying the architecture ($ ./create-binary-docker -a amd64 gateway) but it did not work:

error_macOS_2

Can someone help me please?

Thank you.

Support for resource type 28 (Flex Container)

Is there any information about the implementation of the Flex container resource type according to the onem2m standard?

Currently there is an issue when registering a remotecse that supports that type for example om2m. The two different implementations are not interoperable (Resource type 28 is not recognised).

Dead project?

Is this project dead?

Simple PR are sitting there from May, not good.

Build is dependent on python2

The build step:

get_requirements_from_setup_file ()
{
    # Each setup file is assumed to hold ".py" suffix, this gets
    # removed here
    local module_name=${setup_file%.py}

    cd ${working_dir}
    python - << END_OF_PYTHON
from importlib import import_module
from re import sub
setup = import_module('${module_name}', '${module_name}')
print('\n'.join(map(lambda x: sub('[\s+]', '', x),
                   setup.SETUP_INSTALL_REQUIRES)))
END_OF_PYTHON
}

causes a failure if the development system neither has python2.7 or python 2 setuptools installed locally.

Results in the requirements.txt of pip not being installed in the resulting image.

Data is not stored on MongoDB through an Orion Context Broker

Hi @ronald-steinke

i have executed docker-compose.yml file (https://github.com/OpenMTC/OpenMTC/blob/master/apps/OrionContextBroker/README.md). Then it is deployed related docker container. When i see logs, i could see following before create sample data on mongodb (e.g "TESTTENANT-bath","TESTTENANT-kitchen")

mongo | 2018-06-15T04:10:44.266+0000 I NETWORK [thread1] waiting for connections on port 27017

Also when i ran following curl script to store data at the Orion CB as describe in README file, then output is empty and can not see any data on mongdb

curl -X POST localhost:18000/onem2m/ -H "Content-Type: application/vnd.onem2m-res+json" -d '{"m2m:ae": {"rn": "EXAMPLE_APP_NAME", "api": "placeholder", "rr": "TRUE"}}'

curl -X POST localhost:18000/onem2m/EXAMPLE_APP_NAME/ -H "Content-Type: application/vnd.onem2m-res+json" -d '{"m2m:cnt": {"rn": "EXAMPLE_DEVICE_NAME", "lbl":["openmtc:device"]}}'

curl -X POST localhost:18000/onem2m/EXAMPLE_APP_NAME/EXAMPLE_DEVICE_NAME/ -H "Content-Type: application/vnd.onem2m-res+json" -d '{"m2m:cnt": {"rn": "EXAMPLE_MEASUREMENT_NAME", "lbl":["openmtc:sensor_data"]}}'

curl -X POST localhost:18000/onem2m/EXAMPLE_APP_NAME/EXAMPLE_DEVICE_NAME/EXAMPLE_MEASUREMENT_NAME/ -H "Content-Type: application/vnd.onem2m-res+json" -d '{"m2m:cin": {"con": "eyJuIjogInRlbXBlcmF0dXJlIiwgImJuIjogIm9wZW5tdGM6emlnYmVlOnRlbXAiLCAidiI6IDI0LCAidSI6ICJDZWwiLCAidCI6ICIyMDE3LTA0LTEzIDEyOjQ1OjEyLjc4NzIzOSJ9Cg==", "cnf": "application/json:1"}}'

curl localhost:1026/v2/entities/ | jq '.'

Also i have tried to run ./apps/influx-db separately, but it also returned following error.

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/privacy/src/OpenMTC/apps/InfluxDB/src/influxdb/main.py", line 5, in
from .influx_db import InfluxDB
File "/home/privacy/src/OpenMTC/apps/InfluxDB/src/influxdb/influx_db.py", line 2, in
from connector import InfluxDBConnector
File "/home/privacy/src/OpenMTC/apps/InfluxDB/src/influxdb/connector.py", line 3, in
from influxdb import InfluxDBClient
ImportError: cannot import name InfluxDBClient

can i know what is the issue with OCB and mongodb connection ?

Regards
Janaka

[SHOULD] Work towards fulfilling the requirements for a full GE

The following MUST requirements for full GE status are not currently satisfied:

Missing items within the README

  • README - Training Section

Missing on Docker

  • DOCKER - SemVer Image Available
  • DOCKER - FIWARE Image Available
  • DOCKER - README present

No CREDITS file

An incubated enabler should be working to fulfilling these requirements

  • SHOULD requirement from the TSC

After delete specific subscription, How can i create subscription automatically without restarting OCB

Hi,

We have a setup with Fiware Orion Service, OCB and OpenMTC.
In this setup, we register a device via OpenMTC.

After registering the device, it creates entity and subscription at the fiware service.

Now, we delete the subscription via

self._request(self.host + "/v2/subscriptions/" + subscription_id,
                      method='delete',
                      headers={"fiware-service": fiware_service},
                      raw=True)

But OpenMTC still keeps the containers in a temporary python set() in onem2m.py.
How can I delete the specific container from the set()?

If I restart OCB then the set() is cleared but that is not the solution I’m looking for.
I want to programmatically delete a container from the set().

Regards
Janaka

Can somebody Elaborate more on MQTT connector

I have mosquitto broker sunning on local system and I wish to see the sensor data on openMTC. I am unable to understand the process described in mqtt connector section. I can publish data on broker, but unable to proceed towards openMTC connector. please guide
Thank you

[SHOULD] Every GE should have tutorial information

At the moment OpenMTC has no information in the Academy and does not minimum Training section requirements for a Full GE. This is a placeholder to ensure a simple OpenMTC hello world gets added to the Step-by-Step tutorials at some point

See Atos-Research-and-Innovation/IoTagent-LoRaWAN#38 as an example of compliance for an IoT Agent

  • Presence of a tutorial is a SHOULD requirement it will be upgraded in the future

An incubated GE should be working to fulfilling these requirements

OpenMTC without Docker?

Hi
Are there any instructions to install, configure and run openMTC without Docker?

Thanks

Error while running backend image

Hello,

I am trying to run the OpenMTC backend image, but the following error appears:

Screen Shot 2020-04-29 at 6 43 03 PM

It seems that gevent.signal is not being interpreted as a function.

Can someone help me please?

Thank you.

FIWARE Interoperability: Timestamps should be of type DateTime (ISO8601)

For the sake of completeness and semantics instead of

{
  "type": "Float",
  "value": 20.569353172,
  "metadata": {
    "bn": {
      "type": "String",
      "value": "urn:dev:s300th:1"
    },
    "timestamp": {
      "type": "String",
      "value": "1527093220.104"
    },
    "unit": {
      "type": "String",
      "value": "Cel"
    }
  }
}

It should be

{
  "type": "Float",
  "value": 20.569353172,
  "metadata": {
    "bn": {
      "type": "String",
      "value": "urn:dev:s300th:1"
    },
    "timestamp": {
      "type": "DateTime",
      "value": "2019-01-08T12:05:00Z"
    },
    "unit": {
      "type": "String",
      "value": "Cel"
    }
  }
}

get latest resource seems to be broken following docs

Describe the bug
A get request on resources in the type of: /onem2m/EXAMPLE_APP_NAME/EXAMPLE_CONTAINER_NAME/latest doesn't work. OpenMTC replies with 404

I found that using ls instead of latest actually works.

Why there is that incongruence between documentation and real implementation? Or am I doing somethig wrong?

why MQTTS is not working

Hi @rst-fokus ,

I need to use secure MQTT connection with openmtc. i have used an own mqtt broker (EMQ) which enable SSL and use key and certs file itself. Afterthat i changed openmtc-backend.json as follow (1). when i run ./run-backend, it returned error (2)

(1)

{
                "name": "MQTTTransportPlugin",
                "package": "openmtc_cse.plugins.transport_gevent_mqtt",
                "disabled": false,
                "config": {
                    "interface": "x.x.x.x",
                    "port": 8883
                }
            }

(2)

ERROR:MQTTTransportPlugin:Failed to start plugin
Traceback (most recent call last):
File "/home/privacy/src/OpenMTC/server/openmtc-server/src/openmtc_server/Plugin.py", line 37, in start
self._start()
File "/home/privacy/src/OpenMTC/server/openmtc-cse/src/openmtc_cse/plugins/transport_gevent_mqtt/init.py", line 45, in _start
client_id=self.config['onem2m'].get('cse_id'),
File "/home/privacy/src/OpenMTC/common/openmtc-onem2m/src/openmtc_onem2m/client/mqtt.py", line 74, in get_client
cert_file=cert_file, key_file=key_file, insecure=insecure
File "/home/privacy/src/OpenMTC/common/openmtc-onem2m/src/openmtc_onem2m/client/mqtt.py", line 288, in init
raise ConnectionFailed(e.message)
ConnectionFailed
ERROR:openmtc_gevent.main:Error during startup
Traceback (most recent call last):
File "/home/privacy/src/OpenMTC/openmtc-gevent/src/openmtc_gevent/main.py", line 389, in main
start_plugins()
File "/home/privacy/src/OpenMTC/openmtc-gevent/src/openmtc_gevent/main.py", line 141, in start_plugins
async_all([plugin.start() for plugin in _plugins]).get()
File "/home/privacy/src/OpenMTC/common/openmtc/lib/aplus/init.py", line 128, in get
raise self.reason
ConnectionFailed

When i did same thing for https, i could see and enable following on config-backend.json

 "enable_https": true,
  "require_cert": true

But MQTTTransportPlugin does not give like that configuration

can you explain what's wrong with this mqtts?

Docker build error

I'm using Ubuntu 16.04, Docker 1.13.1.

I cloned the repo and ran:

$cd OpenMTC
$./create-binary-docker sdk

I get the following error:

################################################################################
### Building docker image for sdk-amd64...
################################################################################
### Building base container...
Sending build context to Docker daemon 24.06 kB
Step 1/5 : FROM debian:jessie
jessie: Pulling from library/debian
85b1f47fba49: Pull complete 
Digest: sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60
Status: Downloaded newer image for debian:jessie
 ---> 25fc9eb3417f
Step 2/5 : MAINTAINER rst/tgu
 ---> Running in 36a348b0166c
 ---> 5f0ddfe6069a
Removing intermediate container 36a348b0166c
Step 3/5 : RUN printf "Starting update...\n" &&     apt-get update -qq &&     printf "Update finished.\n" &&     printf "Starting dist-upgrade...\n" &&     apt-get dist-upgrade -y > /dev/null &&     printf "Upgrade finished.\n" &&     printf "Starting install...\n" &&     apt-get install -y     build-essential     netbase     iproute2     python-pip     python-dev     jq > /dev/null &&     apt-get clean &&     printf "Installation and cleanup finished.\n"
 ---> Running in 13ee72372d14
Starting update...
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease  

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg  Could not resolve 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg  Could not resolve 'deb.debian.org'

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Could not resolve 'security.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.
Update finished.
Starting dist-upgrade...
Upgrade finished.
Starting install...
E: Unable to locate package build-essential
E: Unable to locate package python-pip
E: Unable to locate package python-dev
E: Unable to locate package jq
The command '/bin/sh -c printf "Starting update...\n" &&     apt-get update -qq &&     printf "Update finished.\n" &&     printf "Starting dist-upgrade...\n" &&     apt-get dist-upgrade -y > /dev/null &&     printf "Upgrade finished.\n" &&     printf "Starting install...\n" &&     apt-get install -y     build-essential     netbase     iproute2     python-pip     python-dev     jq > /dev/null &&     apt-get clean &&     printf "Installation and cleanup finished.\n"' returned a non-zero code: 100
### Building base container failed. Exiting now.
################################################################################
### Cleaning...done

The same happens for the gateway and backend

where to find Add-ons code for IPEs annonced in web site

Hello,
in the site openmtc.org, on platform page, are listed the following Protocol Adapters (IPE) Add-ons :

  • ZigBee for Smart Building
  • PROFINET and Modbus for Industry 4.0
  • OPC-UA client
  • Robot OS (ROS)
    I can't find any repository for those add-ons on github, it doesn't seem to be included in this openmtc repository, hence can you tell me if those add-ons are available or not, in case they are wher to find it ?
    Thanks in advance for your answer

Issue while trying to create an application resource

Hello.

I am following the Quick Start tutorial: https://www.openmtc.org/doc.html

After cloning the repository, building the gateway image, and running it, I am facing issues. When I try to create an application resource (by running the corresponding command that appears in the Quick Start tutorial), the following message appears on my terminal window:

"Failed to connect to localhost port 8000: Connection refused".

I opened Docker Desktop's dashboard to check the gateway container log, and I found the following:

ERROR

Can someone help me please?

Thank you.

$ ./create-binary-docker Not working on OSX

$ ./create-binary-docker gateway
Error: Exactly one module name needs to be provided
Usage: create-binary-docker [OPTS] <module_name>
  OPTS:
    -a|--arch <ARCH>           Choose architecture: amd64|arm
    -p|--prefix <Name Prefix>  Choose Docker image name prefix
    -e|--export                Export the Docker image to a file, after build

    -h|--help                  Show this help
    -v|--version               Show version information

  module_name:
    gateway | backend

Why my gateway can't register with backend ?

Describe the bug
I've follow the instructions on the OpenMTC docs to run the gateway & backend on my ubuntu.
But my gateway CAN'T registered to backend.
Does something i miss it ?
thx

###Setup###
[ Backend ]
docker run -ti --name backend -p 0.0.0.0:18000:18000 -e "ONEM2M_CSE_ID=backend" -e "ONEM2M_NOTIFICATION_DISABLED=false" openmtc/backend-amd64 -v

[Gateway]
docker run --name gateway -p 0.0.0.0:8000:8000 -e "EXTERNAL_IP=" -e "ONEM2M_HTTP_TRANSPORT_PORT=8000" -e "ONEM2M_CSE_ID=gw" -e "ONEM2M_REMOTE_CSE_POA=http://localhost:18000" -e "ONEM2M_REMOTE_CSE_ID=backend" -e "ONEM2M_NOTIFICATION_DISABLED=false" -e "ONEM2M_REGISTRATION_DISABLED=false" openmtc/gateway-amd64 -v
docker run openmtc/gateway-amd64

Screenshots
I've confirm that both have running on console
But the gateway console show the register error
Selection_001

Can not build docker container by using gateway Image on debian:jessie

I have used "./create-binary-docker gateway" command to build OpenMTC_gateway Image on debian:jessie. Then it return following error

Step 5/7 : RUN pip install --upgrade --requirement /tmp/requirements.txt
---> Running in cab3256162de
Downloading/unpacking urllib3 from https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl#sha256=06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b (from -r /tmp/requirements.txt (line 1))
Downloading/unpacking gevent>=1.0 (from -r /tmp/requirements.txt (line 2))
Running setup.py (path:/tmp/pip-build-FwbeYy/gevent/setup.py) egg_info for package gevent
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-FwbeYy/gevent/setup.py", line 406, in
run_setup(EXT_MODULES, run_make=_BUILDING)
File "/tmp/pip-build-FwbeYy/gevent/setup.py", line 390, in run_setup
"signal_os_incompat = gevent.monkey:_subscribe_signal_os",
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 262, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 603, in resolve
requirements = list(requirements)[::-1]
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements
"version spec")
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2697, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'")
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip-build-FwbeYy/gevent/setup.py", line 406, in

run_setup(EXT_MODULES, run_make=_BUILDING)

File "/tmp/pip-build-FwbeYy/gevent/setup.py", line 390, in run_setup

"signal_os_incompat = gevent.monkey:_subscribe_signal_os",

File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

_setup_distribution = dist = klass(attrs)

File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 262, in init

self.fetch_build_eggs(attrs['setup_requires'])

File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs

replace_conflicting=True,

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 603, in resolve

requirements = list(requirements)[::-1]

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements

"version spec")

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2697, in scan_list

raise ValueError(msg, line, "at", line[p:])

ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'")

when add "RUN pip install -U pip" command in to the sdk_amd64 file , above an error is gone.

After that, i have created container using that gateway image. Then it returned following error.

(docker run -it --rm --name gateway <image_id>)

Please give me hint to solve this issue

ERROR:openmtc_gevent.main:Error loading plugin HTTPTransportPlugin: No module named wsgi
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openmtc_gevent/main.py", line 96, in load_plugin
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 96, in import
result = _import(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openmtc_cse/plugins/transport_gevent_http/init.py", line 9, in
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 96, in import
result = _import(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openmtc_cse/plugins/transport_gevent_http/wsgi.py", line 9, in
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 96, in import
result = _import(*args, **kwargs)
ImportError: No module named wsgi
ERROR:openmtc_gevent.main:Error during startup
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openmtc_gevent/main.py", line 387, in main
File "/usr/local/lib/python2.7/dist-packages/openmtc_gevent/main.py", line 131, in load_plugins
File "/usr/local/lib/python2.7/dist-packages/openmtc_gevent/main.py", line 124, in load_plugin
Exception: Error loading plugin HTTPTransportPlugin: No module named wsgi

my docker version is mentioned below

Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:17:20 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:15:30 2018
OS/Arch: linux/amd64
Experimental: false

Thanks

[MUST] Roadmap is missing

A roadmap for the project for the short (3 months) , medium (one year) and long term should be added to the repository and publicly available.

Gateway Notification problems: CSETargetNotReachable

Describe the bug
I'm building a custom IPE for research purposes. I need to use the onem2m subscription mechanism to receive notification.
gateway Instantiated with:
docker run -d --name gateway -p 0.0.0.0:8000:8000 -e "LOGGING_LEVEL=DEBUG" -e "ONEM2M_NOTIFICATION_DISABLED=false" openmtc/gateway-amd64 -vv
Notification about the example provided in the documentation not work: https://github.com/OpenMTC/OpenMTC/blob/master/doc/subscription-notification.md

Gateway generate Notification, but unable to send it to XAE application (handler),
Gateway output provide this problem, after tha,t notification discarded: DEBUG:OneM2MMethodDomain:Handling CSETargetNotReachable:

Is there a solution?

docker start output:
Configuring M2M gateway...done DEBUG:openmtc_gevent.main:Trying config file location: /config-gateway.json DEBUG:openmtc_gevent.main:Trying config file location: /etc/openmtc/gevent/config-gateway.json DEBUG:openmtc_gevent.main:Reading config file: /etc/openmtc/gevent/config-gateway.json DEBUG:openmtc_gevent.main:Running OpenMTC DEBUG:rdflib:RDFLib Version: 4.2.2 INFO:GEventNetworkManager:GEventNetworkManager loaded DEBUG:openmtc_gevent.main:Initializing component: <openmtc_cse.transport.OneM2MTransportDomain object at 0x7f1f2ed5fef0> DEBUG:openmtc_gevent.main:Initializing component: <openmtc_cse.methoddomain.OneM2MMethodDomain object at 0x7f1f2ed5fe48> DEBUG:openmtc_gevent.main:Initializing component: <openmtc_gevent.GEventNetworkManager.GEventNetworkManager object at 0x7f1f2e158940> INFO:GEventNetworkManager:GEventNetworkManager initialized DEBUG:GEventTaskRunner:Adding task <bound method GEventNetworkManager.start_polling of <openmtc_gevent.GEventNetworkManager.GEventNetworkManager object at 0x7f1f2e158940>> to pool of size 200 DEBUG:GEventTaskRunner:Task added INFO:GEventNetworkManager:GEventNetworkManager started DEBUG:NoDB2Session:Adding resource to db: onem2m -> CSEBase(path='onem2m', id='cb0') (<class 'openmtc_onem2m.model.CSEBase'>) DEBUG:NoDB2Session:parent path: DEBUG:NoDB2Session:No parent found DEBUG:openmtc_onem2m.serializer.json:using simplejson for decoding JSON WARNING:openmtc_server.platform.gevent.ServerRack:Deprecated import DEBUG:HTTPTransportPlugin:Plugin HTTPTransportPlugin created with config {'interface': '::', 'require_cert': True, 'enable_https': False, 'onem2m': {'accept_insecure_certs': False, 'cse_type': 'MN-CSE', 'default_privileges': [{'accessControlOperations': [2, 32], 'accessControlOriginators': ['all']}], 'cse_id': 'mn-cse-1', 'overwrite_originator': {'originator': '/openmtc.org/mn-cse-1', 'enabled': False}, 'ssl_certs': {'ca': '/etc/openmtc/certs/ca-chain.cert.pem', 'crt': '/etc/openmtc/certs/mn-cse-1-client-server.cert.pem', 'key': '/etc/openmtc/certs/mn-cse-1-client-server.key.pem'}, 'sp_id': 'openmtc.org', 'cse_base': 'onem2m', 'dynamic_authorization': {'poa': [], 'enabled': False}}, 'port': 8000, 'global': {'disable_forwarding': False, 'additional_host_names': [], 'default_content_type': 'application/json', 'min_lifetime': datetime.timedelta(0, 5), 'max_lifetime': datetime.timedelta(1), 'require_auth': False, 'default_lifetime': datetime.timedelta(0, 2000)}} INFO:openmtc_gevent.main:Plugin MQTTTransportPlugin is disabled DEBUG:NotificationHandler:Plugin NotificationHandler created with config {'global': {'disable_forwarding': False, 'additional_host_names': [], 'default_content_type': 'application/json', 'min_lifetime': datetime.timedelta(0, 5), 'max_lifetime': datetime.timedelta(1), 'require_auth': False, 'default_lifetime': datetime.timedelta(0, 2000)}, 'onem2m': {'accept_insecure_certs': False, 'cse_type': 'MN-CSE', 'default_privileges': [{'accessControlOperations': [2, 32], 'accessControlOriginators': ['all']}], 'cse_id': 'mn-cse-1', 'overwrite_originator': {'originator': '/openmtc.org/mn-cse-1', 'enabled': False}, 'ssl_certs': {'ca': '/etc/openmtc/certs/ca-chain.cert.pem', 'crt': '/etc/openmtc/certs/mn-cse-1-client-server.cert.pem', 'key': '/etc/openmtc/certs/mn-cse-1-client-server.key.pem'}, 'sp_id': 'openmtc.org', 'cse_base': 'onem2m', 'dynamic_authorization': {'poa': [], 'enabled': False}}} INFO:openmtc_gevent.main:Plugin ExpirationTimeHandler is disabled INFO:openmtc_gevent.main:Plugin RegistrationHandler is disabled INFO:openmtc_gevent.main:Plugin AnnouncementHandler is disabled INFO:openmtc_gevent.main:Initializing plugins INFO:HTTPTransportPlugin:Initializing plugin HTTPTransportPlugin DEBUG:HTTPTransportPlugin:Plugin <openmtc_cse.plugins.transport_gevent_http.HTTPTransportPlugin object at 0x7f1f2dee6c18> is initialized INFO:NotificationHandler:Initializing plugin NotificationHandler DEBUG:NotificationHandler:Plugin <openmtc_cse.plugins.notification_handler.NotificationHandler object at 0x7f1f2dee6c88> is initialized INFO:openmtc_gevent.main:Starting plugins INFO:HTTPTransportPlugin:Starting plugin HTTPTransportPlugin DEBUG:OpenMTCWSGIApplication:All listening addresses: {'172.17.0.2', '127.0.0.1'} INFO:GEventServerRack:OpenMTCWSGIServer started on ('::', 8000, 0, 0) DEBUG:HTTPTransportPlugin:Plugin <openmtc_cse.plugins.transport_gevent_http.HTTPTransportPlugin object at 0x7f1f2dee6c18> is started INFO:NotificationHandler:Starting plugin NotificationHandler DEBUG:NotificationHandler:Plugin <openmtc_cse.plugins.notification_handler.NotificationHandler object at 0x7f1f2dee6c88> is started INFO:openmtc_gevent.main:OpenMTC is running DEBUG:GEventNetworkManager:polling started

Quick Start Guide Instructions are not working

Hello,

I am following the Quick Start guide (https://www.openmtc.org/doc.html).

I am able to clone the repository, build the gateway image but there is a problem running it.

First, I try to run:

$ sudo docker run -d --name gateway -p 0.0.0.0:8000:8000 -e "LOGGING_LEVEL=DEBUG" openmtc/gateway-amd64 -vv

Then, I execute $ sudo docker ps -a and I see that the gateway is not running.

I checked the log with $ sudo docker logs --follow gateway and the following appears:

gateway

The same happens with the backend image (after building it and running it):

backend

Can you help me please?

Thank you.

start-app.sh not working in macOS Catalina

Hello,

When I try to run $ ./start-app.sh the following appears:

error1

I ignored the readlink message and entered the number 2:

error2

but then an error appeared:

error3

Can you help me please?

Thank you.

exception when installing gateway

Dear Sir/Madam

I am trying to install OpenMTC gateway on ubuntu 18 using ./create-binary-docker gateway , but it through the following exception:

################################################################################

Building sdk-amd64 container...

Sending build context to Docker daemon 227.3kB
Step 1/8 : FROM openmtc/base-amd64:latest
---> 781d643d7e0e
Step 2/8 : ENV MOD_NAME=sdk
---> Running in c84bc729a9d8
Removing intermediate container c84bc729a9d8
---> a6e49c3b098c
Step 3/8 : MAINTAINER rst/tgu
---> Running in 6c21cbd5f46b
Removing intermediate container 6c21cbd5f46b
---> cf556c571e4f
Step 4/8 : RUN pip3 install --upgrade pip
---> Running in e65f35d4588e
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
self._validate_conn(conn)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in validate_conn
conn.connect()
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 323, in connect
ssl_context=context)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl
.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.5/ssl.py", line 385, in wrap_socket
_context=self)
File "/usr/lib/python3.5/ssl.py", line 760, in init
self.do_handshake()
File "/usr/lib/python3.5/ssl.py", line 996, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.5/ssl.py", line 641, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
Removing intermediate container e65f35d4588e
The command '/bin/sh -c pip3 install --upgrade pip' returned a non-zero code: 2

Building sdk-amd64 container failed. Exiting now.

################################################################################

Cleaning...done

################################################################################

Cannot find ch = [ ] attribute when i run gateway

I have installed openmtc gateway on Ubuntu 18.4 and Ubuntu 16.4, however I have experienced a problem.
I created the gateway using [ ./create-binary-docker gateway ] and run it using [ docker run -d --name gateway -p 0.0.0.0:8000:8000 openmtc/gateway-amd64:latest ] but when I run the command [ curl localhost:8000/onem2m -s | jq '.' ] I do not find a child attribute ( ch = [ ] , as indicated in the online webinar). as a result I cannot retrieve text using " latest " pointer.
##############################################################
~/OpenMTC$ curl localhost:8000/onem2m -s | jq '.'
{
"m2m:cb": {
"cst": 2,
"lbl": [],
"lt": "20191111T212055",
"ri": "cb0",
"ct": "20191111T212055",
"rn": "onem2m",
"csi": "/mn-cse-1",
"acpi": [],
"srt": [
24,
4,
3,
23,
2,
16,
5,
1
],
"nl": null,
"pi": null,
"poa": [
"http://172.17.0.2:8000",
"http://127.0.0.1:8000"
],
"ty": 5
}
}
#########################################################################

Could you please help me to fix this issue?

Thank you

Semantic Discovery

Hi,
I need a help about semantic discovery for Iot Sensors/Actuators. I want to register a sensor by using semantic part of oneM2M. I I try to create a resource for semantic descriptor by using your OpenMTC SDK, but I could not solve how to do it, did you implement this part of onem2m standard. I try to post json (including semantic descriptor, descriptor definition and base64 rdf data) to gateway but there is no response. Can you help me about semantic part of your implementation? thank you very much.

Installation

Im on mac version 10.14.2, docker is installed and i cant create a gateway image i dont know why i got this issue :
capture d ecran 2019-02-11 a 16 04 26

can someone help me with this please

IoT-data-visualization.py: socketio import failures

Describe the bug
Some modules import seem to incorrect with Python3 current socketio module:

vagrant@ubuntu1804:~/tmp/OpenMTC/doc/example-apps$ ./start-simple-app
[1] IoT-data-visualization.py
[2] simple-decision-2.py
[3] simple-decision.py
[4] data-aggregation.py
Choose the app to start: 1

PYTHONPATH: :/home/vagrant/tmp/OpenMTC/doc/../futile/src:/home/vagrant/tmp/OpenMTC/doc/../common/openmtc/lib:/home/vagrant/tmp/OpenMTC/doc/../common/openmtc-onem2m/src:/home/vagrant/tmp/OpenMTC/doc/../common/openmtc/src:/home/vagrant/tmp/OpenMTC/doc/../serializers/*/src:/home/vagrant/tmp/OpenMTC/doc/../openmtc-app/src
Traceback (most recent call last):
File "/home/vagrant/tmp/OpenMTC/doc/example-apps/IoT-data-visualization.py", line 5, in
from openmtc_app.onem2m import XAE
File "/home/vagrant/tmp/OpenMTC/openmtc-app/src/openmtc_app/onem2m.py", line 27, in
from openmtc_app.flask_runner import FlaskRunner
File "/home/vagrant/tmp/OpenMTC/openmtc-app/src/openmtc_app/flask_runner/init.py", line 8, in
from socketio import Server as SioServer, Middleware as SioMiddleware
ImportError: cannot import name 'Server'

Desktop (please complete the following information):
Linux ubuntu1804.localdomain 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Python 3.6.9

ImportError: cannot import name Server

Hi @ronald-steinke

when ran ./doc/training/start-app.sh script and select 'onem2m-ipe-sensors-final.py' , it returned following error
ImportError: No module named iso8601
it was solved by running 'pip install iso8601'

after ran first script again. it returned following error
ImportError: No module named geventwebsocket.handler
it was solved by running 'pip install gevent-websocket'

after ran first script again. it returned following error
ImportError: No module named socketio
it was solved by running 'pip install socketio'

after ran first script again. it returned following error

Traceback (most recent call last):
File "/home/privacy/src/OpenMTC/doc/training/apps/onem2m/ipe/sensors/onem2m-ipe-sensors-final.py", line 7, in
from openmtc_app.onem2m import XAE
File "/home/privacy/src/OpenMTC/openmtc-app/src/openmtc_app/onem2m.py", line 27, in
from openmtc_app.flask_runner import FlaskRunner
File "/home/privacy/src/OpenMTC/openmtc-app/src/openmtc_app/flask_runner/init.py", line 8, in
from socketio import Server as SioServer, Middleware as SioMiddleware
ImportError: cannot import name Server

give me hint to solve this

Regards
Janaka

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.