View Full Version : Girder not triggering Lua script

February 3rd, 2012, 08:08 AM
Continuing to work on my web implementation - I use the ajax_sendevent to trigger a Lua function that sends a serial cmd to my Yamaha receiver. Everything has worked fine until now; I have two commands for muting (Audio.Z1MuteOn and Audio.Z1MuteOff); the sequence is as follows from the log -

1. From webserver; ajax_sendevent Audio.Z1MuteOn
2. Girder finds the event in the GML and triggers RXV2500:Z1MuteOn()
3. Lua sends serial cmd to Yamaha receiver and system is Muted
4. From webserver; ajaxreq command sent twice to get value of RXV2500_Mainvol
-- up to this point, everything is working as expected....then I wait a period of time --
5. From webserver; ajax_sendevent Audio.Z1MuteOff
6. Girder sees the request, but does not trigger RXV2500:Z1MuteOff()
7. Resend ajax_sendevent Audio.Z1MuteOn
8. Girder sees the request, but does not trigger RXV2500:Z1MuteOn()
9. From webserver; ajax_sendevent Audio.Z1MuteOff
10. Girder sees the request, and this time triggers RXV2500:Z1MuteOff()
11. Lua sends serial cmd to Yamaha receiver and system no longer muted

Also, from the girder console I can manually send Audio.Z1MuteOn and Audio.Z1MuteOff in sequence without any problems.....

This appears to be a problem between Girder and Lua (?) Or a timing problem (?)....or just some dumb coding problem (?)

Any advice on how to debug the problem ? ....thxs

February 3rd, 2012, 08:16 AM
What is the full version of girder including build number you are running?

February 3rd, 2012, 08:24 AM
Ron: my Girder Version is 5.0.8, build 542 ; suspect you are going to tell me to update....

February 3rd, 2012, 08:40 AM
No that should be fine. Though upgrading the 5.014b might help. Can you attach the GML?

February 3rd, 2012, 08:48 AM
Thxs, GML (and updated Lua script) attached -



February 3rd, 2012, 09:22 AM
You have a state count of two on the Z1-Mute Off action. This means one out of ever 2 events is skipped. So set state count to 1 and see if that help you.

February 3rd, 2012, 09:53 AM
Ron - that was it!! Thxs very much for your quick response & guidance....so, it was a dumb coding problem ;)

Now on to a few more changes and then I hope to have a new version of my website implementation for posting later this weekend...