Page 1 of 1

GlobalVars coherence between server and client

Posted: Mon Dec 20, 2010 6:16 pm
by hplus
Hi,

I started coding under gambas2 trying to extend domotiga's features. Nothing done yet, just practicing....
I noticed something strange about globalvars:
They seem to be kept in the process memory and saved/restored in the database on start and quit. Why this choice? other devices values are directly stored in the database?
Anyway, the problem occur when i am in client/server mode. The client loads at startup the globalvars from the database, but the updated globalvars values are only in the server memory and not yet in the database.
In client mode, the client should ask the server to send the globalvars values...

Hplus

Re: GlobalVars coherence between server and client

Posted: Thu Dec 23, 2010 12:57 pm
by RDNZL
Will change the behavior in client/server mode, now it loads the values (most of which are old) from the db at startup, and gets the new values when the change via udp broadcast from server (at least from revision 447 and up), I leave out the db load at startup, and add a xmlrpc call from client to server to request it to send them all once.
I also will check the load increase if I save them to database directly instead of holding them only in memory,
I also have to find a way to create them with correct datatype, (send datatype with the udp broadcast or something like that.
Now all updated globalvars are strings on the client, which doesn't work correctly.

Re: GlobalVars coherence between server and client

Posted: Mon Jan 17, 2011 2:32 am
by Andy_Burn
Im not sure if this is where this belongs, but here goes.
With Version 0.1.194 I noticed that the client doesn't update when connected to the server. even on the same machine.

I found that for every receiver, TEMP08, RFXCOM receiver and CurrentCost, even though the USB devices are mapped correctly, I have to disable and re-enable each one of them to get them to update on the client.

I seem to remember everything working fine with version 0.1.193.
Has anyone else seen this, or have I just screwed up somewhere? Lol! :wink:

Andy

Re: GlobalVars coherence between server and client

Posted: Mon Jan 17, 2011 10:49 am
by RDNZL
What doesn't update exactly?
The device values, even when clicking refresh?

I have no problems with that, are you sure you have a 1 server running?
The 'client' displays client in titlebar?
The behaviour you are describing are suggesting that you have 2 servers running.

Any errors in log?