# Manhole Cover Monitoring

## Introduction

**Supported in:** [SimplePack 2.0](https://gitlab.com/simplehw/ask/-/blob/asksync/working-with-devices/devices/simplepack/simplepack-3-0-and-4-0-plus.md), [SimplePack 3.0/4.0 Plus](https://gitlab.com/simplehw/ask/-/blob/asksync/working-with-devices/devices/simplepack/simplepack-3-0-and-4-0-plus.md), [SimpleIndustry](https://gitlab.com/simplehw/ask/-/blob/asksync/working-with-devices/devices/simpleindustry-simplemeter/simpleindustry-introduction.md)

**Intended for:** End users and integrators & platform providers to understand device behavior before direct implementation and fine-tuning (for those who want to integrate the device into their own platform, the firmware documentation is here: [API 6](https://simplehw.atlassian.net/wiki/spaces/DOC/overview) and [API 5](https://docs.google.com/spreadsheets/d/1616krkTZz6iCMI5YTxwOo10u3eYOwVr7-IzNzN86Kkw/))

**Use case description:** We will use the SimplePack mode **Put me back** - the device, installed on a manhole cover, will behave like this: First, when the device detects the cover being opened, you will receive a movement detection message. When the interaction is over and no movement is detected anymore, a time countdown will start and when it reaches zero, the device will send you a second message that will contain data from the accelerometer, which you can then use to determine what happened to the manhole cover - if it was returned to the original position or remained opened.

## Prerequisites

Before-you-start checklist (you should have everything on the list if you went through the [first message guide](https://ask.simplehw.eu/kb/simple-api-6-generation/i-am-iot-platform-provider/first-message)):

✅ Hardware/devices\
✅ Sigfox connectivity\
✅ Sigfox coverage where you need it\
✅ IO Frog platform account and access\
✅ Correctly set-up callbacks in the Sigfox backend (if you're using your own connectivity)\
✅ [You're receiving messages from your devices](https://ask.simplehw.eu/kb/simple-api-6-generation/i-am-iot-platform-provider/first-message)\
✅ *Everything is fine!*

## Step-by-step setup guide

1\. Go to the IO Frog platform and **login** with your account.

![image](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-c40b94a4f8e36f30f6560e03c043e0c326be0ad8%2Ft1.png?alt=media)

2\. After you login, head over to your profile in the top right and make sure your Experience level is **Expert**, otherwise you will not be able to change device downlink - if necessary, increase your level and hit Update to save the changes.

![image](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-9870a3bc8f6ad448582768b62a72eceb7c4b4a77%2Ft2.png?alt=media)

3\. Go to the All devices tab and click on device **Setup**.

![image](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-c74c48c85f5045e9aace85325d6735e0ab5e0ca5%2Ft3.png?alt=media)

4\. In the downlink tab, set the mode to **Put me back** (0...0106 in the top bar), hit Update.

![image](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-073cd8da197fbac79f63a428e530a6e2047b81e8%2Ft9.png?alt=media)

5\. Press the button of your device for 10+ (SP 2.0) or 6+ (SP 3.0 Plus) seconds, this will trigger downlink with the new settings - the **LED** will keep blinking for about a minute.

```
 If you're working with the **SimpleIndustry** or the **SimpleMeter**, you need to either wait for the heartbeat that will request downlink (older prototypes) or you will use a **magnet** on the reed switch instead of pressing the button. The time of operation is the same (6s+ of magnet presence to trigger downlink, 2-4s to disarm device, 1s to arm).
```

| SimplePack 2.0                                                                                                                                                                                                      | SimplePack 3.0/4.0 Plus                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![SimplePack 2.0](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-46f5f6224ab7bff1f49cc4a1a3008bbc52dc1d3f%2Fblob-1.gif?alt=media) | ![SimplePack 3.0/4.0 Plus](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-bf8e4232f24687a77830b8995ae9ce6311c04eda%2Fblob-2.gif?alt=media) |

6\. Once the LED stops blinking, you can place the device where you need it: use a heavy-duty double-sided tape or maybe magnets to stick it to the manhole cover. Please note that if the manhole is made of metal as most are, it's preferable to use a 2-3 cm plastic spacer (read more in our [article about device placement](https://ask.simplehw.eu/kb/simple-api-6-generation/device/correct-device-placement)).

7\. Once placed, activate the device by pressing the button and try opening and closing the cover to see if you get the messages right. *There, all done!*

Please note that Sigfox has a **90% delivery success rate**. It's possible that the downlink will not be received by the device, the best way forward in this case is simply **repeating the whole process from Step 4 onwards**.

## Suggestions

* If you're getting **false or limited reports** of usage, try playing around with **accelerometer sensitivity settings** (the higher the number, the less sensitive the sensor).
* If you're **losing a lot of messages**, set up **3x alert repetition**. This will better the performance of your device and you should lose less messages.
* **Public data sharing:** IO Frog also supports public channels, where you can add multiple devices and display data from all of them at the same time, including their position on a world map. It's very cool and we highly suggest you take a look! Here's our [coffee project](https://www.iofrog.com/public/iofrog/en/?channel=S2LZHUMFVQDNWFUM) and here's [how to set a public channel up](https://ask.simplehw.eu/kb/simple-api-6-generation/i-am-iot-platform-provider/public-channel-setup).

![image](https://2906494444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnuFF26iZs7gQn740zeZD%2Fuploads%2Fgit-blob-75be4ac49aa1d9f60c90db840d314df932e2e2ff%2Fcoffee.png?alt=media)
