Json responses are "Busy"
#1
Hi everyone,
Before I start with my question first 2 things. 1. This is my first post on the forum so Hi everyone Smile Always nice to meet new people from all over the world. 2. I have no idea if this post is in the correct forum. So to all admins and mods so sorry and please move it if you prefer. I have looked around the forum and this was for me the post spot to post it Smile

So after the brief introduction, my question Smile

I'm building a remote controller on my Arduino board (Arduino is an open source µcontroller in C++). Anyway, I can make perfect HTTP calls and make responses. So I figured out how to make a json pin request to my XBMC server and my server is so kind the respond with a Pong Smile But, now I need too make some GetInfoLabels calls like this one:
Code:
/jsonrpc?request={"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","params":{ "labels": ["Network.IPAddress","Network.MacAddress"]}, "id":1}
This gives me in my browser (Chrome) and in my Arduino a perfect response. BUT, my MacAddress is first time "Busy", I have to make very fast after the first request a second request and then I will get my mac address in the "xx:xx:xx:xx:xx:xx" form.
Can someone explain to my why I have to make the call a second time before the "Busy" state disappears? I get the same problem with the following labels: "System.KernelVersion", "System.TotalUptime","System.Uptime" and "System.CpuFrequency".

Someone can help me with this problem? Maybe tell my XBMC server to respond after he got all the info? or delay the HTTP response in the HTTP header somewhere?

Thans
Reply
#2
Wrong forum Wink http://forum.xbmc.org/forumdisplay.php?fid=93 would be better Smile

This problem is a very very long lasting one without solutions Sad

For some calls like KernelVersion it can take a very long time to be filled, the biggest problem is that Busy string is depending on client language so you can't just look for Busy string and try again Wink

For mac and up-time it's easy to find wrong values. For Kernel version, just check if the result contain a space or not. (But be careful, some translation of busy are wrong and contains a leading space, so you need to check on a trimmed string).
Reply
#3
To the mods of this forum, feel free to move this topic to http://forum.xbmc.org/forumdisplay.php?fid=93 as Tolriq stated Smile

So I just have to make a second call if I find Busy states? Isn't there a posibility to let XBMC send a HTTP 200 respons and then wait half a second before sending the HTTP respons data? I do it all the time with my Arduino project as well Smile

But thanks for the info, i'll try to implement it like you said
Reply
#4
Well it can take more than 2 tries to get correct answer Wink

And no Xbmc can not easily change this, since it's just a wrapper around internals and Json have the same problem as us, the function does return a valid string so no reason to wait anything.

It would need some major internal change I guess, reason of not being fixed since my first day on Xbmc remoting a long time ago Wink
Reply
#5
Ha ok, hehehe.

Well then I will have to keep requesting it until I get no "Busy" states anymore Smile

Thanks for the help!!!
Reply

Logout Mark Read Team Forum Stats Members Help
Json responses are "Busy"0