STCEthernet.dll and EcOcean.dll

May 6, 2014 at 3:12 PM

i downloaded both dlls. I tried to import the dlls in my Project. The Import works, but after that Visual Studio throws an Error that the dlls can not be found.

Can someone help me out with that? What iam doing wrong?
May 6, 2014 at 3:48 PM
The published dll's were compiled for a beta version of .net framework 4. You shuold download the latest source code and compile it yourself. You could also add the project to your solution and reference the project (as opposed to the dll).
May 14, 2014 at 8:05 AM
Hi hallis,

thx i compiled it by my self.

Not i have the another Problem.

I connected my Transiever. The Transiever is also reading the Telegram (I Debugged the ReadCompleated function). So far so good.

But the TransieverInitialized function is not called. CMD only write that the Transiever is connected.
May 14, 2014 at 8:14 AM
Are you running one of the sample programs, or you own code?
May 14, 2014 at 8:18 AM
Edited May 14, 2014 at 8:18 AM
Iam running the sample code (Receive) to see how that all works.
May 14, 2014 at 8:44 AM
Edited May 14, 2014 at 8:45 AM
Have you configured the STCEthernet device correctly? It must be in "Client" mode and use "TCP-protocol". Also make sure it is set up to connect to IP adress of the computer where you are running the code. Check that the firewall on your computer isn't blocking the connection and that the port set up on the device matches that in the code.
May 14, 2014 at 8:48 AM
You can also try to turn the power off and on again on the STCEthernet device. It seems to hang if it looses the network.
May 14, 2014 at 9:36 AM
Yes the STCEthernet ist configured correctly. I configured as Client, TCP-Mode and Gateway. The IP-Adress is also correct. Firewall is checked an i Forwarded the Port.

In Code i use Port 4000 and device uses also the same port. The IP adress an the Port are correct otherwise the transceiver could not connect, but he does connect.
May 14, 2014 at 10:23 AM
Can you confirm that you have the correct device. It comes in two versions SRC and STC. SRC is for receiving only. STC is for send and receive.

The init code reads the ID base form the device. It needs the ID base for sending messages. The Receive sample doesn't send anything, so you could try på bypass the init code so see if you are able to receive data.
May 14, 2014 at 10:59 AM
Yes i have the STC-ETHERNET EasySens from Thermokon and a PTM 215 SWITCH. If i click a button on the switch, i can see in the debug mode that the transceiver received the telegramm.
May 14, 2014 at 1:00 PM
After Debug i can see that the Eventhandler for the TranceiverInitialized is not getting called:

/// <summary>
/// Event handler for the Transiever Initialized event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">A SocketAsyncEventArgs that contains the event data.</param>
private void Initialized(object sender, EventArgs e)
  ThreadPool.QueueUserWorkItem(state => this.TransieverInitialized(this, new TransieverInitializedEventArgs((Transiever)state)), sender);

I seached the whole code but i cant find the part where that function is getting called.
May 14, 2014 at 1:22 PM
Look in the Transiever.cs file. In the ReadCompleted method. Line 515. It calls the Initialized event handler when all the init messages have arrived. The init messages are sent from the Initialize() method in the same class. Try to figure out why you don't get a reply to one of these messages. Try to just get the IDBase message. Change the ArePropertiesInitialized property to check for the id base only.

I have just tested the exact same code on my system, and it works. Mabye there is a difference in our STC devices.
May 14, 2014 at 1:52 PM
I figured out why is was not working. You were right. The properties isModemIdSet and IsModemOnSet, both of them returned false. I put the out from the ArePropertiesInitialized and now it works fine.

Are they negligible?
May 14, 2014 at 8:59 PM
I believe the "modem" functionality is for sending messages between two STC devices. You can safely remove that. I do not see much use for it. Maybe it has been removed in newer hardware, and that is why it is not working. My device is pretty old.
May 15, 2014 at 1:09 PM
Edited May 15, 2014 at 2:35 PM
Hi Hallis,

thx for all, you helped me alot! :)