Author Topic: mosquitto mqtt gateway config settngs  (Read 211 times)

mr_mcthing

  • Newbie
  • *
  • Posts: 13
    • View Profile
mosquitto mqtt gateway config settngs
« on: November 29, 2016, 05:20:52 pm »
Hi,

As a first test I tried the http://mcthings.createaforum.com/mqtt/temperature-reporting/  as a sample. But that did not work out well. I do not see any-thing getting published in mosquitto. So apparently I have done something wrong. I'm running mosquitto on a server in my lan. Its working since i can perform the "hello world" test. So there has to be a mistake in the Gateway config. I have the gateway ethernet connected. So I have the ip address and the user/ passwd in it.
Now I would expect to see something in mosquitto but no way?
Anyone who has this kind of local mqtt settup and willing to share a screenshot of the config here? Would be a great help :)



Social Buttons


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #1 on: November 30, 2016, 09:24:47 am »
Did you configure the gateway and have you looked into the white paper?

mr_mcthing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #2 on: November 30, 2016, 10:27:08 am »
To make things more clear I attach my settings and apart of the log file.  I also experience my mc-module to disconnect after some time?


[ Guests cannot view attachments ]

[ Guests cannot view attachments ]
« Last Edit: December 09, 2016, 04:42:38 pm by mc-T2 »

mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #3 on: November 30, 2016, 05:38:30 pm »
Which gateway are you configuring? It looks like you are trying to configure the virtual gateway while you should configure mc-Gate110.
Only physical gateways can connect to MQTT.
This will change in the future, where the TestBoardGateway has all the functionality of the physical gateways. The virtual gateway will disappear in the future because it was only used for test purposes.

Also always check which device is connected. By default the virtual device is connected.

mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #4 on: November 30, 2016, 05:58:18 pm »
Sorry I did not open the last image. Interesting dutch windows words like Bestand, Opmaak, Bewerken, enz. Hoewel ik Nederlands spreek can ik niet wennen aan een Nederlandse versie van Windows, zelfs toen ik daar nog woonde.

I see now whats happening. At 4:44:51.352 the gateway sends an ConnectionAborted. This happens when the wireless connection between the gateway and the device can not be sustained. It communicates an alive message every 250ms and if it misses 4 in a row it will send this message. The most common case is that the device resets. This could be because it runs out of memory or other resources.

Could you try the following? Connect to the device and let is sit there for at least 10 minutes. Do nothing. Let me know if you loose the connection in that scenario. If that is not the case load a very simple program, like blinky, in flash and do the same. The try it again with configuring the gateway.

« Last Edit: November 30, 2016, 06:32:05 pm by mc-John »

mr_mcthing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #5 on: December 04, 2016, 07:32:36 am »
I did a long test and now the modules stay connected. I made the mistake thinking the modules should be "connected" through the mc-Studio but that is only if you want to upload the code to the module.
Now I see the beacons working, I still do not see them in my mqtt broker (Mosquitto). In the log file I can see only a client connecting but not the publisher?
So could my config file be wrong? Or how do I see that something is published by my module/ gateway ?

Also I wondered how could one see what is on the module? Or do I need to keep a list with all my uploads to a particular module?


mr_mcthing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: mosquitto mqtt gateway config settngs
« Reply #6 on: December 05, 2016, 01:56:34 am »
My Mcmodules are now publishing to mqtt. In my mosquitto log files I can see the beacons from mcThings. Turned out to be a stupid typo error in the ip address :)
Next thing is getting a temperature logging code to work.
« Last Edit: December 05, 2016, 05:08:08 am by mr_mcthing »
Like Like x 1 View List