Public | Automated Build

Last pushed: 22 days ago
Short Description
A small container that can be used to demo a connected vehicle via Azure IoT Hub
Full Description

docker run -it -e connectionString="HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=MyIothubownerSecretKey" kvaes/tasmaniantraders-iot-connectedvehicle

Environment variables

  • iothubconnectionstring : The shared access key of your iothubowner
  • offlineMin & offlineMax : define a range to simulate the vehicle being without connectivity => 0/1 for always online => 5/10 for a random number between 5 to 10 to define the intervals the device is offline
  • interval : the time between messages in seconds

What will this container do?

  • Register a device (random GUID)
  • Send messages

Sizing

  • Each container will consume (give or take) 50MB memory.

Sample output log

8/28/2017 10:42:26 PM02.64742933241753
8/28/2017 10:42:26 PMSleep for: 2s
8/28/2017 10:42:28 PMSleep for: 2s
8/28/2017 10:42:30 PMSleep for: 2s
8/28/2017 10:42:32 PM[ { id: 'c6c674c8-423d-47d3-9505-98a4c7aa0831',
8/28/2017 10:42:32 PM date: '2017-08-28T20:42:26+0000',
8/28/2017 10:42:32 PM message: 'test',
8/28/2017 10:42:32 PM speed: 6.428784941688033,
8/28/2017 10:42:32 PM temperature: 30.6223982669963,
8/28/2017 10:42:32 PM humidity: 53.19665417983593 },
8/28/2017 10:42:32 PM { id: '78228a2d-7f4e-440e-a796-dc0738a77632',
8/28/2017 10:42:32 PM date: '2017-08-28T20:42:28+0000',
8/28/2017 10:42:32 PM message: 'test',
8/28/2017 10:42:32 PM speed: 32.15119616141585,
8/28/2017 10:42:32 PM temperature: 18.200777198783786,
8/28/2017 10:42:32 PM humidity: 41.58547794728902 },
8/28/2017 10:42:32 PM { id: '78a0bbfd-788a-4de1-80e2-1a4752adc967',
8/28/2017 10:42:32 PM date: '2017-08-28T20:42:30+0000',
8/28/2017 10:42:32 PM message: 'test',
8/28/2017 10:42:32 PM speed: 21.31816268838907,
8/28/2017 10:42:32 PM temperature: 21.43808807413788,
8/28/2017 10:42:32 PM humidity: 61.7186363124554 } ]
8/28/2017 10:42:32 PMsending 3 events in a batch
8/28/2017 10:42:32 PMsend status: MessageEnqueued
8/28/2017 10:42:32 PMsend status: MessageEnqueued
8/28/2017 10:42:33 PM02.216329596611517
8/28/2017 10:42:33 PMSleep for: 2s

Docker Pull Command
Owner
kvaes

Comments (0)