mc-Things

mc-Platform => IFTTT => Topic started by: hnugter on August 10, 2016, 02:21:07 pm

Title: Overload resolution failed
Post by: hnugter on August 10, 2016, 02:21:07 pm
I'm just starting with Mcthings and I successfully loaded the blink script on one of my modules.
Now I'm trying the temperature script but I get an error which says Overload resolution failed because IFTTT does not  accept the specific data types....etc

This is my script, what goes wrong.
The word IFTTT is underlined like in Word and gives an error message.

Regards
Henk

Class temperatuur
    Shared Event GetTemp() RaiseEvent Every 1 Minutes
        LedGreen = True
       
        Dim TempC As Float = TempSensor.GetTemp()
        Dim TempF As Float = TempSensor.ToFarenheit(TempC)
       
        If TempC > 25.0 Then
            LedRed = True
        Else
            LedRed = False
        End If
       
        LedGreen = False
        Lplan.IFTTT("d8cAVjNUjBr1S9aUB70Wvc", "TempCE", temperatuur, "", "")
    End Event   
End Class

[attachment deleted by admin to save space in attachment file]
Title: Re: Overload resolution failed
Post by: kristofferis on August 10, 2016, 03:20:54 pm
Hello.
You have included your class name temperatuur in you IFTTT command. That is not an valid string.
If you just want to send the name then put it inside ""
Title: Re: Overload resolution failed
Post by: hnugter on August 10, 2016, 03:47:59 pm
Thanks for your fast reply.
I changed the script and is seems working now, however, i do not see a spreadsheet yet... but i keep on puzzling.

Regards
Henk
Title: Re: Overload resolution failed
Post by: kristofferis on August 10, 2016, 04:05:36 pm
That's great.
Let us know if you need any help.
Title: Re: Overload resolution failed
Post by: hnugter on August 11, 2016, 06:23:29 am
Hello Mcthings, My module is now running for a day but no data has been written to my spreadsheet.
I have tried several things but no success.
One of the things I noticed is that when I use the device maintenance and when I click on Gateway config, I get  an error like in the attached screenshot. Does that cause the gateway fot not working properly?

regards
Henk

[attachment deleted by admin to save space in attachment file]
Title: Re: Overload resolution failed
Post by: kristofferis on August 11, 2016, 06:28:57 am
Hello.
You need to upgrade your mcGateway to the latest version with USB memory stick.
Title: Re: Overload resolution failed
Post by: hnugter on August 11, 2016, 01:09:54 pm
Thanks again for your reply.
I think that all my modules and gateway are updated, see attached pictures.
The gateway has a red led and the amber led continuing on and the green led flashing.
The module is blinking every minute.
When I go to my recipes in IFTTT is says never run but I did turn it on. I recreated the recipe, in case I made a mistake
Still no spreadsheet. I have the feeling I am close but still missing something.
It would be very helpful if you can give me another hint.
Regards
henk
Title: Re: Overload resolution failed
Post by: kristofferis on August 11, 2016, 01:15:08 pm
Yes, now your mcGateway has the correct firmware.

Could you post the IFTTT command that you currently use in the code?
Title: Re: Overload resolution failed
Post by: hnugter on August 11, 2016, 01:17:38 pm
This is the complete script i use.

Henk

Class temperatuur
    Shared Event GetTemp() RaiseEvent Every 1 Minutes
        LedGreen = True
       
        Dim TempC As Float = TempSensor.GetTemp()
        Dim TempF As Float = TempSensor.ToFarenheit(TempC)
       
        If TempC > 25.0 Then
            LedRed = True
        Else
            LedRed = False
        End If
       
        LedGreen = False
        Lplan.IFTTT("d8cAVjNUjBr1S9aUB70Wvc", "TempCE", "temperatuur", "", "")
    End Event   
End Class
Title: Re: Overload resolution failed
Post by: kristofferis on August 11, 2016, 01:25:57 pm
Okey, that is not correct.
Change to something like this.

Code: [Select]
Class temperatuur
    Shared Event GetTemp() RaiseEvent Every 1 Minutes
        LedGreen = True
       
        Dim TempC As Float = TempSensor.GetTemp()
        Dim TempF As Float = TempSensor.ToFarenheit(TempC)

        Dim tempstring As String = TempC.ToString()
       
        If TempC > 25.0 Then
            LedRed = True
        Else
            LedRed = False
        End If
       
        LedGreen = False
        Lplan.IFTTT("d8cAVjNUjBr1S9aUB70Wvc", "temperatuur", tempstring, "", "")
    End Event   
End Class
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 03:12:25 am
Hello,
Thanks for your help
I have changed the script but is does not seems to work.
I have put some breakpoints in the code and run it. When debug stopped at the line Dim temp As Float = TempSensor.GetTemp() the value stays ) (zero) and then the tempstring also contains nothing and as a result nothing is sent to IFTTT
Then at the end I get an runtime error. (see picture)

This is my script now.
It would be very helpful if I could started with a working script. From that point I can move on.

Regards
henk

Class temperatuur
    Shared Event GetTemp() RaiseEvent Every 1 Minutes
        LedGreen = True
       
        Dim temp As Float = TempSensor.GetTemp()
       
        Dim tempstring As String = temp.ToString()
       
        Lplan.IFTTT("d8cAVjNUjBr1S9aUB70Wvc", "Temperatuur", tempstring, "", "")
       
        If temp > 25.0 Then
            LedRed = True
        Else
            LedRed = False
        End If
       
        LedGreen = False
       
    End Event   
End Class

[attachment deleted by admin to save space in attachment file]
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 05:03:15 am
When it stops at a breakpoint then that row is not yet executed.
What is the value of temp and tempstring when the debugger stops at the breakpoint with the IFTTT command?
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 07:00:42 am
Hello mcthings Team,

The value is 0, (zero)
See attached picture.
I think that this is not good?

Henk

[attachment deleted by admin to save space in attachment file]
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 09:43:53 am
Ahh I see what's wrong now.
You have not connected to your mcModules.
Please read the mcStudio instructions or take a look at YouTube at mcThings channel and you will find a video that describes the procedure to connect to a mcModule.
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 09:47:01 am
Hello Mcthings team
I have just tried to connect the gateway via lan. when I started debug again i got a reading. It gives a temp reading
for the first time the green led stays on while debugging and it stops after debugging. Is that good?
I'm curious if Y will get results in my spreadsheet, so far not yet.

Regards
henk
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 09:57:33 am
In your code you first enable the green LED and after you have sent to IFTTT then you set it to off again. So that works as it should.
I could try later today to send a update from one of mine modules to your spreadsheet just to verify that.

Iam on vacation and will test this when I get back to the hotel.
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 12:32:30 pm
Okey, I have now sent two IFTTT updates to d8cAVjNUjBr1S9aUB70Wvc and event id temperatuur.
Do you see anything in your spreadsheet now?
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 12:36:30 pm
Hello kristofferis,
Accidentally I reconnected my maker and the new key is now dfssqReenxPPUE0k_aJGwP
Could you please sent the IFTTT updates once more?

regards
Henk
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 12:41:52 pm
Sure, I have now sent two more updates to your new ID.
The event id is still temperatuur?
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 12:43:11 pm
I see now four lines
August 12, 2016 at 07:29PM   temperatuur   25
August 12, 2016 at 07:30PM   temperatuur   25
August 12, 2016 at 07:40PM   temperatuur   25
August 12, 2016 at 07:40PM   temperatuur   25

regards
Henk
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 12:46:58 pm
Ahh okey, then did the old ID also work for some reason.
But now we verified that you IFTTT is okey, and my update is sent from mcModule with latest firmware so no problem there.

Please try to reboot your mcGateway and your mcModule and then connect again to mcStudio and try the code again and see if it works now.
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 01:23:39 pm
I did what you asked, power down, power up, connect gateway, module, module is present in header of mcstudio en loaded the script in the module.
I have tried debug again it gives the right value of temp and tempstring before it is sent to IFTTT

My gateway is connected via lan. red, amber led continuously and a blinking green led, it blinks about every second 

The module blinks green every minute.
But sadley, no update in my spreadsheet
I have looked at the code, even beginning to understand what it means, but I can not find what's wrong.

Class temperatuur
    Shared Event GetTemp() RaiseEvent Every 1 Minutes
        LedGreen = True
       
        Dim temp As Float = TempSensor.GetTemp()
       
        Dim tempstring As String = temp.ToString()
       
        Lplan.IFTTT("dfssqReenxPPUE0k_aJGwP", "Temperatuur", tempstring, "", "")
       
        If temp > 25.0 Then
            LedRed = True
        Else
            LedRed = False
        End If
       
        LedGreen = False
       
    End Event   
End Class
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 01:53:28 pm
Iam not sure if IFTTT event name is case sensitive or not but try to change Temperatuur to temperatuur
Title: Re: Overload resolution failed
Post by: hnugter on August 12, 2016, 02:04:08 pm
I'll be d....
It works.
Never thought about that, you are great.
Thanks a lot for your patience and help.

Best regards
Henk

August 12, 2016 at 07:29PM   temperatuur   25
August 12, 2016 at 07:30PM   temperatuur   25
August 12, 2016 at 07:40PM   temperatuur   25
August 12, 2016 at 07:40PM   temperatuur   25
August 12, 2016 at 08:59PM   temperatuur   23.000.000
August 12, 2016 at 09:00PM   temperatuur   22.937.500
August 12, 2016 at 09:01PM   temperatuur   22.937.500
August 12, 2016 at 09:02PM   temperatuur   22.937.500
August 12, 2016 at 09:03PM   temperatuur   25.562.500
Title: Re: Overload resolution failed
Post by: kristofferis on August 12, 2016, 02:07:33 pm
That's great  :)
No problem, just let me know if you need some more help.
I will do my best to help you.