# Edge Device Gateway Script

**URL:** <https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 26, 2025, 3:18pm UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254 "2025-03-26T15:18:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [March 26, 2025, 3:18pm UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254/1 "2025-03-26T15:18:06Z")

</div>

I have a Main Gateway talking to a Edge Device Gateway.

A script to turn a tag off resides on the Edge Device. It is running as a Gateways Script.

On my Main Gateway I have a reference tag to the Edge Device. When I turn the tag on, the Edge Device Script should turn it off after 2 seconds. Handshaking signal.

This only works when I have the Edge Device Designer open. It is like the Gateway script is not running on the Edge Device. Not sure what is preventing it from running. Any thoughts?

Opto22 with Version: 8.1.21

Edge Compute is Active on License:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c841b46900cb4609e20a7ed630d00f8c291dd630.png)

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [March 27, 2025, 12:24pm UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254/2 "2025-03-27T12:24:55Z")

</div>

Discovered the end user was closing the session. Problem solved.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2025, 1:08pm UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254/3 "2025-03-27T13:08:48Z")

</div>

I'm confused. What was running in a session? (Gateway scripts run regardless of client sessions.)

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [April 1, 2025, 4:54am UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254/4 "2025-04-01T04:54:02Z")

</div>

Should clarify. I had some session props running scripts. For example, one was running a historical tag binding with a script transform. It was not updating. I didn't realize the issue until I found the edge device was not running a perspective session. It appeared this was the reason none of the scripts were updating.

A couple things I couldn't figure out. Related to Gateway Scripts. The version of Ignition is not the latest. It's on an Opto22. Everyone was working great with a designer open. As soon as I closed it, the scripts stopped working. I assume any gateway scripts would run regardless of a perspective session active. This is an edge version of Ignition.

1. Tag change script was not working. I have a Gateway that turns a tag on at an edge device. The edge device refreshes some data. The tag turns itself off using a tag change script on the tag. This didn't work when the edge device wasn't running a perspective session.

2. Gateway Timer script not working. I tried running the same code on a Gateway script. Ran into the same issue. The tag comes on, if it's True... Turn the state to False.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2025, 11:51am UTC](https://forum.inductiveautomation.com/t/edge-device-gateway-script/104254/5 "2025-04-01T11:51:54Z")

</div>

You'll have to share your code. There may be a bug in that old version, but not enough information.
