# Issue with Gateway Timer Script

**URL:** <https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860>\
**Category:** Ignition\
**Created:** [November 14, 2018, 5:30pm UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860 "2018-11-14T17:30:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [November 14, 2018, 5:30pm UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/1 "2018-11-14T17:30:56Z")

</div>

I’m trying to automatically run the following code as a Gateway Timer Script, but it doesn’t work, nevertheless when I run it for example by pressing a button it works perfectly.

The Ignition versión I’m working with is 7.7.8

```auto
	source = system.net.httpGet("https://opendata.aemet.es/opendata/api/observacion/convencional/datos/estacion/3195/?api_key=<key>")
	url=system.util.jsonDecode(source)
	
	url= (url["datos"])
	datos=source = system.net.httpGet(url)
	lista=system.util.jsonDecode(datos)
	temp=lista[23]['ta']
	humed=lista[23]['hr']
	t1=float(temp)
	h1=float(humed)
#	print(t1,h1)
	ruta=["Temp_ext_wunderground","Humedad_ext_wunderground"]
	valores=[t1,h1]
	system.tag.writeAll(ruta,valores)

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 14, 2018, 5:36pm UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/2 "2018-11-14T17:36:16Z")

</div>

I removed the API key from your code sample - I don't know if it's particularly sensitive, but figured I'd err on the side of caution. That said, the issue with your script is this line:

> [@jose.granero](#):
>
> `ruta=["Temp_ext_wunderground","Humedad_ext_wunderground"]`

When you write to tags from the gateway scope, you need to use fully qualified tag paths, because even if there is only one tag provider, the gateway doesn't know which one is the "default" to use. Fully qualified paths have the tag provider name in square brackets as a prefix:  
`ruta=["[default]Temp_ext_wunderground","[default]Humedad_ext_wunderground"]`

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [November 14, 2018, 7:12pm UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/3 "2018-11-14T19:12:59Z")

</div>

Thank you so much Paul. What a lapse 🙂

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [November 15, 2018, 8:04am UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/4 "2018-11-15T08:04:53Z")

</div>

Hi Paul,

I’ve tried with the full qualified path but it doesn’t work either when running as a Gateway script.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [November 15, 2018, 10:49am UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/5 "2018-11-15T10:49:47Z")

</div>

Check the logs in the gateway status page, and try adding “Import system” at the top of your script

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [November 15, 2018, 11:23am UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/6 "2018-11-15T11:23:00Z")

</div>

Thank you, but adding import system hasn’t solved the issue. Please find ecnlosed the log, where I can’t see any thing related to this Gateway Script which I’ve called[logs.bin.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8d9ce2081fbd2879943ef14adee7b9e9914a4449.zip) (307.5 KB)  
**Temp\_aemet**.

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [November 15, 2018, 12:49pm UTC](https://forum.inductiveautomation.com/t/issue-with-gateway-timer-script/20860/7 "2018-11-15T12:49:20Z")

</div>

I have found the following in the log:

throwableInfot +Lorg/apache/log4j/spi/ThrowableInformation;xp gSet \>com.inductiveautomation.ignition.common.script.TimerScriptTaskpppt Error executing global timer script: OFICINAS\_ENGIE\_MADRID/Temp\_aemet @30,000ms . Repeat errors of this type will be logged as ‘debug’ messages.t binary-log-appendersr )org.apache.log4j.spi.ThrowableInformation¾þàrQ [ rept [Ljava/lang/String;xpur [Ljava.lang.String;­ÒVçé{G xp t "Traceback (most recent call last):t W File “\<TimerScript:OFICINAS\_ENGIE\_MADRID/Temp\_aemet @30,000ms \>”, line 3, in t ÆIOError: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targett t 3 at org.python.core.Py.fromIOException(Py.java:215)t + at org.python.core.Py.IOError(Py.java:178)t v at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.httpGet(AbstractNetUtilities.java:196)t @ at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)t Y at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)t 4 at java.lang.reflect.Method.invoke(Method.java:483)t N at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:186)t { at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. **call** (ScriptManager.java:428)t 8 at org.python.core.PyObject. **call** (PyObject.java:387)t 8 at org.python.core.PyObject. **call** (PyObject.java:391)t \_ at org.python.pycode.\_pyx170.f$0(\<TimerScript:OFICINAS\_ENGIE\_MADRID/Temp\_aemet @30,000ms \>:25)t f at org.python.pycode.\_pyx170.call\_function(\<TimerScript:OFICINAS\_ENGIE\_MADRID/Temp\_aemet @30,000ms \>)t : at org.python.core.PyTableCode.call(PyTableCode.java:165)t / at org.python.core.PyCode.call(PyCode.java:18)t , at org.python.core.Py.runCode(Py.java:1275)t `at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:624)t` at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:583)t \_ at com.inductiveautomation.ignition.common.script.TimerScriptTask.run(TimerScriptTask.java:99)t 2 at java.util.TimerThread.mainLoop(Timer.java:555)t - at java.util.TimerThread.run(Timer.java:505)w œ@px “ 3¼d ¬í sr !org.apache.log4j.spi.LoggingEventóò¹#tµ?
