mc-Things
General Category => mc-Things General Discussion => Topic started by: ayush on October 21, 2016, 03:53:49 am
-
I Have a dummy script
Class SubscriptionDemo
Shared Event Boot()
Lplan.Subscribe("TemperatureAbove90")
Lplan.Subscribe("TemperatureBelow90")
End Event
Shared Event SubscriptionDelivery()
LedRed = Not LedRed
End Event
End Class
Class Temperature
Shared Event GetTemp() RaiseEvent Every 2 Seconds
LedGreen = True
Dim TempC As Float = TempSensor.GetTemp
Dim TempF As Float = TempSensor.ToFarenheit(TempC)
Dim TempList As ListOfByte = New ListOfByte()
TempList.AddFloat(TempF)
If (TempF > 90.0) Then
Lplan.Publish("TemperatureAbove90", TempList)
Else
Lplan.Publish("TemperatureBelow90", TempList)
End If
End Event
End Class
I want to route the Data published on the channels to my own server, including both Topic and Payload, how can I do it?
On the same note, how can I fetch data from my server?
Aned lastly, how can I log the data on a channel in the mc-Studio so I can review it?
-
The best way to route data to your server is use MQTT. Read about MQTT if you don't know how it works. MQTT is the preferred way to communicate.
I don't know what you mean with logging. The best way to store data is to use a ListOfByte and store data there. Next major release of our software will provide logging in flash.
-
By logging I mean, say I have this variable.. In the debug mode I want to see what value the variable has, is there any way to real that value.. Will be a very useful feature for debugging
-
You have to set a breakpoint, when the program hits the breakpoint, all the variable values are displayed. Then you hit continue ...
-
There is that, yes, but say there is a variable and you need to see its values 4 times in the code at different places to see how it is being manipulated, you will have to set 4 breakpoints... Being able to display it on the mc-studio will be easier I think...
-
try Debug.Write