IFTTT > IFTTT

IFTTT Outside Temperature example - Still not working

(1/5) > >>

flookdigital:
We have followed the example script and the video example but we are still not able to get a connection between the module and writing into the Google Drive spreadsheet.  Please give clear instructions and script examples so we can at least  get this example running.

We have updated to the latest firmware on the Gateway and modules.

Thank you for your help.

kristofferis:
Hello.

Where does it stop? do you get any error message?
I just tested this myself and it works without any issues, the only thing that i changed from the video is that the temperatur code should now be

--- Code: ---TempSensor.GetTemp()
--- End code ---
instead of

--- Code: ---Temperatur.GetTemp()
--- End code ---

But that will raise an error message in mcStudio.

So please provide some more information and i will try my best to help you.

flookdigital:
Hello Kristofferis - Thank you for taking the time to have a look.

Here is my code, I'm not getting any errors but I can't get it to post to the Google Drive spreadsheet.

First file: Tony3 -

Class TempSETUP
    Shared Event checktemp() RaiseEvent Every 30 Seconds
        Dim temp As Float = TempSensor.GetTemp()
        Dim tempstring As String = temp.ToString()
       
        Lplan.IFTTT("dQoVzrPWk31UKuZDRMXnSW", "Grinder", tempstring, " ",)
       
       
    End Event
   
    Shared Event blinkgreen() RaiseEvent Every 5000 milliSeconds
        LedGreen = Not LedGreen
       
    End Event
End Class


Second File: TempSensor

Class TempSensor
    // Function returns the temperature in degree celcius or
    // Float.NaN if something is wrong
    Shared Function GetTemp() As Float
        // Define the properties of the I2C peripheral and device address
        Dim sensor As I2c
        sensor = I2c.Create(400000, Pin.SCL, Pin.SDA, 0x48)
       
        // Power up the sensor and give it some time to settle
        Device.EnableTempSensor()
        Thread.Sleep(40000) // See page 13 of the datasheet
       
        // Read the sensor (only 2 bytes to read
        Dim res As ListOfByte = sensor.Read(2)
       
        // See Tmp102 documentation how to interpret the data (page 8)
        Dim temp As Float = Float.NaN
        If res <> Nothing Then
            // Shift the partial part to the right nibble
            Dim part As Float = res(1) >> 4
            // Temperature partial is 1/16*n where n is between 0 and 15           
            part = part / 16
            // Sign extend the byte to an integer
            temp = res(0).SignExtend() + part
        End If
       
        // power off
        Device.DisableTempSensor()
        Return temp
    End Function
   
    Shared Function GetDieTemp() As Float
        // Just get the temperature and return
        Return Device.TempDie
    End Function
   
    Shared Function ToFarenheit(celcius As Float) As Float
        Return (celcius * 9) / 5 + 32
    End Function
   
    Shared Function ToCelcius(farenheit As Float) As Float
        Return (farenheit - 32) * 5 / 9
    End Function
   
End Class

kristofferis:
Hello.
Is this code exactly what you are using? if that's the case then i have to say that it seems that you IFTTT key is to short, please verify that you are using the correct key.

spacecadetant:
I'm having similar trouble. I'm trying to figure out if the gateway is actually connecting out. I think we could do with some kind of diagnostic tool to check gateway to internet connection is working. The amber light is on.

Navigation

[0] Message Index

[#] Next page

Go to full version