SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi,
We are using a SmartConnector end-point and the code below.
When we call this API, an exception is shown in the SmartConnector log file. See attached.
Any idea why?
public static int ObtainBearerToken ()
{
_bearerToken = null;
try
{
// Obtain Token
Uri uri = new Uri(Settings.m_strURL);
_log.InfoFormat("ObtainBearerToken uri = '{0}', user = '{1}', pass = '{2}'", uri.ToString(), Settings.m_strUser, Settings.m_strPassword);
_bearerToken = BearerToken.ObtainToken(uri, Settings.m_strUser, Settings.m_strPassword, "GetToken");
if (_bearerToken == null)
{
_log.ErrorFormat("ObtainBearerToken fail, token is empty or null");
return -4; // invalid token
}
_log.InfoFormat("ObtainBearerToken pass, token = '{0}'", _bearerToken.ToString());
return 0;
}
catch (Exception ex)
{
_log.ErrorFormat("ObtainBearerToken, Exception, msg = '{0}'", ex.Message);
return -4;
}
}
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Reinstalling the SmartConnector solved the problem. However, I suggest that this bug should be fixed.
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi,
One more thing. See the line below from the SmartConnector log file:
2022-04-10 14:13:34.1531,Error,EwsConsume,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443
The IP address of our server has changed from 10.0.0.19 to 10.0.0.14. The log file still shows the old IP address (10.0.0.19).
Is it possible that this is causing the exception?
Does SmartConnector keep the old IP address of my computer?
If yes, can we change it to the correct IP address?
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
Yes, that is causing the exception. If the address of your EBO server changes you have to change it in your endpoint configuration.
BR
Armend
Link copied. Please paste this link to share this article on your social media post.
Hi Armend,
Thank you for your answer.
The Server Address in the endpoint is http://127.0.0.1:8019/EcoStruxure/DataExchange
The host is 127.0.0.1.
What should be the value assuming my IP address is 10.0.0.14?
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi,
Wherever it says 10.0.0.19, change it to 10.0.0.14
Screenshot below of the endpoint configuration:
Link copied. Please paste this link to share this article on your social media post.
Hi Armend,
I have changed it (see attached screen capture) but SmartConnector log still shows the old IP address(10.0.0.19). See below.
2022-04-11 08:48:47.5495,Error,Processor,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443
Please advise.
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Armend,
One more thing.
My address is: 10.0.0.14:8019.
The address changes from 10.0.0.14 to 10.0.0.19 and the port changes from 8019 to 443. See below.
2022-04-11 08:56:14.5824,Error,EwsConsume,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443
Any idea why?
Thanks,
Mike
Link copied. Please paste this link to share this article on your social media post.
I think you might have forgotten to attach your screenshot
BR
Armend
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Have you tried to 1. Stop and start the endpoint 2. Restart Smartconnector?
:443 is added by your system if you specify the https protocol in the connection string without an explicit port, so it seems it's not using the newest settings.
BR
Armend
Link copied. Please paste this link to share this article on your social media post.
Hi Armend,
Yes. I tried it. Same result.
Not sure I understood your answer below:
443 is added by your system if you specify the https protocol in the connection string without an explicit port, so it seems it's not using the newest settings.
What do you mean connection string? I don't see "Connection string" in the endpoint properties...
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
I'm referring to the field called "server address", and it's just an general explanation of why :443 would pop up.
Are there any other endpoints set up in Smartconnector that could be in conflict with this one, or maybe are used instead? If not, I would try removing the endpoint and trying to add a new with the same settings. I've never seen it get stuck like that.
BR
Armend
Link copied. Please paste this link to share this article on your social media post.
Hi Armend,
There was another endpoint but it was always was in "stopped" mode. I have deleted all endpoints and created a new one.
The same problem persists. It seems that the IP is stored inside SmartConnector database...
Do I need to uninstall SmartConnector and reinstall?
Thanks
Mike
Link copied. Please paste this link to share this article on your social media post.
Yes, you could try reinstalling with a fresh database.
BR
Armend
Link copied. Please paste this link to share this article on your social media post.
Reinstalling the SmartConnector solved the problem. However, I suggest that this bug should be fixed.
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.