# Goes in production mode NOW!

**URL:** <https://community.zymbit.com/t/goes-in-production-mode-now/1058>\
**Category:** Getting Started\
**Created:** [December 22, 2020, 8:06pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058 "2020-12-22T20:06:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [December 22, 2020, 8:06pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/1 "2020-12-22T20:06:28Z")

</div>

Hi Bob,

I need your help 😌

Is are the follows steps right:

(I use two circuits tamper 😆)

1. Close your perimeter circuit(s) (enclosure lid)  
–\> Close case, channel 1 and 2, circuit closed

2. Clear Perimeter Detect Events  
–\> zymkey.client.clear\_perimeter\_detect\_info()

3. Get Perimeter Detect Info to confirm prior events are cleared and the perimeter is closed.  
–\> zymkey.client.get\_perimeter\_detect\_info()

4. If the Perimeter Detect Event returns clear, then you can ‘arm your system’ as you require by setting Set Perimeter Event Actions to “none”, “notify” or “selfdestruct”  
–\> zymkey.client.set\_perimeter\_event\_actions(0, action\_notify=False, action\_self\_destruct=True)  
–\>zymkey.client.set\_perimeter\_event\_actions(1, action\_notify=False, action\_self\_destruct=True)

Do I not need to perform step 12 before cutting the tab?

Is it possible when the system is armed to set the settings back to alarm only?

How can I read the values from the command:

–\> zymkey.client.set\_perimeter\_event\_actions(0, action\_notify=False, action\_self\_destruct=True)  
–\>zymkey.client.set\_perimeter\_event\_actions(1, action\_notify=False, action\_self\_destruct=True)

I would like to query what values are stored in the module.

Thanks 😃

Mara

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [December 22, 2020, 11:43pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/2 "2020-12-22T23:43:56Z")

</div>

Hi Mara,

The Getting Started page ([https://community.zymbit.com/t/getting-started-zymkey4i-with-raspberry-pi/202](https://community.zymbit.com/t/getting-started-zymkey4i-with-raspberry-pi/202) has the detailed steps on it for review.

You do not need to do Step 12 before cutting the tab. In fact, you want to do it after. You get one time to set\_perimeter\_event\_actions after cutting the tab. One and only one. You cannot change the settings after that.

There is also no way to read the settings back.

The flow is:

- Set perimeter actions to None or Notify
- Power down.
- Cut the lock tab.
- Close circuits and case
- Power up
- Clear perimeter events
- Check perimeter events to make sure no events
- Arm your system by setting to desired Action: Notify or Self-Destruct.

The Action is now permanent. The Action cannot be changed again.

Bob

---

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [December 23, 2020, 8:44am UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/3 "2020-12-23T08:44:01Z")

</div>

Hi Bob,

the manual is not detailed for me because you have to look up the commands in the manual. I assume the ones I have listed are correct for the step?

I would be happy if I can read the module status:  
Mode: Production / Dev  
Operating: Run / Stop / Fail  
Tamper Protect: Notify / Selfdest

Do I have to set at channels at the end:  
-\>zymkey.client.set\_perimeter\_event\_actions(0, action\_notify=False, action\_self\_destruct=True)  
-\>zymkey.client.set\_perimeter\_event\_actions(1, action\_notify=False, action\_self\_destruct=True)  
?

For me the procedure here is just too little documented…

Mara

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [December 23, 2020, 7:46pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/4 "2020-12-23T19:46:20Z")

</div>

Hi Mara,

Getting module status was intentionally made difficult originally for security reasons. More customers have been asking for that information so we are going to add more of that functionality into a future release of our APIs. In the meantime, here is how you can get some of the info:

`nc localhost 9539`

Returns some status information that includes whether the Zymkey is in Production mode or Developer mode. Check the setting of “bind\_locked”: True means the Zymkey is in Production mode; False is Developer mode.

`systemctl status zkifc`

Will tell you if the Zymkey is Active(Running) or Inactive(Dead).

Unfortunately, there is no way to retrieve the Tamper Detect setting at this time. The “get” for that setting will be included in a future API release.

After cutting the tab, you want to clear the events, check to make sure you are not getting any events, and then set\_perimeter\_event\_actions. You will have to set\_perimeter\_event\_actions at the end. Keep in mind, like I said earlier, after cutting the lock tab, you can only set the event action one time. You cannot change the settings. That prevents someone coming in later and turning off self-destruct.

Yes, your commands are correct to set self-destruct on for both channels.

Bob

---

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [December 23, 2020, 10:21pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/5 "2020-12-23T22:21:09Z")

</div>

Hi Bob,

thanks for you inputs!

When coming the new zymkey and api? Does the new component have the same dimensions?

–\> nc localhost 9539  
How do I put the command to get only this answer: “bind\_locked”: false

Thanks and happy holidays 🤗

Mara

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [December 28, 2020, 5:50pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/6 "2020-12-28T17:50:08Z")

</div>

We should have the new APIs out in January/February. The form factor will be the same.

This command should give you what you want. You can probably come up with a better way to do it:

`echo -n "Bind Locked: "; echo "" | nc localhost 9539 | sed -n -e 's/^.*"bind_locked": //'p | cut -d"'" -f1`

---

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [December 28, 2020, 6:25pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/7 "2020-12-28T18:25:51Z")

</div>

Thanks! 😌

my output is

> Bind Locked: true, “status”: “success”}}

too much: , “status”: “success”}}

I modifiy this for my output:  
`echo -n "Bind Locked: "; echo "" | nc localhost 9539 | sed -n -e 's/^.*"bind_locked": //'p | cut -d"," -f1`  
 → Bind Locked: true

Is the new API compatible to Zymkey 4?

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [December 28, 2020, 9:31pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/8 "2020-12-28T21:31:00Z")

</div>

Woops! I mistyped the comma. Glad you fixed.

Yes, the new API functions will be compatible with the existing Zymkey4.

---

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [January 19, 2021, 7:45pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/9 "2021-01-19T19:45:51Z")

</div>

What is here false:

> zymkey.client.set\_perimeter\_event\_actions(0, action\_notify=False, action\_self\_destruct=True)

> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/usr/local/lib/python3.7/dist-packages/zymkey/module.py”, line 895, in set\_perimeter\_event\_actions  
> raise AssertionError(‘bad return code %d’ % ret)  
> AssertionError: bad return code -1

Thanks

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [January 20, 2021, 1:24am UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/10 "2021-01-20T01:24:30Z")

</div>

Is it possible you were in Production Mode and have the Perimeter 0 open? If so, unfortunately you would immediately self-destruct and then get a bad return code. Is the Blue LED flashing 5 flashes in between rapid flashes? That would indicate you have self-destructed.

Bob

---

<div class="post-metadata">

**Author:** ![bits](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bits](https://community.zymbit.com/u/bits)\
**Post date:** [January 24, 2021, 8:17am UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/11 "2021-01-24T08:17:57Z")

</div>

Thanks, perimeter are closed. The system are running. When coming the new api?

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [January 25, 2021, 7:57pm UTC](https://community.zymbit.com/t/goes-in-production-mode-now/1058/12 "2021-01-25T19:57:59Z")

</div>

The new APIs are still a couple of weeks out.

When you say the system is running, does that mean your setup is working at this point in time? Maybe you can attach a little video of what the blue LED is doing?

Bob
