To configure the first 3 parts of your Digital Twin, please refer to the Vehicle-Digital-Twin-Feedback-Loop repository.
-
Create an AWS Account.
-
Take note of your AWS Account ID as you'll need it to update your AWS Account ID in
./Connected-Vehicle/triggers/eventbridge_publish_battery_telemetry.json
-
To publish battery telemetry information to Eventbridge, please follow these steps in MongoDB Atlas under the App Services tab:
-
Navigate to the "Triggers" tab
-
Click on your eventbridge_publish_battery_telemetry trigger:
-
Under the "Function" Section select "EventBridge" as the Event Type
-
Update your AWS Account ID
-
Select an AWS Region
-
- Now expand the advanced options and copy/paste the following code into the Project Expression:
{ "operationType": { "$numberInt": "1" }, "vin": "$fullDocument.vin", "read": { "$map": { "input": "$fullDocument.measurements", "as": "item", "in": [ "$$item.voltage", "$$item.current" ] } } }
-
If not already completed, please refer to the link for prerequisites and setup of SageMaker domain.
Deploy the SageMaker model "Predictive Maintenance for Vehicle Fleets" to get the end-point.
Replace the SageMaker end-point with the one generated above here.
Create two lambda functions:
- For pulling the data from MongoDB cluster, refer this function.
- For pushing the predicted data back to MongoDB cluster, refer this function.
Please follow this guide.
Add the rule name, description and the eventbus from the dropdown.
Select the first option for Event source to pull data from MongoDB.
Select options for Event source, Partner and Event type as selected below.
Add previously created Lambda as target and create the rule.
This rule is created to move data between lambda functions.
Select other when selecting event source.
Add below event pattern to be able to send data using python function.
{
"source": ["user-event"],
"detail-type": ["user-preferences"]
}
On simulating the connected vehichle application the volatage and current of the vehichle are analysed for percentage of failure. The inference is stored back in MongoDB Atlas.
This gives a working template to setup an end-to-end flow for connected vehicles, to analyze its telemetric data using MongoDB Atlas and AWS Services.
Return to Part 4, if you are interested in running the Vehicle-Digital-Twin-Feedback-Loop!
For any further information, please contact [email protected]