Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Smart Connector: Tutorial Weather Extension Test Issue Error

SmartConnector Forum

Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • SmartConnector
  • SmartConnector Forum
  • Smart Connector: Tutorial Weather Extension Test Issue Error
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
JeffBowman
Sisko JeffBowman Sisko
164
ardak
ardak Schneider Alumni (Retired)
34
sesa180908_brid
Commander sesa180908_brid Commander
34
mike_meirovitz
Commander mike_meirovitz
21
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to SmartConnector Forum
Solved
Lydia
Lieutenant | EcoXpert Master Lydia Lieutenant | EcoXpert Master
Lieutenant | EcoXpert Master

Posted: ‎2019-11-01 01:25 PM

0 Likes
1
1150
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2019-11-01 01:25 PM

Smart Connector: Tutorial Weather Extension Test Issue Error

I am currently working on the Weather Extension Smart Connector Tutorial. I was able to successfully download the GitHub sample examples, as advised in the Developer's Guide, but I am receiving multiple errors during testing (Developer's Guide: Step 6.3.6) *See SmartConnectorErrors.png*.

 

SetupProcessorFixture/ExecuteTest gave me this error: 

An error occurred while updating the entries. See the inner exception for details.
An error occurred while updating the entries. See the inner exception for details.
Cannot insert duplicate key row in object 'dbo.EwsServers' with unique index 'UQ_EwsServer_Address'. The duplicate key value is (http://localhost:56731/).
The statement has been terminated.
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at Mongoose.Service.Data.MongooseDbContext.SaveChanges()
at Mongoose.Service.Data.MongooseDbContext.Mongoose.Common.Data.IDataSource<Mongoose.Ews.Server.Data.EwsServer>.Save()
at Mongoose.Ews.Server.Data.EwsServerDataAdapter.ConnectNew(String name, String address, String realm, String username, String password, Boolean autoStart, Boolean allowCookies, String assemblyFile, String className)
at SmartConnector.WeatherExtension.SetupProcessor.CreateEwsServer() in ...

Expected: True
But was: False

 

And I received this error at UpdateProcessorFixture/ExecuteTest :

Message:
Failed to connect to a valid EwsServerDataAdapter.
Expected: True
But was: False

 

I believe that I have a configuration issue of some kind, but I don't know where this configuration issue is and how to solve it.

 

Best,

 

Lydia

Attachments
Tags (9)
  • Tags:
  • connector
  • error
  • extension
  • guide
  • smart
  • smartconnector
  • test
  • tutorial
  • weather
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Anonymous user
Not applicable

Posted: ‎2019-11-06 01:55 PM

1 Like
0
1135
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2019-11-06 01:55 PM

This issue has been solved. Posting back here for public education.

 

The main problem associated with this is that no connection info was set up in SmartConnector.WeatherExtension.Test's App.config file.

When you run the test, it will try to connect to Smart Connector and set up an EWS server; however, it cannot do that if no connection info was set up. You have to go to the install directory for Smart Connector (will probably be C:/Program Files (x86)/Schneider Electric/Smart Connector) and open "Mongoose.Service.exe.config" in a text editor. Locate the <connectionStrings> element and copy the entire contents between the opening XML tag and the closing one </connectionStrings>. Paste that into the App.Config file, and do the same for the encryption key setting (included in the <appsettings> element). Refer to the attached picture.

APPCONFIG.png

 

However, if freshly downloaded from the repo, you will run into more issues after this one because a couple things need to be set up that are not. The next error will have to do with licensing, most likely. You want to disable licensing, so that a valid license file will not be required to run the processor. Simply have this region of code uncommented in the WeatherProcessorBase class:

#region IsLicensed - Override

     public override bool IsLicensed => false;

#endregion 

 

After all this, one will run the ExecuteTest (for SetupProcessor) with seemingly no unit test errors, and an EWS server will be created in the SmartConnector portal. However, the server will be stopped and cannot start. Looking into the logs will show an error that "SmartConnector.WeatherExtension.dll does not exist". Because of the custom EWS implementation, a DLL for this extension must be present in the Smart Connector Install directory. Follow these final steps and everything should run without a hitch:

1. Build the "SmartConnector.WeatherExtension" project after you have removed the need for licensing

2. Open Task Manager and Stop SmartConnectorService

3. The DLL produced by your build can be found in SmartConnectorSamples-master\SmartConnector.WeatherExtension\bin\Debug. Copy that dll into the SmartConnector install folder

4. Start the service back up

5. Run your unit tests

See Answer In Context

Reply
Reply 1
Anonymous user
Not applicable

Posted: ‎2019-11-06 01:55 PM

1 Like
0
1136
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2019-11-06 01:55 PM

This issue has been solved. Posting back here for public education.

 

The main problem associated with this is that no connection info was set up in SmartConnector.WeatherExtension.Test's App.config file.

When you run the test, it will try to connect to Smart Connector and set up an EWS server; however, it cannot do that if no connection info was set up. You have to go to the install directory for Smart Connector (will probably be C:/Program Files (x86)/Schneider Electric/Smart Connector) and open "Mongoose.Service.exe.config" in a text editor. Locate the <connectionStrings> element and copy the entire contents between the opening XML tag and the closing one </connectionStrings>. Paste that into the App.Config file, and do the same for the encryption key setting (included in the <appsettings> element). Refer to the attached picture.

APPCONFIG.png

 

However, if freshly downloaded from the repo, you will run into more issues after this one because a couple things need to be set up that are not. The next error will have to do with licensing, most likely. You want to disable licensing, so that a valid license file will not be required to run the processor. Simply have this region of code uncommented in the WeatherProcessorBase class:

#region IsLicensed - Override

     public override bool IsLicensed => false;

#endregion 

 

After all this, one will run the ExecuteTest (for SetupProcessor) with seemingly no unit test errors, and an EWS server will be created in the SmartConnector portal. However, the server will be stopped and cannot start. Looking into the logs will show an error that "SmartConnector.WeatherExtension.dll does not exist". Because of the custom EWS implementation, a DLL for this extension must be present in the Smart Connector Install directory. Follow these final steps and everything should run without a hitch:

1. Build the "SmartConnector.WeatherExtension" project after you have removed the need for licensing

2. Open Task Manager and Stop SmartConnectorService

3. The DLL produced by your build can be found in SmartConnectorSamples-master\SmartConnector.WeatherExtension\bin\Debug. Copy that dll into the SmartConnector install folder

4. Start the service back up

5. Run your unit tests

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of