Creating DeviceHive application for .NET Micro Framework

Not rated 24,154

Circuit Image

The Common Equipment library includes the implementation of the equipment utilized in this sample. The primary responsibility of the developer is to correctly initialize the device. After installing all necessary SDKs and updating the device firmware to the latest version, the following steps should be taken to create a DeviceHive-enabled application. Utilize the hardware watchdog timer to reset the device in the event of an unexpected hang-up. The watchdog can be initialized once the network connection is established, specifically in the Connected event handler. The BeforeCommand, AfterCommand, BeforeNotification, and AfterNotification event handlers are suitable locations to indicate the device's network activity, such as blinking an LED.

In the context of developing a DeviceHive-enabled application, the initialization of the device is a critical step that ensures proper functionality and communication within the network. The Common Equipment library serves as a pre-built framework that simplifies the integration of various hardware components, allowing developers to focus on the application logic rather than low-level device management.

To implement the hardware watchdog timer, it is essential to configure it to monitor the operational state of the device. The watchdog timer should be initialized in the Connected event handler, which signifies that the device has successfully established a network connection. This initialization can involve setting a timeout period that defines how long the device can operate without receiving a reset signal. If the device hangs or becomes unresponsive during this period, the watchdog will automatically trigger a reset, thus restoring normal operation.

In addition to the watchdog timer, the event handlers—BeforeCommand, AfterCommand, BeforeNotification, and AfterNotification—play a vital role in providing feedback about the device's network status. These handlers can be programmed to control an LED indicator, which visually represents the device's connectivity status. For instance, the LED can blink to signal that the device is actively communicating over the network, providing users with real-time feedback on the operational state of the application.

Overall, the integration of a watchdog timer and network activity indicators significantly enhances the reliability and user experience of the DeviceHive-enabled application, ensuring that the device remains responsive and provides clear communication regarding its operational status.As the Common Equipment library contains implementation of the equipment used in this sample, the only task for a developer is to properly initialize the device. After installing all the necessary SDKs and updating the device firmware to the newest version, the following steps need to be done to create a DeviceHive-enabled application.

Use the hard ware watchdog timer to reset the device in case of unexpected hang-up. The watchdog can be initialized after the network connection is established, in Connected event handler. BeforeCommand, AfterCommand, BeforeNotification and AfterNotification event handlers are good places to put indication of the device network activity, for example, a blinkikg LED.

🔗 External reference