1 Reply Latest reply on Aug 4, 2015 6:04 AM by miikkae RSS
    miikkae Explorer

    Automatically creating and binding Things by new unbound Remote Things from SDK

    Hi!

     

    I'm trying to create a service to detect new unbound remote things and creating and binding new things based on them.

    I've created a local service with script for detecting unbound remote things and creating them based on a template and it works while I manually use the "Test" button.

     

    Now, I'm wondering how could I call that service from C SDK (later propably with some other SDKs too) ?

    I'm guessing to use a service from SDK, it must be a remote service but TWX allows no script to be included in those.

    Is it even possible to do this?

    There's a twApi_InvokeService function in C SDK, so it seems like service call should be possible, though.

    How could I run custom script in remote service?

     

    I've also thought about creating a subscription for this, but it's not working 'cause the thing's unbound at that moment.

    It would be quite important to get this working, so we wouldn't have to manually create things to TWX all the time.

      • Re: Automatically creating and binding Things by new unbound Remote Things from SDK
        miikkae Explorer

        I've now tried to create one constant Thing to run this service from and by subscribing the service on a remote event and firing that event from unbound remote thing but neither seems to be working.

         

        Only working solution seems to be to run an external SDK agent with the constant Thing already existing on TWX and using it to just run the service.

        Some permissions are still missing, but I changed that for a moment so that the applicationKey used my administrator account and it worked fine. Naturally, there's the "extra" Thing that's used to run the service on TWX then.