# Checking if the last attempt to communicate with notehub was successful

**URL:** <https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922>\
**Category:** Troubleshooting\
**Tags:** cellular-coverage, firmware-release\
**Created:** [January 30, 2024, 3:35pm UTC](https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922 "2024-01-30T15:35:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maya](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@maya](https://discuss.blues.com/u/maya)\
**Post date:** [January 30, 2024, 3:35pm UTC](https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922/1 "2024-01-30T15:35:49Z")

</div>

Hi there,

I’m trying to determine the best way to check the status of the last attempt to reach out to notehub. I am currently using the hub.sync.status and checking if the “completed” field is there.  
Reading through some of the docs, it looks like the completed field is there in the case where the notecard is in the penalty box.

{“req”:“hub.sync.status”}

{“alert”:true,“status”:“connect delayed (60 min remaining): can’t open session to discovery service: socket: cannot find host: [blah.notefile.net](http://blah.notefile.net) {service}{host-unreachable} {service}{extended-service-failure}”,“time”:1638397092,“ **completed** ”:24}

Looking for recommendations on how to check last connection attempt is successful (including hub.sync and outbound interval) … how have you done this?

Thanks  
Maya

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [January 30, 2024, 4:11pm UTC](https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922/2 "2024-01-30T16:11:28Z")

</div>

Hi @maya and welcome to the Blues community!

The `completed` field will tell you the seconds since the last completion of a sync with Notehub (though that does not guarantee that the sync was successful, as you see here). I would also look for `alert:true`. If that exists, there was an error during the most recent sync. Finally, the `status` field contains a lot of useful information as well (anything in the curly braces `{}` are [static status/error codes](https://dev.blues.io/notecard/notecard-walkthrough/notecard-error-and-status-codes/#notecard-error-and-status-codes) that do not change between Notecard firmware versions).

Rob

---

<div class="post-metadata">

**Author:** ![maya](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@maya](https://discuss.blues.com/u/maya)\
**Post date:** [January 30, 2024, 4:31pm UTC](https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922/3 "2024-01-30T16:31:54Z")

</div>

Thanks Rob.

Unfortunately, even when the connection was successful, I get the alert:true for other reasons, so I found the alert not reliable to use as my trigger/flag. I want to have a simple way to constantly monitor the last connection attempt and if the last message had an alert:true → it would be difficult to set my status LED to indicate something is wrong with my comms. It sounds I may have to do a combo of checking for completed (because that gets set when successful after a hub.sync) && alert not set.

Thanks

Maya

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [January 30, 2024, 5:11pm UTC](https://discuss.blues.com/t/checking-if-the-last-attempt-to-communicate-with-notehub-was-successful/1922/4 "2024-01-30T17:11:21Z")

</div>

Yeah, sorry I wasn’t clear but my suggestion is to use the `alert:true` in combination with measuring `seconds` since the last successful sync. There are MANY points of potential network failure in between a Notecard and Notehub that are dependent upon cellular carriers, towers, etc.

Rob
