mc-Things

General Category => mc-Things General Discussion => Topic started by: mcThings on June 06, 2016, 11:00:20 am

Title: re-Post "Finding my way around McThings"
Post by: mcThings on June 06, 2016, 11:00:20 am
jeroens1din General4
Finding my wat around McThings
0
Just received the package (thanks) and was wondering how best to get started. Is there any documentation. Like configuring the Router, MQTT settings etc? Could not find anything.
My plan is to create a zoned temperature setup with 8-10 zones and was thinking to use an MQTT local server to report the current temp to in 5-10 minutes interval…Like

kristofferis
kristofferis1d
Hello. What you explain is a very simple setup I could guide you through the steps, but the problem is right now the firmware, and some MQTT bugs. Do you have a local MQTT broker installed in your network right now?Like
1d
By the way, there is also a bug in the temperature code so I have not yet managed to get the temperature from the mcModule, as soon as the abow bugs is handled then I could help you with this user case.Like

jeroens
jeroens1d
That would be great. Not yet planning to install on local network (raspberry Pi)Like

kristofferis
kristofferis1d
Ahh okey, I would normally recommend mosquitto as broker but if I should install a broker today I would actually install emqtt.io I have not yet tested this broker but I like what I have read about it. And I have planned to test this myself next week.
Title: Re: re-Post "Finding my way around McThings"
Post by: kristofferis on June 07, 2016, 03:32:38 am
Hello.
If you download mcStudio V0.7-891+ then it is possible to use the temperatur sensor.
I cant get MQTT running with version V0.6-355 of the mcRouter so right now i recommend using V0.6-354.

1: Start mcStudio and click Tools / Devices, Connect to your gateway and then click Gateway Config. Enter your MQTT broker IP address and port and save the config.
2: Connect to one of your mcModules.
3: create a new project and a simple code like this will do a reading from the temperatur sensor and then publish the result to your MQTT broker with topic mcThings/Temperature/BasementA and the temperatur as the payload.

Code: [Select]
Class MQTTTest
    Shared Event sendMQTT() RaiseEvent Every 1 Minutes
        LedRed = True
       
        Dim payload As ListOfByte = New ListOfByte()
        Dim TempC As Float = TempSensor.GetTemp
        Dim TempString As String = TempC.ToString()
       
        payload.Add(TempString)
       
        Lplan.Publish("mcThings/Temperature/BasementA", payload)
       
        LedRed = False
    End Event
End Class

4: click File / Add Library Code and select Temp Sensor.
5: Save / Build / Run the application and your mcModule will start sending MQTT messages with the temperatur to the broker.
6: when you are happy with the function click Save / build/ Load the program in the device, to save the code so that it will continue to run when you stop the debugging

mcThings have published information videos on some of the parts mentioned above, please take a look at it and i think things fill fall into place for you.
https://www.youtube.com/channel/UC3vwTRcjtJ9Y8_h5M3-oRtw/videos (https://www.youtube.com/channel/UC3vwTRcjtJ9Y8_h5M3-oRtw/videos)

And if you have any questions, just let us know.