absmach / magistrala Goto Github PK
View Code? Open in Web Editor NEWIndustrial IoT Messaging and Device Management Platform
Home Page: https://www.abstractmachines.fr/magistrala.html
License: Apache License 2.0
Industrial IoT Messaging and Device Management Platform
Home Page: https://www.abstractmachines.fr/magistrala.html
License: Apache License 2.0
Add service discovery to Mainflux microservices - evaluate Consul
and etcd
and choose right candidate. Since Kubernetes uses it's version of etcd
inaccessible by applications, it is irrelevant for K8 deployments if we choose Consul or etcd. Probably Consul would be better candidate here, due to the popularity and ease of use.
pi@raspberrypi:~/mainflux $ sudo docker-compose up
Starting mainflux-mongodb
Starting mainflux-emqttd
Starting mainflux-server
Attaching to mainflux-emqttd, mainflux-mongodb, mainflux-server
mainflux-mongodb | panic: standard_init_linux.go:175: exec user process caused "exec format error" [recovered]
mainflux-mongodb | panic: standard_init_linux.go:175: exec user process caused "exec format error"
mainflux-mongodb |
mainflux-mongodb | goroutine 1 [running, locked to thread]:
mainflux-mongodb | panic(0x3339c8, 0x56e3b9c0)
mainflux-mongodb | /usr/local/go/src/runtime/panic.go:481 +0x330
mainflux-mongodb | github.com/urfave/cli.HandleAction.func1(0x56e95958)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x328
mainflux-mongodb | panic(0x3339c8, 0x56e3b9c0)
mainflux-mongodb | /usr/local/go/src/runtime/panic.go:443 +0x448
mainflux-mongodb | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0x56e955e0, 0x56dc02a0, 0x56e95668)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x13c
mainflux-mongodb | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0x56e3c2a0, 0x464264b8, 0x56e3b9c0)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x498
mainflux-mongodb | main.glob.func8(0x56e4a1e0, 0x0, 0x0)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/main_unix.go:26 +0x58
mainflux-mongodb | reflect.Value.call(0x2e90f8, 0x3efd4c, 0x13, 0x362250, 0x4, 0x56e95918, 0x1, 0x1, 0x0, 0x0, ...)
mainflux-mongodb | /usr/local/go/src/reflect/value.go:435 +0xeb4
mainflux-mongodb | reflect.Value.Call(0x2e90f8, 0x3efd4c, 0x13, 0x56e95918, 0x1, 0x1, 0x0, 0x0, 0x0)
mainflux-mongodb | /usr/local/go/src/reflect/value.go:303 +0x84
mainflux-mongodb | github.com/urfave/cli.HandleAction(0x2e90f8, 0x3efd4c, 0x56e4a1e0, 0x0, 0x0)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x230
mainflux-mongodb | github.com/urfave/cli.Command.Run(0x364678, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ce288, 0x51, 0x0, ...)
mainflux-emqttd | panic: standard_init_linux.go:175: exec user process caused "exec format error" [recovered]
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xcd0
mainflux-mongodb | github.com/urfave/cli.(*App).Run(0x56e26240, 0x56e08050, 0x2, 0x2, 0x0, 0x0)
mainflux-mongodb | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x84c
mainflux-emqttd | panic: standard_init_linux.go:175: exec user process caused "exec format error"
mainflux-mongodb | main.main()
mainflux-emqttd |
mainflux-mongodb | /go/src/github.com/opencontainers/runc/main.go:137 +0xbb4
mainflux-emqttd | goroutine 1 [running, locked to thread]:
mainflux-emqttd | panic(0x3339c8, 0x56ed5900)
mainflux-emqttd | /usr/local/go/src/runtime/panic.go:481 +0x330
mainflux-emqttd | github.com/urfave/cli.HandleAction.func1(0x56f05958)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x328
mainflux-emqttd | panic(0x3339c8, 0x56ed5900)
mainflux-emqttd | /usr/local/go/src/runtime/panic.go:443 +0x448
mainflux-emqttd | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0x56f055e0, 0x56e422d0, 0x56f05668)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x13c
mainflux-emqttd | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0x56ebc300, 0x464a84b8, 0x56ed5900)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x498
mainflux-emqttd | main.glob.func8(0x56eb6320, 0x0, 0x0)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/main_unix.go:26 +0x58
mainflux-emqttd | reflect.Value.call(0x2e90f8, 0x3efd4c, 0x13, 0x362250, 0x4, 0x56f05918, 0x1, 0x1, 0x0, 0x0, ...)
mainflux-emqttd | /usr/local/go/src/reflect/value.go:435 +0xeb4
mainflux-emqttd | reflect.Value.Call(0x2e90f8, 0x3efd4c, 0x13, 0x56f05918, 0x1, 0x1, 0x0, 0x0, 0x0)
mainflux-emqttd | /usr/local/go/src/reflect/value.go:303 +0x84
mainflux-emqttd | github.com/urfave/cli.HandleAction(0x2e90f8, 0x3efd4c, 0x56eb6320, 0x0, 0x0)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x230
mainflux-emqttd | github.com/urfave/cli.Command.Run(0x364678, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ce288, 0x51, 0x0, ...)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xcd0
mainflux-emqttd | github.com/urfave/cli.(*App).Run(0x56ea8240, 0x56e8a050, 0x2, 0x2, 0x0, 0x0)
mainflux-emqttd | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x84c
mainflux-emqttd | main.main()
mainflux-server | panic: standard_init_linux.go:175: exec user process caused "exec format error" [recovered]
mainflux-emqttd | /go/src/github.com/opencontainers/runc/main.go:137 +0xbb4
mainflux-server | panic: standard_init_linux.go:175: exec user process caused "exec format error"
mainflux-server |
mainflux-server | goroutine 1 [running, locked to thread]:
mainflux-server | panic(0x3339c8, 0x56dd5c80)
mainflux-server | /usr/local/go/src/runtime/panic.go:481 +0x330
mainflux-server | github.com/urfave/cli.HandleAction.func1(0x56e7d958)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x328
mainflux-server | panic(0x3339c8, 0x56dd5c80)
mainflux-server | /usr/local/go/src/runtime/panic.go:443 +0x448
mainflux-server | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0x56e7d5e0, 0x56da8258, 0x56e7d668)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x13c
mainflux-server | github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0x56dd62a0, 0x4640e490, 0x56dd5c80)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x498
mainflux-server | main.glob.func8(0x56e241e0, 0x0, 0x0)
mainflux-server | /go/src/github.com/opencontainers/runc/main_unix.go:26 +0x58
mainflux-server | reflect.Value.call(0x2e90f8, 0x3efd4c, 0x13, 0x362250, 0x4, 0x56e7d918, 0x1, 0x1, 0x0, 0x0, ...)
mainflux-server | /usr/local/go/src/reflect/value.go:435 +0xeb4
mainflux-server | reflect.Value.Call(0x2e90f8, 0x3efd4c, 0x13, 0x56e7d918, 0x1, 0x1, 0x0, 0x0, 0x0)
mainflux-server | /usr/local/go/src/reflect/value.go:303 +0x84
mainflux-emqttd exited with code 2
mainflux-server | github.com/urfave/cli.HandleAction(0x2e90f8, 0x3efd4c, 0x56e241e0, 0x0, 0x0)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x230
mainflux-mongodb exited with code 2
mainflux-server | github.com/urfave/cli.Command.Run(0x364678, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ce288, 0x51, 0x0, ...)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xcd0
mainflux-server | github.com/urfave/cli.(*App).Run(0x56e16240, 0x56df0050, 0x2, 0x2, 0x0, 0x0)
mainflux-server | /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x84c
mainflux-server | main.main()
mainflux-server | /go/src/github.com/opencontainers/runc/main.go:137 +0xbb4
mainflux-server exited with code 2
Hi,
I stared "playing" with Mainflux and when I was checking the contributing guide and I saw that the link to the javascript guidelines is dead.
Can someone please take a look at it?
Suggestion:
For the JavaScript/Node projects the pre-commit can be used to run a style check with automatic corrections and eventually the unit tests if there are any. This package attaches a pre-commit hook and blocks the committing to the repo if some of the checks (run scripts) .
This way it can be assured that the code is always well formatted, the unit tests pass, a linter is run and code coverage is checked.
Best Regards,
Jovan
I think we can bump up nodejs docker version here: https://github.com/Mainflux/mainflux/blob/master/Dockerfile#L6. I can see here: https://hub.docker.com/_/node/ that latest is 4.1.2
EMQTT (http://emqtt.io/) looks like very interesting potential replacement for NATS.
Reasons are following:
mainflux-http-server
) and mainflux-core-server
in the back this set-up should practically work out-of-the-boxWe need to examine:
emqtt
plugins to use (HTTP connection with Hydra?)Based on this: https://groups.google.com/forum/#!topic/rethinkdb/Iax_-VPmUuQ, and also on https://github.com/Mainflux/mainflux/issues/55 and https://github.com/Mainflux/mainflux/issues/53 (Hydra uses RethinkDB), we need to evaluate it and see how it fits in Mainflux system.
Opening this issue so we can track observations.
Should we shoot channel Messages (https://github.com/mainflux/mainflux-core/blob/master/models/message.go) into InfluxDB?
followed normal installation instructions for docker.
this is the last few lines of the output
there was no error from starting other containers
mainflux-core | == Industrial IoT System ==
mainflux-core |
mainflux-core | Made with <3 by Mainflux Team
mainflux-core | [w] http://mainflux.io
mainflux-core | [t] @mainflux
mainflux-core |
mainflux-core | Magic happens on port 7070
mainflux-core | [negroni] Started GET /
mainflux-core | [negroni] Completed 404 Not Found in 72.1µs
mainflux-core | [negroni] Started GET /favicon.ico
and then i get 404 error, what could the reason be?
PowerMac
Windows 10
Docker compose up command
latest git clonable version
Adapters should not try to normalize SenML - they must forward "as-is" messages to NATS for other adapters to re-publish them to their subscribers.
Also, new microservice that normalizes SenML should be created as NodeJS does not have appropriate SenML processing libraries.
Finally, normalizes SenML should also be published on a separate topic, fro message-writer
to consume it (as it expects a array of normalized SenML messages).
Current Go Reports are pretty bad: https://goreportcard.com/report/github.com/Mainflux/mainflux-core-server
We need to lint the code and correct it.
We need CI!
Go through Dockerfile
and docker-compose.yml
and correct/test.
Ex composition/config is here: https://github.com/Mainflux/depricated-mainflux.
We need Emqttd docker (plus config) working also here.
Docker images are used for production:
--production
flag here: https://github.com/Mainflux/mainflux/blob/master/Dockerfile#L23 to avoid installing Node devDependencies
.Plase fill-in docker-compose
documentation for building Mainflux Docker image and running Docker containers here: https://github.com/Mainflux/mainflux/wiki/Docker.
Add traces from the console for informative doc.
Hi,
My problem is about mainflux-ui. More precisely, i cannt run the UI due to the following error:
Can some one help me how can i fix this?
siavash@ubuntu:~/Desktop/Mainflux/mainflux-ui$ sudo ng serve
[sudo] password for siavash:
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **
Date: 2017-08-15T09:59:04.143Z
Hash: 67952886eeacdc6b6f7f
Time: 86139ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 53 kB {vendor} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 87.8 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 5.11 MB [initial] [rendered]
ERROR in /home/siavash/Desktop/Mainflux/mainflux-ui/node_modules/@angular/cdk/typings/rxjs/rx-operators.d.ts (11,10): Module '"/home/siavash/Desktop/Mainflux/mainflux-ui/node_modules/rxjs/Scheduler"' has no exported member 'IScheduler'.
webpack: Failed to compile.
It would be great to remove NATS and bundle mainflux-http-server
and mainflux-core-server
in one monolith binary. This will greatly simplify things for development and testing (prototyping) deployments.
We could also remove InfluxDB from this binary and replace it by MongoDB for time-series data - so that we have just one DB with two collections (devices
and data
).
Migrate all Mainflux repos under a single umbrella repo - this one (mainflux/mainflux
).
A command line interface should be developed so we can test HTTP/MQTT and other protocol access. CLI program should be capable to send all commands to the Mainflux system that we are currently sending with curl
or Postman.
Træfɪk is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease. It supports several backends (Docker, Swarm, Mesos/Marathon, Consul, Etcd, Zookeeper, BoltDB, Rest API, file...) to manage its configuration automatically and dynamically.
http://blog.hypriot.com/post/microservices-bliss-with-docker-and-traefik/
We need to select package manager in order to fetch and version-lock vendor dependencies of Mainflux.. Glide seems to be choice of many: https://github.com/Masterminds/glide
Useful link: https://github.com/golang/go/wiki/PackageManagementTools
Some Mainflux servers have been rewritten in Go. Dockerfiles have to be corrected to take into account new approach.
I was using tutorial for running mainflux from here : http://mainflux.io/getting-started/#installation
Mainflux is running after "docker-compose up" but I can't get provisioning for device.
macbook-pro-de-uros-2-1:~ ukicar$ curl -s -S -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:7070/devices | json | pygmentize -l json HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 Location: /devices/9bd13b96-5eaa-42ca-8b5b-1a8e835f9b07 Date: Thu, 13 Apr 2017 10:47:50 GMT Content-Length: 0
I'm not getting response from server, content-length is zero. Please help
When I tried this curl request as given in the tutorial, I got the output as follow:
Curl request:
curl -s -S -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:7070/channels/fca48fe1-672a-424c-b219-a4fa6d62cc07/msg -d '[{"bn":"some-base-name:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3987}]'
Output:
mainflux-core | [negroni] Started POST /channels/fca48fe1-672a-424c-b219-a4fa6d62cc07/msg
mainflux-core | Msg written
mainflux-core | [negroni] Completed 202 Accepted in 1.057578ms
mainflux-mqtt | Received a message: {"topic":"mainflux/channels/fca48fe1-672a-424c-b219-a4fa6d62cc07","publisher":"","payload":"W3siYm4iOiJzb21lLWJhc2UtbmFtZToiLCJidCI6MS4yNzYwMjAwNzYwMDFlKzA5LCAiYnUiOiJBIiwiYnZlciI6NSwgIm4iOiJ2b2x0YWdlIiwidSI6IlYiLCJ2IjoxMjAuMX0sIHsibiI6ImN1cnJlbnQiLCJ0IjotNSwidiI6MS4yfSwgeyJuIjoiY3VycmVudCIsInQiOi00LCJ2IjoxLjN9XQ=="}
mainflux-mqtt | /opt/mainflux-mqtt/mainflux-mqtt.js:86
mainflux-mqtt | payload: Buffer.from(atob(m.payload)),
mainflux-mqtt | ^
mainflux-mqtt |
mainflux-mqtt | TypeError: this is not a typed array.
mainflux-mqtt | at Function.from (native)
mainflux-mqtt | at Object.callback (/opt/mainflux-mqtt/mainflux-mqtt.js:86:19)
mainflux-mqtt | at Client.processMsg (/opt/mainflux-mqtt/node_modules/nats/lib/nats.js:892:11)
mainflux-mqtt | at Client.processInbound (/opt/mainflux-mqtt/node_modules/nats/lib/nats.js:824:14)
mainflux-mqtt | at Socket.<anonymous> (/opt/mainflux-mqtt/node_modules/nats/lib/nats.js:421:12)
mainflux-mqtt | at emitOne (events.js:77:13)
mainflux-mqtt | at Socket.emit (events.js:169:7)
mainflux-mqtt | at readableAddChunk (_stream_readable.js:146:16)
mainflux-mqtt | at Socket.Readable.push (_stream_readable.js:110:10)
mainflux-mqtt | at TCP.onread (net.js:523:20)
mainflux-mqtt | 2017/01/16 10:59:18 Command exited with error: exit status 1
mainflux-mqtt exited with code 1
I tried the request with Postman (chrome extension) and got the same result. I have to restart the docker instance to get the mqtt up and running again. What might be the reason behind this? Thanks for all the help in advance.
ERROR: for mainflux-mqtt Cannot start service mainflux-mqtt: driver failed programming external connectivity on endpoint mainflux-mqtt (37bf8034f6690e18a6ea95b7ed30d60e6726b369aa8cc02ed5e5c62cf745a070): Error starting userland proxy: listen tcp 0.0.0.0:1883: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Cloned on May 30th 2017
[root@samgps mainflux]# docker-compose up
Starting mainflux-mongodb
Starting mainflux-emqttd
Starting mainflux-server
Attaching to mainflux-emqttd, mainflux-mongodb, mainflux-server
mainflux-server | panic: Network Error : dial tcp [::1]:1883: getsockopt: connection refused
mainflux-server |
mainflux-server | goroutine 1 [running]:
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=18a7c813e3d5
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] db version v3.2.10
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] git version: 79d9b3ab5ce20f51c272b4411202710a082d0317
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016
mainflux-server | panic(0x701f40, 0xc420166e60)
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] allocator: tcmalloc
mainflux-server | /usr/local/go/src/runtime/panic.go:500 +0x1a1
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] modules: none
mainflux-server | github.com/mainflux/mainflux/clients.(*MqttConn).MqttSub(0xc42013dee0)
mainflux-mongodb | 2016-10-17T14:52:18.119+0000 I CONTROL [initandlisten] build environment:
mainflux-server | /go/src/github.com/mainflux/mainflux/clients/mqtt_client.go:61 +0x322
mainflux-mongodb | 2016-10-17T14:52:18.120+0000 I CONTROL [initandlisten] distmod: debian81
mainflux-server | main.main()
mainflux-mongodb | 2016-10-17T14:52:18.120+0000 I CONTROL [initandlisten] distarch: x86_64
mainflux-server | /go/src/github.com/mainflux/mainflux/main.go:126 +0x928
mainflux-mongodb | 2016-10-17T14:52:18.120+0000 I CONTROL [initandlisten] target_arch: x86_64
mainflux-mongodb | 2016-10-17T14:52:18.120+0000 I CONTROL [initandlisten] options: { storage: { journal: { enabled: false }, mmapv1: { smallFiles: true } } }
mainflux-mongodb | 2016-10-17T14:52:18.139+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mainflux-mongodb | 2016-10-17T14:52:18.139+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=13G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),,log=(enabled=false),
mainflux-mongodb | 2016-10-17T14:52:18.351+0000 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
mainflux-mongodb | 2016-10-17T14:52:18.351+0000 I CONTROL [initandlisten]
mainflux-mongodb | 2016-10-17T14:52:18.351+0000 I CONTROL [initandlisten] ** WARNING: You are running on a NUMA machine.
mainflux-mongodb | 2016-10-17T14:52:18.351+0000 I CONTROL [initandlisten] ** We suggest launching mongod like this to avoid performance problems:
mainflux-mongodb | 2016-10-17T14:52:18.351+0000 I CONTROL [initandlisten] ** numactl --interleave=all mongod [other options]
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten]
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten]
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
mainflux-mongodb | 2016-10-17T14:52:18.352+0000 I CONTROL [initandlisten]
mainflux-mongodb | 2016-10-17T14:52:18.353+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mainflux-mongodb | 2016-10-17T14:52:18.353+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
mainflux-mongodb | 2016-10-17T14:52:18.354+0000 I NETWORK [initandlisten] waiting for connections on port 27017
mainflux-mongodb | 2016-10-17T14:52:18.476+0000 I NETWORK [initandlisten] connection accepted from 172.17.0.4:33071 #1 (1 connection now open)
mainflux-mongodb | 2016-10-17T14:52:18.495+0000 I NETWORK [conn1] end connection 172.17.0.4:33071 (0 connections now open)
mainflux-server exited with code 2
mainflux-emqttd | emqttd is started successfully!
mainflux-emqttd | emqttd_auth_http
mainflux-emqttd | RPC to '[email protected]' failed: {'EXIT',
mainflux-emqttd | {badarg,
mainflux-emqttd | [{ets,match,
mainflux-emqttd | [mqttd_ctl_cmd,{{'_',plugins},'$1','_'}],
mainflux-emqttd | []},
mainflux-emqttd | {emqttd_ctl,lookup,1,
mainflux-emqttd | [{file,"src/emqttd_ctl.erl"},{line,78}]},
mainflux-emqttd | {emqttd_ctl,run,1,
mainflux-emqttd | [{file,"src/emqttd_ctl.erl"},{line,70}]},
mainflux-emqttd | {rpc,'-handle_call_call/6-fun-0-',5,
mainflux-emqttd | [{file,"rpc.erl"},{line,206}]}]}}
mainflux-emqttd exited with code 1
Please evaluate Chakram for REST testing. It is build on Mocha.
Should we use this or Mocha will be enough?
Equally, please explore alternatives. Example: http://www.macwright.org/2014/03/11/tape-is-cool.html
Proposition is to connect LoRa Server: https://github.com/brocaar/loraserver with Mainflux server.
When we observe this picture: https://camo.githubusercontent.com/1b77c3663a5f695f488d2e30d87a7e42dde00109/68747470733a2f2f7777772e676c696666792e636f6d2f676f2f7075626c6973682f696d6167652f31313031303333392f4c2e706e67 Mainflux will come in the place here where is an "application" (the little cloud on the bottom right).
But for lora-app-server
to talk to Mainflux we need to insert a small adapter (server) between them that will translate from one API to another.
I think best option will be to use an additional MQTT broker and just process MQTT pubs, redirecting them to appropriate endpoints.
Add a time frame to channels api
To request http://<mainfluxServer>:7070/channels/<channelId>?filter:starttime=xxxxx,endtime=yyyyy
This should return a json with from channel id with entries only in the time frame given in the api
We need to find and implement TDD strategy for our Go servers.
Starting point: https://golang.org/pkg/testing/
We need testing platform!
Mainflux Core has no auth whatsoever, and is protected by mainflux-auth service.
PEP Proxy sits behind load balancer, itercepts all requests and sends them on check towareds mainflux-auth
. Only if they pass the check, PEP Proxy redirects them towards mainflux-core
.
Some info about Reverse Proxy in Go:
Based on this: https://npf.io/2014/08/intro-to-toml/ it is worth thinking of switching from current YAML to TOML.
BurtnSushi's TOML decorer: https://github.com/BurntSushi/toml is simpler than Viper: https://github.com/spf13/viper
Investigation is needed, I am not sure that this is needed in this moment, but might be interesting to look at.
BUG REPORT
What were you trying to achieve?
Create user
What are the expected results?
Location header with user UUID
What are the received results?
drasko@Marx:~/go/src/github.com/mainflux/mainflux/cmd/manager$ go run main.go
{"start":"manager","ts":"2017-09-24T02:08:36.020454561Z"}
{"http_port":8180,"ts":"2017-09-24T02:08:36.036257545Z"}
{"email":"[email protected]","error":"email already taken","method":"register","took":"96.534049ms","ts":"2017-09-24T02:09:36.875275927Z"}
2017/09/24 04:09:36 http: panic serving [::1]:58866: inconsistent label cardinality
goroutine 45 [running]:
net/http.(*conn).serve.func1(0xc420206000)
/usr/local/go/src/net/http/server.go:1697 +0xd0
panic(0x783b20, 0xc42007ee50)
/usr/local/go/src/runtime/panic.go:491 +0x283
github.com/mainflux/mainflux/vendor/github.com/prometheus/client_golang/prometheus.(*MetricVec).With(0xc4201868c0, 0xc42017ab70, 0xc4201923e8, 0x0)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/prometheus/client_golang/prometheus/vec.go:146 +0x76
github.com/mainflux/mainflux/vendor/github.com/prometheus/client_golang/prometheus.(*CounterVec).With(0xc42017c038, 0xc42017ab70, 0x2, 0xc42017ab70)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/prometheus/client_golang/prometheus/counter.go:145 +0x38
github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics/prometheus.(*Counter).Add(0xc4201a4f00, 0x3ff0000000000000)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics/prometheus/prometheus.go:45 +0x5c
github.com/mainflux/mainflux/manager/api.(*metricService).Register.func1(0xc42017a330, 0xbe69e2d82e6aa02f, 0xe25929963, 0xa13440)
/home/drasko/go/src/github.com/mainflux/mainflux/manager/api/metrics.go:30 +0xb9
github.com/mainflux/mainflux/manager/api.(*metricService).Register(0xc42017a330, 0xc4201e8240, 0x12, 0xc4201806f0, 0x3, 0x9d5fc0, 0xc42007f340)
/home/drasko/go/src/github.com/mainflux/mainflux/manager/api/metrics.go:34 +0xcf
github.com/mainflux/mainflux/manager/api.registrationEndpoint.func1(0x9dc740, 0xc420186e80, 0x7a7000, 0xc4201a4d80, 0xc4201a4d80, 0x0, 0x0, 0x7c2f40)
/home/drasko/go/src/github.com/mainflux/mainflux/manager/api/endpoint.go:13 +0x73
github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/transport/http.Server.ServeHTTP(0xc420174900, 0x819d78, 0x819d98, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x819d90, ...)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/transport/http/server.go:108 +0x338
github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/transport/http.(*Server).ServeHTTP(0xc42014ed90, 0x9dbf80, 0xc4201840e0, 0xc4201b8b00)
<autogenerated>:1 +0x94
github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone.(*Route).parse(0xc4200a15e0, 0x9dbf80, 0xc4201840e0, 0xc4201b8b00, 0xc4200ce8c8)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone/route.go:148 +0x119
github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone.(*Mux).parse(0xc4201728a0, 0x9dbf80, 0xc4201840e0, 0xc4201b8b00, 0x7e6280)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone/helper.go:18 +0xb9
github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone.(*Mux).ServeHTTP(0xc4201728a0, 0x9dbf80, 0xc4201840e0, 0xc4201b8b00)
/home/drasko/go/src/github.com/mainflux/mainflux/vendor/github.com/go-zoo/bone/bone.go:43 +0x4d
net/http.serverHandler.ServeHTTP(0xc4202025b0, 0x9dbf80, 0xc4201840e0, 0xc4201b8b00)
/usr/local/go/src/net/http/server.go:2619 +0xb4
net/http.(*conn).serve(0xc420206000, 0x9dc740, 0xc420186d80)
/usr/local/go/src/net/http/server.go:1801 +0x71d
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2720 +0x288
curl -s -S -i -X POST -H "Content-Type: application/senml+json" localhost:8180/users -d '{"email":"[email protected]", "password":"123"}'
Hi,
I got this error when I want to install mainflux with docker. Whats the reason?
ERROR: repository mainflux/message-writer not found: does not exist or no pull access
Thanks
Starting NATS, Cassandra and Nginx...
Starting nats ... done
Starting cassandra ... done
Waiting for Cassandra to start. This takes time, please be patient...
.............OK
Starting Mainflux composition...
Pulling mqtt-adapter (mainflux/mqtt-adapter:latest)...
latest: Pulling from mainflux/mqtt-adapter
Digest: sha256:d17b25a10c1f5ad53d8865ceb714bca29e7f9179a4275596fa4ccaa25f577422
Status: Image is up to date for mainflux/mqtt-adapter:latest
Pulling manager (mainflux/manager:latest)...
latest: Pulling from mainflux/manager
Digest: sha256:8119f293e2c275df2c7008d1ab9db9fbdec6ea3ff59789f2c619d662bfba5543
Status: Image is up to date for mainflux/manager:latest
Pulling message-writer (mainflux/message-writer:latest)...
ERROR: repository mainflux/message-writer not found: does not exist or no pull access
Aborting due to errexit on line 122. Exit code: 1
Starting mqtt-adapter ... done
Starting manager ... done
Starting message-writer ... done
Starting http-adapter ... done
Starting Nginx...
Starting nginx ... done
ERROR: No containers to start
Aborting due to errexit on line 136. Exit code: 1
Stopping Nginx...
Stopping Mainflux composition...
Stopping mainflux-http ... done
Stopping mainflux-message-writer ... done
Stopping NATS and Cassandra...
Stopping mainflux-cassandra ... done
Stopping mainflux-nats ... done
*** MAINFLUX IS OFF ***
Deploy Mainflux system in Minikube: https://github.com/kubernetes/minikube and provide all deployment scripts and instructions.
https://github.com/ory-am/ladon
Can it be usefull to us or is it overkill?
Can this be used for one user to share his device with some other user (creating a group of users who have access to this DeviceID resource or just giving the user access to this resource without grouping them).
We need identity
API endpoint which verifies the token and decodes clientId
from it and sends it as a response.
Other services (MQTT broker for example) will use this to check username/password that device provides on connection.
After I docker-compose up, the micro services are started running. I can see the 'mainflux' welcome text logo. However, I am getting the following error,
Error: Uncaught, unspecified "error" event. (Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:4222)
mainflux-ws | at Client.emit (events.js:144:17)
mainflux-ws | at Socket. (/mainflux-ws/node_modules/nats/lib/nats.js:389:14)
mainflux-ws | at emitOne (events.js:77:13)
mainflux-ws | at Socket.emit (events.js:169:7)
mainflux-ws | at emitErrorNT (net.js:1253:8)
mainflux-ws | at doNTCallback2 (node.js:441:9)
mainflux-ws | at process._tickCallback (node.js:355:17)
mainflux-ws | [09:53:57] [nodemon] app crashed - waiting for file changes before starting...
Also not sure how to view/access IOT platform on the browser. No such getting started document available on the wiki page.
TIA,
Prakash.
Dashflux needs CORS support for dev.
Based on these articles:
https://www.dougcodes.com/go-lang/gin-gonic-may-be-40x-faster-than-martini-but-it-is-not-better
https://stephensearles.com/three-reasons-you-should-not-use-martini/
https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/
https://www.dougcodes.com/go-lang/martini-to-gin-back-to-martini-and-on-to-negroni-and-mux
https://github.com/urfave/negroni
http://0xdabbad00.com/2015/04/03/choosing_libraries_for_go_web_servers/
https://www.peterbe.com/plog/my-favorite-go-multiplexer
http://stackoverflow.com/questions/15240884/how-can-i-handle-http-requests-of-different-methods-to-in-go
http://stackoverflow.com/questions/16512009/how-to-extract-the-post-arguments-in-go-server
I am inclined to believe that Iris can be overkill that adds complexity (especially for testing) and is not Go idiomatic.
To get lean and Go idiomatic I propose use use of standard library as much as possible, especially that we are not building full stack here.
Standard lib seems to be a bit too lean regarding the multiplexer - you would switch on r.Method()
inside the handler to discover if it was GET or POST for example (http://stackoverflow.com/questions/15240884/how-can-i-handle-http-requests-of-different-methods-to-in-go)
I prefer that simple look at one portion of router code tell us the handlers, so adding small idiomatic mux would be OK. Based on this I started implementation with Bone, but this can be easily inter-changed with Gorilla Mux.
Eventual addition of Negroni later can give us access to middlewares (if we evealute that it is needed)
MQTT Auth should be implemented - device auth token to be sent to manager
service for auth on every CONNECT or PUB/SUB.
Once https://github.com/Mainflux/mainflux/issues/47 is resolved we should activate Travis CI build so that tests can be run on every PR.
We need a small tool that connects to NATS and dumps the messages (probably NATS can do this), and also sends messages to NATS.
This is needed for debugging one server at the time. I.e. for debugging HTTP server we can receive REQs and send RSPs via this tool without the need to launch the whole composition with `core server, databases, etc...
Hydra looks as very well written OAuth2 and RBAC + Access Policy server: https://blog.gopheracademy.com/advent-2015/hydra-auth/
Code seems well maintained, tests are written.
Looks like a great candidate for Mainflux Auth Server. We need to evaluate it and eventually integrate it.
MVP of Dashflux - Mainflux UI: https://github.com/mainflux/dashflux is needed ASAP. Angular 4 based admin dashboard to provision and manage devices and apps. Help wanted.
New Go servers have to take some ENV config (devel, deployment, testing...). docker-compose.yml
has to be corrected to properly share selected directories from local machine into the Docker containers.
In general re-write and test of docker-compose.yml
is needed.
An easy deployment button should be added to the project's README.md
similar to this: https://docs.docker.com/docker-cloud/apps/deploy-to-cloud-btn/
Inspiration comes from here: https://github.com/RocketChat/Rocket.Chat#deployment
Meshblu adds also "Install on Digital Ocean" button, which would be great for us: https://github.com/octoblu/meshblu#digitalocean
This post mentiones Letsencrypt: https://evothings.com/evothings-does-mqtt-with-vernemq-or-emqtt/.
https://letsencrypt.org/ offers free TLS certificates.
Iris has a support: https://github.com/iris-contrib/examples/blob/master/letsencrypt/main.go#L17.
Basically, this function: https://github.com/kataras/iris/blob/master/iris.go#L515 callhs the function here: https://github.com/kataras/iris/blob/master/http.go#L406 which uses the code from this packet here: https://github.com/iris-contrib/letsencrypt
This has to be researched and we need to enable TLS on in Iris.
We should be capable to change configs in docker-compose
file. For this to be propagated into Docker best place IMHO is ENV.
We can take Hyperledger Fabric example. Here is docker-compose
that starts node app: https://github.com/hyperledger/fabric/blob/master/examples/sdk/node/docker-compose.yml
What's interesting to note here is that not only ENV is defined in docker-compose
, but command is pased from there also: https://github.com/hyperledger/fabric/blob/master/examples/sdk/node/docker-compose.yml#L45. This is because Dockerfile does only installation: https://github.com/hyperledger/fabric/blob/master/examples/sdk/node/Dockerfile and never executes command in the end.
This is nice way to change the way you are deploying app (i.e. command line parameters that you are passing) and not have then hard-coded in the Docker image.
Current device
model (https://github.com/Mainflux/mainflux-lite/blob/master/models/device.go, https://github.com/Mainflux/mainflux-lite/blob/master/models/deviceTemplate.json) has no reference to channel
s created for this device - only channel
holds the referenced device Device
ID: https://github.com/Mainflux/mainflux-lite/blob/master/models/channel.go, https://github.com/Mainflux/mainflux-lite/blob/master/models/channelTemplate.json
channel
is accessed as localhost:7070/devices/<device_id>/channels/<channel_id>
. When DELETE is issued on this URI, channel will be deleted. However - when DELETE is issued on localhost:7070/devices/<device_id>
only device will be deleted, but not the channels that belog to this device - and we will not be able to access them anymore (since we will not have ID of the device anymore).
Do we have to keep list of channels
in device
struct? Xively holds the array channels
inside device
: http://developer.xively.com/assets/Xively_QS_TimeSeries.pdf. Not sure how M2X does it, but it is worh looking: https://m2x.att.com/developer/documentation/v2/device
How do we handle triggers in MongoDB?
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.