Comfort  Automation/ Security System Forums Home

 Moderated by: slychiu  
AuthorPost
cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

I mentioned that I have a ComfortServer that allows multiple connections to Comfort through one UCM/Ethernet connection.  I have wanted to do more development on it before making it available, but I am just not finding the time.  A couple people have expressed interest in it so I have decided to make it available as it currently is and I will publish updates in due course.  It does work, but it is not perfect and does not have all the functionality I would like it to have.  I make no warranties.  Use at your own risk.

It operates at the sockets level and simply passes any commands it gets from any client through to Comfort as it was sent by the client and sends any message it gets from Comfort to all the clients that are connected.  The server does not do a logon, so the (first) client should pass a logon through to Comfort for all the clients to be logged on and once any client logs off all the clients will be logged off.  (This is one of the elements I would like to develop further).


The server installs as a windows service and uses a configuration file. Goto the install directory and look for comfortserver.exe.config and find the following section:
<ComfortServer.My.MySettings>
<setting name="ComfortAddress" serializeAs="String">
<value>giltrow.dyndns.org</value>
</setting>
<setting name="ComfortPort" serializeAs="String">
<value>1001</value>
</setting>
<setting name="ServerPort" serializeAs="String">
<value>30000</value>
</setting>


ComfortAddress and ComfortPort is the internet (IP) address and port number of your Comfort system that the server will connect to - The same as you would enter into the ComfortClient. Change this to your Comfort address.


ServerPort is the port number that the server will serve on. The IP address will be the IP address of the computer that you install the server onto. Your clients will then connect to the IP number of the computer and the ServerPort.
The server creates its own log called ComfortServerLog in the windows system log and can viewed through the event viewer.


Let me know how it goes.

Cheers,
Clinton.


 

 

Attachment: ComfortServerSetup.zip (Downloaded 57 times)

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5499
Status: 
Offline

  back to top

Thats interesting but I am not sure I understand how things are connected

If you have several users running Comfort Client, you have 1 UCM/Ethernet connected to a PC running Comfort Server? Is this the correct interpretation?

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Thats right, You would have one PC running ComfortServer and then a number of PCs running ComfortClient.  The ComfortServer connects to Comfort and the ComfortClients connect to the ComfortServer.  Obviously you could all of this running on one PC as well,  the ComfortServer connects to Comfort and the multiple instances of the ComfortClient connect to the ComfortServer.  Hope that helps.

palmlodge
Member
 

Joined: Thursday Dec 14th, 2006
Location: United Kingdom
Posts: 507
Status: 
Offline

  back to top

For those who cannot get it to run, issue this command at a command prompt (assuming the same path)

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil.exe "c:\program files\comfortserversetup\comfortserver.exe"

Then run services.msc and tell the service to start

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

You can also start (and stop) the service in the Computer Management tool (right click Computer select manage) under Services or in the Administration Tools in the control Panel under Services.

palmlodge
Member
 

Joined: Thursday Dec 14th, 2006
Location: United Kingdom
Posts: 507
Status: 
Offline

  back to top

Didn't I just say that ? :-)

cgiltrow wrote:
You can also start (and stop) the service in the Computer Management tool (right click Computer select manage) under Services or in the Administration Tools in the control Panel under Services.

fatal_99
Member
 

Joined: Saturday Aug 16th, 2008
Location:  
Posts: 4
Status: 
Offline

  back to top

Hi Clinton,

I keep getting this error when the Comfort Server loads...

This appears in the event log.

Comfort Connection Exception: System.Net.Sockets.SocketException: The system detected an invalid pointer address in attempting to use a pointer argument in a call 218.186.97.110:1001
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at ComfortServer.ComfortServer.ConnectComfort()

I have checked and no other software is connected to the UCM at the above IP address and port number. I have tried changing the port number and ip address but the same error occurs.

I am using Windows XP.

Last edited on Thursday Aug 27th, 2009 12:34 pm by fatal_99

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Hey fatal,

There should be an entry just before and just after this entry.  Can you let me know what they are?

Have you tried to use ComfortClient or WizComfort to connect from the same machine that you are running the service on to Comfort using the same ip and port numbers as in the config file?  Does this work?

Check the version of .net framework that you have loaded.  I will confirm which in necessary.

Clinton.

fatal_99
Member
 

Joined: Saturday Aug 16th, 2008
Location:  
Posts: 4
Status: 
Offline

  back to top

Yes, I have tested using Wizcomfort and it connects fine with the same IP and port number. I have .Net 2.0 and .Net 3.0 installed.

Here are the logs

1. The ComfortServer has been started

2. The ComfortServer is starting

3. Client: Resolving local machine information

4. Client: Creating Socket

5. Client: Binding Socket

6. Client: Starting Listen

7. Server::1:30000Started Listening on30000

8. Client: Socket setup, starting Asynchronous accepts

9. Comfort Connection Exception: System.Net.Sockets.SocketException: The system detected an invalid pointer address in attempting to use a pointer argument in a call 218.186.97.110:1001
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at ComfortServer.ComfortServer.ConnectComfort()



Last edited on Saturday Aug 29th, 2009 03:47 pm by fatal_99

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Hi,

It is definitely getting stuck trying to connect to Comfort.  I have tried to replicate the problem but don't get the same error even when I have created a problem.  I can't confirm whether .net 3.5 is necessary as my Visual Studio environment is not up at the moment, but I suspect this may be the problem.  Can I recommend trying to install .net 3.5 and seeing what happens?

One other last check. please confirm that you UCM/Ethernet is serving on port 1001 and not 10001.

Clinton.

fatal_99
Member
 

Joined: Saturday Aug 16th, 2008
Location:  
Posts: 4
Status: 
Offline

  back to top

I have tried downloading .NET 3.5, but it did not help.

Yes, I am connecting to port 1001, and not 10001.

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Can you PM me your comfortserver.exe.config file?

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

Can I have your latest comfortserver for testing?  Thank you.

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

The application at the top of this thread is the latest.  I am in the process of doing more work on it, but that will take a while still.

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

Can I update Comfort date & time automatically thru ComfortClient or ComfortServer?

juwi_uk
Member


Joined: Friday May 25th, 2007
Location: Newbury, United Kingdom
Posts: 1255
Status: 
Offline

  back to top

Hi Patrick

You will be able to update date/time in the next version of the client as building that in.

Julian

 

 

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

That's great!

Can it automatically update Comfort date & time at predefined time?

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

Hi Julian,

How can I connect ComfortClient to ComfortServer? What are the settings that I need to change in both software?

Patrick

juwi_uk
Member


Joined: Friday May 25th, 2007
Location: Newbury, United Kingdom
Posts: 1255
Status: 
Offline

  back to top

Hi Patrick,

Not sure as I've not setup myself.  Clinton is best placed to comment here.

Regards

Julian

 

 

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

Hi Clinton,

I have tried many times but still cannot make ComfortClient to work with ComfortServer.  Please tell me the steps of how can I connect ComfortClient to ComfortServer? What are the settings that I need to change in both software?  Thanks in advance.

Patrick

cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Hi Patrick,

The purpose of ComfortServer is to allow multiple ComfortClients to connect to one Comfort system through one UCM/Ethernet.

You dont have to use ComfortServer.  You can connect ComfortClient directly to Comfort, but you will only be able to connect one instance of ComfortClient at a time per UCM/Ethernet.

The first step is to get ComfortClient working directly with Comfort.  Once you have this working you have a connection between Comfort and ComfortClient.

Now, for ComfortServer, you connect ComfortServer to Comfort using exactly the same connection information you used to connect ComfortClient directly to Comfort.  This connection information is put into the config file as explined in the first post of this thread.  Remember to disconnect the ComfortClient before trying to connect the ComfortServer.

You can use Windows Services to check that the ComfortServer is running.

Once ComfortServer is running and connected, then you can connect multiple instances of ComfortClient to the ComfortServer.  To do this the Comfort settings in ComfortClient must be set to the IP address of the computer running ComfortServer and the Port address to 30000 (as in the example provided in the first post - the Server port can be changed).  Once connected, you use ComfortClient in exactly the same way as you would if it were connected directly to Comfort.

Clinton.

Patrick
Member
 

Joined: Wednesday Feb 21st, 2007
Location: Sibu, Sarawak, Malaysia
Posts: 37
Status: 
Offline

  back to top

Hi Clinton,

Thanks.  It is working now. 

I notice that when UCM/Ethernet is power off, ComfortServer cannot connect back again, I have to stop the ComfortServer service and restart again.  Can it be automatically reconnect when the power is resume?

And when the output is pulse at every 1 second, ComfortClient is not receive any update.  Please check.

Thank you.

Patrick 


UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems