Граф коммитов

96 Коммитов

Автор SHA1 Сообщение Дата
Jill Bender 65020212c1
Add UserAgent tagging to DS-1.0.x (#337)
* Integrate changes for tagging telemetry messages with user agent
* Update string in appsettings
2019-01-16 14:38:49 -08:00
Devis Lucato 6f0d073713
Performance improvements (#223)
* Refactor code writing twin tags for better performance
* Refactor device properties code for better performance
* Refactor simulation runner for better performance
* Improve connections performance
* Reduce time to start simulation, by creating devices using the same conn string and fetching device from registry only if the authentication fails.
* Limit the number of pending threads attempting to deliver telemetry
* Change all stock device models to use AMQP
* Move SDK timeout setting and other hard coded magic numbers to config file
* Use default timeout value from SDK instead of hardcoding it
* Improve documentation in the configuration file
* Upgrade IoT SDK
* Improve logging in device client
* Reduce noise in the "Info" log level
* When building, remove "deleted files" left over from previous builds
* Improve error detection when creating devices with batch operations
* Recreate device client when the internal AMQP client is disposed (lib bug workaround)
* VS code config update
* Remove simulation version, not used anywhere
* Catch and log when a device model doesn't exist
* Log missing config settings
* Make sure the simulation object is not lost in case of errors while checking for simulation changes
* Limit async tests duration
* Remove IoT hub registry workaround
* Fix boolean conf values parsing
* Remove "en-us" from links in the comments
* Fix invalid parsing of environment variables
2018-07-17 16:37:58 -07:00
Harleen Thind 876cb34a9e Updating owners list (#227) 2018-07-17 16:32:44 -07:00
Devis Lucato 4dbb2716c3 Update appsettings.ini (#230) 2018-07-17 15:56:29 -07:00
Mary Ellen Chaffin 8e4a45f335 Enabling use of VS Code for debugging (#220)
* Enabling use of VS Code for debugging

* clarify in readme
2018-06-26 13:22:00 -07:00
Isaac 341f3020e9 Fix for circular depedency [hold merge till other repos are ready] (#190)
* deviceProperties

* Json format

* comments

* Fix for Review comments

* GetPropertyNames

* GetPropertyNames

* nits

* Merge with master

** Resolve conflict
** Add tests

* Sort using

* Fix typo in file name

* Update DevicePropertyNames API

Change response from hashset to list

* Add API specs doc

* Fix indentation

* Fix typo

* Add test

* Add Comments

* deviceModelProperties

* api specs for device model Properties

* api spec update in sln

* Removing Comments

* DeviceModelPropertiesController Json change

* caps

* update API Spec

* reverting env var

* deviceModelProperties

* PREFIX moved to service model

* review comments some exception

* Revert "review comments some exception"

This reverts commit 6220a93d44.

* adding comments

* Update SomeException.cs

* Update SomeException.cs

* fix typo

* nit
2018-06-20 15:56:58 -07:00
Devis Lucato 7f4befe616
Before build, detect whether secrets are available (#217)
* Before checking all the env vars, detect whether secrets, usually encrypted, are available or not. Secrets are not available when building a pull request, so the script will not check for those.
2018-05-30 12:22:57 -07:00
Hugh Xiong 59347ead63 Custom device model management (#199)
* New endpoint to CRUD custom device models, stored via storage adapter
* Note: stock models are read-only
* Some changes to internal classes used for device models, e.g. use Enum instead of Strings
* Fix incorrect exception used in the Simulations service class: when the ETag doesn't match use ResourceOutOfDateException, not ConflictingResourceException (no API change, same HTTP status code)
2018-05-22 17:24:57 -07:00
Devis Lucato 5e454bca70
Improve cross platform dev (VS, VS for Mac, VS Code) (#211)
* Improve env var settings for cross platform dev (VS, VS for Mac, VS Code)
* Update documentation
2018-05-12 16:16:52 -07:00
Peter Felts ca0c8bb396 Remove duplicate firmware-update related status keys in twin (#209)
* Updating the key name of the reported device firmware update property, so that we won't have two reported properties: 'FirmwareUpdateStatus' and 'DeviceMethodStatus', one of which is always null.

* PR feedback.

* PR feedback.
2018-05-04 09:43:49 -07:00
Peter Felts 2d2a92d17e Removing the 'Restart' method from the engine device models to align with the spec. Also made some minor clean up to the Empty and Fill tank methods. (#205) 2018-04-30 17:25:10 -07:00
Zhang Hua 7637f1302e Revert "Change fuellevel and vibration value to non-zero value (#206)" (#207)
This reverts commit 2f8598654e.
2018-04-30 16:58:24 -07:00
Zhang Hua 2f8598654e Change fuellevel and vibration value to non-zero value (#206)
* Change fuellevel and vibration value to non-zero value

* ASA query can not process zero value in UDF function, we avoid to use
default zero value for engine device model
* TODO: Revert this commit once ASA fix the bug

* Fix based on comments
2018-04-30 15:58:28 -07:00
Peter Felts 5fab02209b Implement js device methods (#201)
* initial commit

* Cleaning up unneeded telemetry schema changes

* Removing jslint todo options

* Restoring launchSettings.json changes.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Updated JavaScript methods to throw an error if sent invalid input.

* PR feedback. Minor changes to log format for consistency. Updated docs.

* Updating state script files to use a consistent pattern for updating state, and corresponding documentation and interperter changes.

* PR feedback.

* Restoring TempIncrease, TempDecrease, FillTank, and EmptyTank methods, as RemoteMonitoring doesn't support method arguments now. Also: implemented these methods and made some corresponding tweaks to state files that can be impacted by the state that these methods change.

* Added state-restoration to temperature methods so that they won't error out if a previous state hadn't been set by the time they were called, and did some whitespace clean up and other minor clean up.

* Updated FillTank and EmptyTank to incrementally increase and decrease fuel level, respectively.
2018-04-27 10:06:00 -07:00
Peter Felts 05728205c9 Adding telemetry node to reported twin properties. (#204) 2018-04-24 13:28:29 -07:00
Jill Bender 69cccc417a remove 'Simulated.' prefix for simulated devices (#203) 2018-04-23 22:26:06 -07:00
Devis Lucato 53401f19f1 Remove symlink to /app/data (#202)
* Output env info during Docker image build

* comment out latest changes to Dockerfile

* Revert changes and remove symlink to /app/data

* undo changes to build script

* undo changes to build script

* trigger build
2018-04-21 12:29:55 -07:00
Jill Bender 0075b280c7 Add IsSimulated Tag when devices are created from list (#195)
* Simplify the device models, no methods and twins (#121)

* Remove unused models, scripts, methods, properties
* Upgrade to .NET Core 2.0
* Add some more logging
* Improve simulation runner startup to handle exceptions
* Update CI conf

* move docs, move wiki, new API specs, fix scripts for Windows Bash (#123)

* move docs, move wiki, new API specs, add copyright, fix for Windows Bash

* Disable twin read write by default and add config option to enable (#125)

* add config setting to turn of twin read/write
* add logic to only call twin reads/writes if enabled
* change twin read/write config value to an optional env var

* Allow to schedule a simulation, defining start and end time (#126)

* Support simulation duration and scheduling
* Fix the spelling of “ETag”
* Allow ETag=*
* adjust unit test precision to mitigate flaky test

* Upgrade Docker image to 2.0.3 (#132)

* Fix nullref exception

* Copy agent settings into web service

* Fix status endpoint

* Use S2 limits and increase async thread pool size

* Run a simulation against a hub provisioned by the user (#133)

* Add IoTHub with connstring to Api Model, pass "default" to use the configured hub
* Add private helpers to redact key from IotHubConnString
* Store non redacted entire connection string in a file
* Update API specs documentation

* Reduce the number of threads and improve overall performance (#137)

* Rewrite the simulation engine to use fewer threads
* Start sending telemetry as soon as possible
* Run simulation engine in the same process used for the web service
* Add workaround for registry manager becoming unresponsive
* Add more optional logging by device and by actor
* Use logging level and other logging settings from configuration

* New web service APIs (#138)

New web service APIs

* New API to support multiple scripts 
* New API to support custom sensors
* New API to support custom telemetry frequency
* New API to expose whether a hub is configured, i.e. provisioned and the connection string is in the config file
* Fix exception occurring when there is no connection string

* Simulation input validation (#140)

* Use custom frequency for telemetry and device state (#141)

* Apply the customized telemetry and state frequencies + fix bug for models with multiple messages
* Fix exception on bad request

* Improved Azure IotHub Connection String Validation  (#143)

* additional validation for iothub connection string

* check permissions with calls to registry manager instead of string comparison

* Refactor permissions validation into separate methods. Make sure test device created is deleted, create with a regognizable test name in case of error.

* remove await from Assert.ThrowsAsync

* added retry logic to delete test device

* Logging cleanup

* Internal scripts for increasing/decreasing/random (#146)

* Update travis CI config to use .NET core 2.0.3

* Fix log level parsing from the config, to be case insensitive

* Update simulation model parsing/serialization. Add script Params in the service layer

* Complete the device model override logic

* Add internal scripts

* Allow to override the initial state. Add “online” key where missing.

* Fix null reference exception in DeviceModelsGeneration (#147)

* Use env var to define log level (#150)

* Use env var to define log level
* Add env vars documentation ENVIRONMENT_VARIABLES.md

* bugfix: Etag mismatch now returns 409 Conflict instead of 400 Bad Request (#151)

* When available, return a URL to the metrics of the pre-provisioned hub (#153)

When available and when the simulation is running, return a URL to the metrics of the pre-provisioned hub. Also some changes to the /status endpoint

* Use PCS_LOG_LEVEL env var for log level, instead of LOG_LEVEL

* Create devices using batch operations (#154)

* When a simulation is deleted, delete also the devices
* When a simulation starts, create all the devices in batches

* Throw error on all-whitespace connection string & validate default hub (#155)

* Check for whitespace in custom connection string. Check that default IotHub exists and is valid.
* Update invalid connection string message
* fix log level for GetiotHubConnectionString()

* Map “Custom” device model id used by the UI to the internal ID

* Fix code style

* Fix Decrementing function

* Add system properties to the messages

* Remove old code used to detect simulation stop via cancellation token (#162)

* Remove old code used to detect simulation stop via cancellation token
* Rethrow timeout exceptions

* Fix for override stock device model with null value (#163)

* add null check for PUT payload properties

* add null check test

* update test arrangement

* uncomment UpdateTwinAsync

* add folder for DeviceTwinActor

* Fix exceptions when override stock device model (#164)

* Add null check for MessageSchema

* Add support classes for DeviceTwinActor to update twin -- uses empty methods

* remove Properties from DeviceStateActor class

* Add InternalDeviceState Class and ability to update twin via callback from javascript

* add placeholders for twin update logic for future pr

* remove eslint jsdoc updates and update javascriptinterpreter tests

* Add new thread for device properties updates

* return null for not implemented methods

* Add active device count for status API (#169)

* Register SimulationRunner as a singleton type
* Allow DeviceStatusActor report active status
* Add active device count to status API

* Add Unit Tests for Internal Device State

* Update existing tests with new InternalDeviceState class

* Update scripts with instructions on device property updates

* Fix errors with JS device scripts and readonly dictionary

* revert changes to DeviceTwin class

* Update log messages for readability with timestamp

* Rename logging methods for consistency

* Separate properties and state and remove unused lines

* update comments for twin update branch

* Revert UpdateTwinAsync signature in DeviceClient

* revert UpdateState and JSValueToDictionary to private

* update comment on restoreState in chiller js script

* Update InternalDevicePropertiesTest names

* set sending telemetry retry policy to No Retry (#175)

* Consolidated to SmartDictionary class

* remove DevicePropertiesActor, revert DeviceTwin, change terminology from sensors to state

* revert actors logger

* revert simulation runner

* revert simulation runner test

* revert deletion of UpdateReportedProperties.cs

* fix spacing in SimulationRunner

* fix spacing in device twin

* consolidate restore state javascript methods

* add properties to internal script method call

* variable/method naming, whitespace cleanup, add missing method in elevator state script

* Add Device Properties logic to internal simulation (#173)

* uncomment UpdateTwinAsync

* add folder for DeviceTwinActor

* Add support classes for DeviceTwinActor to update twin -- uses empty methods

* remove Properties from DeviceStateActor class

* Add InternalDeviceState Class and ability to update twin via callback from javascript

* add placeholders for twin update logic for future pr

* remove eslint jsdoc updates and update javascriptinterpreter tests

* Add new thread for device properties updates

* return null for not implemented methods

* Add Unit Tests for Internal Device State

* Update existing tests with new InternalDeviceState class

* Update scripts with instructions on device property updates

* Fix errors with JS device scripts and readonly dictionary

* revert changes to DeviceTwin class

* Update log messages for readability with timestamp

* Rename logging methods for consistency

* Separate properties and state and remove unused lines

* update comments for twin update branch

* Revert UpdateTwinAsync signature in DeviceClient

* revert UpdateState and JSValueToDictionary to private

* update comment on restoreState in chiller js script

* Update InternalDevicePropertiesTest names

* Consolidated to SmartDictionary class

* remove DevicePropertiesActor, revert DeviceTwin, change terminology from sensors to state

* revert actors logger

* revert simulation runner

* revert simulation runner test

* revert deletion of UpdateReportedProperties.cs

* fix spacing in SimulationRunner

* fix spacing in device twin

* consolidate restore state javascript methods

* add properties to internal script method call

* variable/method naming, whitespace cleanup, add missing method in elevator state script

* Revert "Add Device Properties logic to internal simulation (#173)"

This reverts commit 37a720d044.

* [Updated] Add DevicePropertiesActor and push reported properties updates to the IoT Hub (#181)

* Initial commit with placeholders for sending twin updates

* Add skeleton DevicePropertiesActor and integrate with SimulationRunner

* Add mock devicePropertiesActor for SimulationRunnerTest

* added Device Properties Actor Setup

* add device properties actor tests

* Add Device Properties logic to internal simulation (#173)

* uncomment UpdateTwinAsync

* add folder for DeviceTwinActor

* Add support classes for DeviceTwinActor to update twin -- uses empty methods

* remove Properties from DeviceStateActor class

* Add InternalDeviceState Class and ability to update twin via callback from javascript

* add placeholders for twin update logic for future pr

* remove eslint jsdoc updates and update javascriptinterpreter tests

* Add new thread for device properties updates

* return null for not implemented methods

* Add Unit Tests for Internal Device State

* Update existing tests with new InternalDeviceState class

* Update scripts with instructions on device property updates

* Fix errors with JS device scripts and readonly dictionary

* revert changes to DeviceTwin class

* Update log messages for readability with timestamp

* Rename logging methods for consistency

* Separate properties and state and remove unused lines

* update comments for twin update branch

* Revert UpdateTwinAsync signature in DeviceClient

* revert UpdateState and JSValueToDictionary to private

* update comment on restoreState in chiller js script

* Update InternalDevicePropertiesTest names

* Consolidated to SmartDictionary class

* remove DevicePropertiesActor, revert DeviceTwin, change terminology from sensors to state

* revert actors logger

* revert simulation runner

* revert simulation runner test

* revert deletion of UpdateReportedProperties.cs

* fix spacing in SimulationRunner

* fix spacing in device twin

* consolidate restore state javascript methods

* add properties to internal script method call

* variable/method naming, whitespace cleanup, add missing method in elevator state script

* Revert "Add Device Properties logic to internal simulation (#173)"

This reverts commit 37a720d044.

* Add State Machine for device properties updates

* Add Device Property Update Logic and Remove Unused Device Twin Model

* delete old commented out DeviceConnection/UpdateReportedProperties.cs

* Add tests for UpdateReportedProperties

* Add properties to device models & clean up UpdatePropertiesAsync

* remove unused usings

* remove unnecessary lock in JavascriptInterpreter

* Parvezp/add methods (#182)

* Initial commit with placeholders for sending twin updates

* Add skeleton DevicePropertiesActor and integrate with SimulationRunner

* Add mock devicePropertiesActor for SimulationRunnerTest

* added Device Properties Actor Setup

* add device properties actor tests

* Initial check-in for adding methods

* Updating the tabs

* Adding more log parameters

* Fixing build break
Sorting using

* Adding all the simulated devices,state and methods (#183)

* Initial commit with placeholders for sending twin updates

* Add skeleton DevicePropertiesActor and integrate with SimulationRunner

* Add mock devicePropertiesActor for SimulationRunnerTest

* added Device Properties Actor Setup

* add device properties actor tests

* Initial check-in for adding methods

* Updating the tabs

* Adding more log parameters

* Fixing build break
Sorting using

* * Adding all simulated devices
* Adding all of their state javascript files
* Adding all of the javascript  methods for those simulated devices

* Adding unit tests for the new files

* Addressing comments

* Removing extra space that i missed

* Update FirmwareUpdate method to use correct parameters in the callback from js to c# (#186)

* Feature/telemetry metrics (#170)

* Add simulation status reporting messages throughput and errors counters
* Do not retry sending telemetry in case of errors
* Change Azure SDK timeout to 10 seconds (default is 4 minutes)
* Improve SDK exceptions handling
* Fix rare exception due to contention on the `state` variable

* Change stock models to use AMQP (#189)

* Upgrade Azure IoT SDK: Devices 1.4.1 to 1.6.0 (#187)

Upgrade Azure IoT SDK: Devices Client 1.5.2 to 1.7.0
Upgrade test dependencies

* Register for Desired Property State Changes (#184)

Adds functionality for receiving notifications of Desired Property state changes from the IoT Hub. When the hub detects a state change it will send a notification via the DeviceClient.SetDesiredPropertyUpdateCallbackAsync registration. This change allows the simulation service to subscribe to the change notifications and update the internal simulation state to report the desired property to the hub when executed.

Changes:
* add callback for desired properties updates to Device Client
* add DevicePropertiesRequestTest
* add property for SupportedMethods

* Update DeviceConnectionActorTest with correct constructor for DeviceConnectionActor

* Update DEVICE_MODELS.md

* Add waiting state for properties update

* Update SetAll in SmartDictionar to set a new ConurrentDictionary

* Refactor properties actor

* Rename DeviceProperties.cs & methods, make callback private, update tests

* remove unused property from DevicePropertiesActor

* UpdateReportedPropertiesTest changes to reflect desired functionality

* Update DeviceConnectionActor state machine to tag simulated devices that were created via a list creation in Devices.cs

* Add Device Methods and Properties Functionality (#193)

* Add new state machine to manage changes to devices' "reported properties"
* Add callback to manage changes to devices's "desired properties"
* Add callbacks to manage method calls
* Refactor and improve how simulation scripts access state and properties

* move device tagging to DevicePropertiesActor and update tests

* Fix DevicePropertiesActor reference to twin failure count

* remove whitespace

* Fix merge conflicts between azure-iot-pcs-simulation and master (#196)

* Fix #122 + backport fix for flaky test (#128)

* Upgrade to .NET Core 2.0 and upgrade dependencies (#130)

* Upgrade to .NET Core 2.0 and upgrade dependencies
* Update comments and docs

* Change Docker base image to use .NET Core 2.0.3 (#131)

* Change Docker base image to use .NET Core 2.0.3

* use jessie

* Use absolute instead of relative links to wiki (#161)

Fix for:
https://github.com/Azure/device-simulation-dotnet/issues/39

The relative links don't resolve to the wiki page ending up in a 404. This update changes the URL links to be the full relative link to the documentation page.

* Remove squash (#166)

* Removing the squash flag

* Fixing extra space

* Use env vars in launchSettings.json (#168)

* Docker container excessively privileged running root user (#178)

* Add default non-root user 'pcsuser'
* Run service as 'pcsuser'

PBI[2211778]

* remove whitespace

* revert SimulationAgent.csproj changes

* Adjust whitespace in SimulationAgent.csproj

* remove newline

* Move FailedDeviceTwinUpdatesCount logic to SimulationRunner

* rename Tag to SetDeviceTag

* rename twin to device

* Clean up comments

* Upgrade travis.yml dotnet core version

* revert .Net core upgrade for travis

* Update .travis.yml

* Fix build

* fixing build...

* tag devices with ContinueWith

* fix typos
2018-04-19 11:16:27 -07:00
Parvez ea79508aea
Update CODEOWNERS (#198) 2018-04-13 09:56:25 -07:00
Jill Bender b211cb7805 Merge azure-iot-pcs-simulation into master (#197)
* Rewrite to use fewer threads and increase throughput
* Expose simulation metrics in the status endpoint
* When available, return a URL to the Azure Portal metrics of the pre-provisioned IoT Hub
* Allow to run a simulation against a custom IoT Hub, passing the connection string
* Allow to schedule a simulation, defining start and end time
* Improve security by running the service as a non-root user
* Support multiple behavior scripts in a device model
* Support custom device with custom sensors, behavior and frequency
* Allow to override the initial device state when creating a simulation
* When a simulation starts, create all the devices in batches
* When a simulation is deleted, delete also the devices
* Refactor timers to start sending telemetry as soon as possible
* Refactor and improve how simulation scripts access state and properties
* Change stock models to use AMQP (#189)
* Overall improvements to exceptions handling
* Disable SDK retry, and change timeout from default (4 minutes) to 10 seconds
* Do not retry sending telemetry on failure, skip message
* Use IoT Hub S2 SKU limits by default
* Upgrade to .NET Core 2.0.3
* Upgrade Azure IoT SDK: Devices 1.4.1 to 1.6.0, Devices Client 1.5.2 to 1.7.0
* Run simulation engine in the same process used for the web service
* Move docs, move wiki, new API specs, fix scripts for Windows Bash
* Fix the spelling of “ETag” and allow ETag=*
* Add internal scripts for increasing/decreasing/random telemetry
* Add env vars documentation ENVIRONMENT_VARIABLES.md
* Add more optional logging by device and by actor
* Use logging level and other logging settings from configuration
* Adjust unit test precision to mitigate flaky test
* Add system properties to telemetry messages
* Removing the squash flag from Docker scripts
* Use env vars in launchSettings.json
2018-04-12 17:42:46 -07:00
Zhang Hua 1e7089446a Docker container excessively privileged running root user (#178)
* Add default non-root user 'pcsuser'
* Run service as 'pcsuser'

PBI[2211778]
2018-03-14 12:38:33 -07:00
Mary Ellen Chaffin 9d98f50caf Use env vars in launchSettings.json (#168) 2018-02-22 12:00:23 -08:00
Parvez 5e8e55e1a0
Remove squash (#166)
* Removing the squash flag

* Fixing extra space
2018-02-16 15:38:33 -08:00
Jill Bender e6a2e58463 Use absolute instead of relative links to wiki (#161)
Fix for:
https://github.com/Azure/device-simulation-dotnet/issues/39

The relative links don't resolve to the wiki page ending up in a 404. This update changes the URL links to be the full relative link to the documentation page.
2018-01-24 14:08:35 -08:00
Devis Lucato 837788375d Change Docker base image to use .NET Core 2.0.3 (#131)
* Change Docker base image to use .NET Core 2.0.3

* use jessie
2017-11-17 17:01:48 -08:00
Devis Lucato b453d6210d
Upgrade to .NET Core 2.0 and upgrade dependencies (#130)
* Upgrade to .NET Core 2.0 and upgrade dependencies
* Update comments and docs
2017-11-17 13:54:53 -08:00
Devis Lucato 777187acbd
Fix #122 + backport fix for flaky test (#128) 2017-11-16 18:03:05 -08:00
Devis Lucato 4342240b4e
Temporary workaround for deserializing twin JSON 2017-10-31 23:46:42 -07:00
Devis Lucato fd19210445
Allow demos to fix/break the simulated chillers (#104)
* Change the Chiller simulation to support fixing/breaking the state via methods
2017-10-27 17:17:03 -07:00
Tim Laverty d5e95c8e82 Set method result to empty string @ execution completion. Add exception handler to callback function called by hub. (#99) 2017-10-20 11:22:33 -07:00
Devis Lucato a51cb6f71b Retry downloading OpenId certs in case of failure (#98) 2017-10-19 12:32:18 -07:00
Devis Lucato 0d37f32671 Limit registry and twin operations as per configuration (#78)
* New configuration settings for rate limiting
* Rate connections and messaging frequency
* Don’t read the twin on creation
*  reate GitHub issues tracking the TODO notes
* Change the timer to run only once and support scenarios where it is being disposed
* Pass the cancellation through where it can be used by IoT SDK
* Fix web service returning the wrong ETag when editing a simulation
* Remove all the timeouts incompatible with throttling (i.e. throttling will slow down operations and a timeout wouldn’t make sense)
* Improve the Actor stop logic to be resilient to errors and make all the required steps regardless of exceptions
* Use async/await where possible to avoid the use of .Wait() and .Result
* Log throughput in debug mode
2017-10-18 22:21:01 -07:00
Tim Laverty efd251b915 Move desired property check to own thread (#75)
* split desired property value updates onto a dedicated thread w/ a different timer interval than telemetry updates.

* error handling, cleanup, testing

* property updates changed to every 30 secs.
2017-10-10 11:26:13 -07:00
Devis Lucato d9d5a54e25 Remove duplicate code from IFactory implementation (#74)
* Remove duplicate code from IFactory implementation
* Update GitHub templates
2017-10-09 20:28:58 -07:00
Devis Lucato 961bc428f2 Update scripts to use “testing” version 2017-10-04 19:35:40 -07:00
Devis Lucato a5c9dcd563 Update device-simulation.sln.DotSettings 2017-09-29 18:49:45 -07:00
Devis Lucato c8c0566900 Update README.md 2017-09-29 13:47:52 -07:00
Devis Lucato c3dbf9d646 Merge sensors messages (#65) 2017-09-28 01:43:49 -07:00
Tim Laverty 51630ec0cc Switch devices to MQTT, Add exception handler to Actor::Stop (#62)
* Switch devices to use MQTT

* Add exception handler to Actor::Stop

* update version
2017-09-26 14:27:36 -07:00
Devis Lucato 4c1511a0f4 Add Auth to webservice (#61)
* Add Auth and refactor CORS (sync with other services)
* Revisit configuration format, sync with other services
2017-09-26 11:51:27 -07:00
Devis Lucato 13e6ebf863 Code style 2017-09-22 18:43:21 -07:00
Jill Bender 469f8b0a64 Update CONTRIBUTING.md with code of conduct (#58)
* Update CONTRIBUTING.md with code of conduct
2017-09-20 11:20:05 -07:00
Devis Lucato 8f106a28d9 Update version number 2017-09-19 12:23:47 -07:00
Tim Laverty 3ff4ffae0a Add capability to change simulation at runtime. (#54)
* reboot & firmware update support for other device models

* Add capability to change simulation.

* actor not existing cleanly

* typo

* update version

* Refactoring and nits per PR review.

* PR nits
2017-09-18 18:33:50 -07:00
Tim Laverty c33241a5cd Methods and docs (#40)
This PR provides method support for chillers in the default simulation: reboot, firmware update, increase pressure, and decrease pressure.  It also keeps reported properties in sync with desired properties (by polling for value changes).

* DeviceMethod implmentation class

* First round of methods, added: 1) infra for registering methods for devices, 2) walking avail. methods for each device.  Main functionality missing is allowing specifation and then running the method script.

* remove todo from actor

* nits to code style

* Move methods ownership from devicebootstrap to deviceclient.

* error handling and todos.

* retry method registration, minor fixes.

* nits, logging, removed exception handling for registering methods (it's handled by the parent method)

* bumped version

* code style nits

* Methods use scripts.

Desired properties are polled in UpdateDeviceState and delta is copied into Reported property values.

Telemetry is not sent if the device is marked other than online == "True"

* code style/cleanup changes.

change get query for simulations to linq query rather than iterating the list.

* update version

* Exception handling for updatedevicestate

nit for rename method execution endpoint to include Async suffix.

* nit fix comment code style

* Inject scriptinterpreter. refactoring.

* nits

* state update bug

* no need for scriptengine null check

* Bootstrap individual methods, implement decreasepressure aka EMergencyValveRelease

* remove connection string :(

* fixed threading problem w/ methods, implemented & tested first four methods

* Implement switch to turn random telemetry off; e.g. when increasepressure is called, wait until decreasepressure is called to turn it back on.

* remove clearing of DeviceMethodStatus

* Code style changes + fix some jslint errors

* Fix js methods files

* DeviceMethods code style changes

* Devices.cs code style

* JavascriptInterpreter.cs code style

* script changes for messages, docs

* Cleanup up Javascript functions, create Issue to track implementing functions not yet done.

* Halve the amount of telemetry sent

* Address PR comments.

* issue for script interpreter todo

* todos, nits, pr feedback
2017-09-07 15:08:26 -07:00
Tim Laverty 6ca39dd56c Methods and docs (#38)
* DeviceMethod implementation class

* First round of methods, added: 1) infra for registering methods for devices, 2) walking avail. methods for each device.  Main functionality missing is allowing specifation and then running the method script.

* nits to code style

* nits, logging, removed exception handling for registering methods (it's handled by the parent method)

* bumped version
2017-08-28 16:59:32 -07:00
Devis Lucato fa33a81cf0 Delete overview.svg 2017-08-23 19:18:28 -07:00
Devis Lucato 41fc520463 Update documentation (#36)
* Update contrib notes
* Update README
2017-08-23 19:18:10 -07:00
Devis Lucato 11df7f13d2 Update overview.png 2017-08-23 19:16:38 -07:00
Devis Lucato e74f17e640 Add overview.png 2017-08-23 19:02:33 -07:00