Hi Mario,
On Tue, May 29, 2018 at 1:12 AM, Mario Fischer <
lostma...@gmail.com> wrote:
> Hello everyone!
>
> I am new to Mainflux and I like the lightweight concept very much compared
> to heavy solutions like DeviceHive.
Thanks for your interest in Mainflux.
>
> Please give me some rope here as these are my first steps with Mainflux. I
> have a few questions because I have already hit some roadblocks:
>
> 1. As recommended I worked through the "Getting Started" guide, setting up
> Mainflux using Docker Compose, adding an account, a client, a channel and
> credentials. This works as expected. But when I try to send a message to a
> channel by doing
>
> curl -s -S -i --cacert docker/ssl/certs/mainflux-server.crt --insecure -X
> POST -H "Content-Type: application/senml+json" -H "Authorization:
> <client_token>"
https://localhost/http/channels/<channel_id>/messages -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.3}]'
>
> I get HTTP code 500 (internal server error). I have also tried WebSockets
> (with the AdvancedRestClient tool), but I cannot connect to
>
> wss://localhost/channels/<channel_id>/messages?authorization=<client_auth_key>
>
> Of course I have replaced the channel id and authorization key placeholders.
>
> What is my mistake here?
This should be working. It is potentially wrong channel nb, wrong
token (did you use correct device token), or maybe malformed SenML.
But most probably you did not connect your device to this channel.
You can try listing (GET-ing) the channel and see if your device is in
the "connected" list:
https://mainflux.readthedocs.io/en/latest/getting-started/#access-control
>
> 2. The description says something about "protocol bridging" with MQTT as an
> example. I cannot find anything about MQTT in the documentation.
>
> My ultimate goal is to talk to the connected devices by MQTT. Is this
> already possible?
Mainflux lets you talk over all supported protocols. You PUB on an
arbitrary protocol, and SUB on another on - you will get the messages,
as Mainflux does all message bridging internally.
For some reason latest docs were not rebuilt. I have kicked the build
again, now you should see MQTT related stuff.
>
> 3. I want to run Mainflux on a Raspberry Pi. Best case scenario would be
> using Docker to run the Mainflux stack on the RPi. How should I approach
> this?
Best approach will be to build everything for ARM.
Take a look at the Makefile and pass it the adequate ENV variables:
https://github.com/mainflux/mainflux/blob/master/Makefile#L8
Something like this:
GOOS=linux GOARCH=arm GOARM=7 make
should do the trick.
Also, take care that MQTT broker is NodeJS-based for now, so you can
install it on RPi as a classical NodeJS app (via `npm install`).
Additionally, you will need to install PostgreSQL and NATS broker
(
https://nats.io/), and add at least one DB for messages - for example
InfluxDB. There is also MongoDB support coming soon:
https://github.com/mainflux/mainflux/pull/307
Best regards,
Drasko