Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DanielV

Pages: [1]
1
MQTT / Re: Sending MQTT messages to a MC-Product
« on: January 09, 2017, 09:12:52 pm »
Works.  Thanks.
One problem ... it is slow.
Like a 30sec to 1min wait time.

How to i get the response time faster?
I doubt people would accept a delay of 1 minute to unlock the front door or turn on the lights.

Thanks.



'-------- code --------------------------------
Class ReceiveMQTT
   
    Shared Event Boot()
        Lplan.Subscribe("mcThings/000205D8")           
    End Event
   
    Const GNSSTimeout_uS As Integer = 120000000
    Const GNSS_MIN_SAT_COUNT As Integer = 3
   
   
        Shared Event SubscriptionDelivery()
        Dim msg As Message = Lplan.GetDelivery()
       
        If msg.Topic= "mcThings/000205D8" Then
            Dim payload As ListOfByte = msg.PayLoad     
            If payload.ToString() = "LightOn" Then
                Led3 = True
            End If   
            If payload.ToString() = "LightOff" Then
                Led3 = False
            End If
            If payload.ToString() = "GPS" Then
                Led2 = True
                Thread.Sleep(50000)
                Led2 = False
               
                Device.StartGPS(GNSSTimeout_uS, GNSS_MIN_SAT_COUNT)
            End If
        End If
    End Event
       
   
    Shared Event LocationDelivery()
        Dim lat As Float = Device.GetLatitude()       
        Dim lon As Float = Device.GetLongitude()
        Dim time As Integer = Device.GetGpsFixTime()
       
        Led2 = False
       
        Dim lat_String As String
        Dim lon_String As String
       
        lat_String = lat.ToString()
       
        lon_String = lon.ToString()     
       
        Dim payload As ListOfByte = New ListOfByte
       
        Dim paystring As String = "Location: " + lat_String + "  " + lon_String       
       
        payload.Add(paystring)
       
        Lplan.Publish("/water", payload)
        Thread.Sleep(100000)
        Thread.ClearHardwareEvent()
        Dim update As Integer = Device.Uptime()
       
    End Event   
End Class
'----------------------------------------

2
MQTT / Re: Sending MQTT messages to a MC-Product
« on: January 08, 2017, 09:11:42 pm »
Found This: 

Shared Event Boot()
        Lplan.Subscribe("mcModule/000104e6/test")           
    End Event
   
    Shared Event SubscriptionDelivery()
        Dim msg As Message = Lplan.GetDelivery()
       
        If msg.Topic= "mcModule/000104e6/test" Then
            Dim payload As ListOfByte = msg.PayLoad     
            If payload.ToString() = "abc123" Then
                LedGreen = True
            Else
                LedGreen = False
            End If
        End If
    End Event

---
Will give it a try.

3
MQTT / Sending MQTT messages to a MC-Product
« on: January 08, 2017, 07:05:03 pm »
I have a 205Demo.   
I have practiced sending data to Cloutmqtt (GPS, BATTERY, Switch State, etc)

Now, I want to use the web/phone to send MQTT messages to my Demo205.

Messages that I can turn into commands like: "Turn on Lights".

Can you provide some code, or a video on how to send commands to the Demo205.

Thanks.

4
MQTT / Re: MQTT from Demo205 - Receiving Beacons but not Messages
« on: January 08, 2017, 12:09:38 pm »
Fixed.     

I changed the code from:        Dim payload As ListOfByte

To:                                           Dim payload As ListOfByte = New ListOfByte



I still get the beacon messages, but I can filter those.

5
MQTT / MQTT from Demo205 - Receiving Beacons but not Messages
« on: January 08, 2017, 11:47:33 am »
Hi.

I have a CloudMQTT account setup.

I have the following code in my Demo205 {

Class ThisThanThat
   
    Shared Event SW1FallingEdge()
       
        Dim payload As ListOfByte
        Dim paystring As String
       
        paystring = "Daniel"       
       
        payload.Add(paystring)
       
        Lplan.Publish("/water", payload)
        Thread.Sleep(100000)
        Thread.ClearHardwareEvent()
        Dim update As Integer = Device.Uptime()
             
    End Event
End Class
}

I am not receiving this message on my MQTT account,
but I am receiving messages from a beacon.

Messages Received:
mcThings/beacon/0001136D/000205D8   Binary data (base64 encoded)
2AUCAAAAAADUbRMBAA==
mcThings/beacon/0001136D/000205D8   Binary data (base64 encoded)
2AUCAAAAAADUbRMBAA==


Questions:
1. Does Demo205 do these messages?
2. Why arn't the messages showing up on Cloud?
3. How do I turn off the beacon messages?


Pages: [1]