-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bridge cannot handle simultaneous requests #26
Comments
The Bosch backend (or rather, the device itself) cannot handle more than one request at a time, and the client already uses a request queue to work around that (to make sure that there's always only one active request). Do the Python script and the PHP page retrieve the same endpoint, or each a different one? And if so, do the "occasional weird temperatures" make sense for one of the two endpoints, or are they seemingly random? Of it is always a fixed (but weird) value? Running multiple bridges (or even multiple clients) probably won't work, and will likely actually cause more issues because it becomes impossible to correlate requests with responses. |
yes, it seems that the weird values would be valid numbers for other fields. For example, a temperature of 125 degrees, which is the time in minutes to the next programme setpoint. |
FWIW, I did some testing and it seems that the bridge can handle multiple requests (multiple clients retrieving an endpoint) without issue, I'm always getting back the expected response for the endpoint. I tested with about 10 concurrent requests. So multiple clients using one bridge is okay, but like I said, running multiple bridges against the same device is a no-no. |
I noticed when running the
bosch-xmmp
client inbridge
mode (localhost), that if different applications send a request simultaneously, the return values are garbled (I have not tried to figure out how, but I suspect some values get swapped; apparently the output is still validjson
as I get no errors about that). In particular, I have one python script polling thermostat temperatures every few minutes, and logging them into a database, and can display them in a graph. I have a simple (php) web page which shows the real-time values, which updates every few seconds. When I have that page open, I see occasional weird temperatures in my database and graphs.There is a simple workaround, to start multiple instances of
bosch xmmp bridge
, and let each app connect to their 'own' bridge. However, I would consider it a neater solution if one bridge could nicely handle simultaneous requests.It seems there may be two ways to do this:
I wouldn't mind helping implementing a solution, but am entirely new to node-js and to this codebase, so would need some pointers to get started ;-)
The text was updated successfully, but these errors were encountered: