Realtime Interaction with Imp

No, AD and TSL parts are not related. I had a look but can’t find my code, it’s possible it was done so far back that it was written in Lua and not squirrel :slight_smile:

@beardedinventor- Is your long polling code from July 17 above a good place for me to start? Do I need the code above from July 18? It is difficult to extract simple code from Deldrid’s Github project. Looks amazing but it’s beyond me.

Just realized the RGB color sensor in Hannah V2 is the same as V3. Saw your commented Arduino code on Github.

After more than a year NOBODY has translated this?

Do you have an updated example of long polling?

I believe that my garage door code on GitHub is a pretty simple example of long-polling. Someone please correct me if it isn’t. When I trigger my door to open or close, I want to wait until the door position sensors tell the imp that the door has either opened or closed. Here is the process:
1.Send a request to the agent
2. Using an inline function, receive the request, and do device.send.
3. At the device, trigger the door. (This takes about 10-11 sec for my door, which is within the 60 second timeout)
4. Wait for a callback to the device that means the door state has changed.
5. Device does agent.send with the new door state.
6. At the agent, the original inline function receives the device.on with door state, and does response.send back to the requestor. In my case, the iOS app.

Now, I am not queuing anything, hopefully no one is mashing on the button, so my example isn’t that complex, but it does actually wait for something to happen at the device.