The Emulator can be used to emulate a device (to test your mobile app), a mobile app (to test your device), or both (to see the end-to-end flow between the device, the Cirrent cloud, and the mobile app). The emulator has three parts - a device emulator (looks like a monitor), a mobile app emulator (looks like an iPhone), and a scrolling display of API calls made by the emulators to the Cirrent cloud.
Device Emulator - to test your mobile app
To emulate a device, you check the box "Emulate Connected Product" and enter a valid device id and secret. Click on 'Validate' to confirm that the device id and secret are correct. Then just click on the red circle (the power button) on the lower right hand corner of the monitor. You will see Cirrent API events displayed as the device emulator uploads its location and Wi-Fi scan, uploads logs, and gets an updated configuration, just like the real device. Then the device emulator will start polling to get private network credentials. Now you can use your ZipKey-enabled mobile app or the mobile app emulator to pass private network credentials to the device. When the device emulator receives the private network credentials, it will send a status saying it is JOINING the private network, then move over to that network, and upload a status saying it JOINED the network (if the credentials were valid) or FAILED to join the network (if the credentials were invalid).
If you want to run the device emulator again, just tap the power button on the monitor to turn it off and on again.
Mobile App Emulator - to test your device
To emulate the mobile app to test your device, you check the box "Emulate App" and tap on "Add a device". You will need to enable location services in your browser, as that is how the Cirrent cloud can determine your location, to find nearby discoverable devices.The App emulator will call the Cirrent cloud to find nearby devices. Note that it can only be used with Demo Device Types (you set this flag here). Your device should appear as an available device on the app emulator screen. Select the device. You'll now be presented with a list of networks that the device can see. Choose a network, enter the credentials and hit 'connect'. The credentials will be sent to the Cirrent cloud, where they can be retrieved by the device. If you enter a valid pre-shared key, the device should join the private network. If you enter an invalid pre-shared key, the device will report back that it FAILED to join the private network.
Emulating ZipKey Subscriber experience
Some ZipKey ISPs support a richer integration with Cirrent, where the network credentials can be retrieved from the ISP, instead of being entered by the end user. This experience is offered if the user's phone is on their private network, and the ISP has the credentials for that network. To emulate this flow, check the box "App is on demo-home-network". Now, when you start the emulator and select your device, you'll get an option to "Connect automatically with CableCo". Choose this option, and the emulator will emulate the flow where the credentials are retrieved from the ZipKey ISP and passed to the device. Alternatively, select "Connect manually" to pick the network for your device to join. Note that if you are testing this flow with a real device, you'll need to set up a test network called
demo-home-network as described here.
Binding your device
For simplicity (so that you can retest quickly) the emulator does not bind the device in the Cirrent cloud. However, to test the full device lifecycle, you should bind the device, as your app will be responsible for binding/resetting the device. To test this sequence, just check the box Bind Device and the emulator will bind the device before moving it over to the private network. If you do bind the device, you will need to reset the device, using the Device Explorer between each test.