GPIO turns off automatically after some seconds

Hi Team,
I have a very simple project going on. Controlling 2 GPIO’s on/off;
I tried 2 different programs and the observation is same in both.
when i command a gpio to go high ; it goes high on button click and after uncertain time(seconds) it turns off.
I am attaching my both the programs.

1.: in html

<!DOCTYPE html>
<html>
<head>
	<title>LED_Switch</title>
</head>
<body bgcolor = "#446173" text ="#ffffff">
	
        <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
        <script>
        setKey('{{ApiKey}}','{{Name}}');
        </script>
        <div style="position:absolute ; top:10px; width: 200px; height: 20px; "><a href="https://robobuddies.blogspot.com/#!/" target="_blank"> 
		<button onclick = "start_timer()">Visit my blog</button></a></div> 
        
       
        <div><button style="position:absolute ; ;top:70px; left:10px;width: 100px; height: 50px;background-color:#202630;" onclick="run(1);">
        <font color="green" size="5">ON_1</font></button></div>
		
        <div><button style="position:absolute ; top:70px; left:110px;width: 100px; height: 50px; background-color:#202630;" onclick="stop(1);">
        <font color="red" size="5">OFF_1</font></button></div>
		 
		<div><button style="position:absolute ; ;top:200px; left:10px;width: 100px; height: 50px;background-color:#202630;" onclick="run(2);">
        <font color="green" size="5">ON_2</font></button></div>
        
        <div><button style="position:absolute ; top:200px; left:110px;width: 100px; height: 50px; background-color:#202630;" onclick="stop(2);">
         <font color="red" size="5">OFF_2</font></button></div>
      
	  
	    <div style="position :absolute ; top:70px; left:250px; width: 100px; height: 50px;background-color:#202630;">
        <font color="green" size="10"; id="status1"></font>
	    </div>
		
		<div style="position :absolute ; top:200px; left:250px; width: 100px; height: 50px;background-color:#202630;">
        <font color="green" size="10"; id="status2"></font>
	    </div>
				
		
<script>
var status1;
var status2;
function run(channel)
	{
	if(channel == 1)
	{
	digitalWrite(1, 'HIGH');
	status1 = "ON";
	document.getElementById("status1").innerHTML = status1;
	}
	if(channel == 2)
	{
	digitalWrite(2, 'HIGH');
	status2 = "ON";
	document.getElementById("status2").innerHTML = status2;
	}
	
	}
function stop(channel)
	{
	if(channel == 1)
	{
	digitalWrite(1, 'LOW');
	status1 = "OFF";
	document.getElementById("status1").innerHTML = status1;
	}
	if(channel == 2)
	{
	digitalWrite(2, 'LOW');
	status2 = "OFF";
	document.getElementById("status2").innerHTML = status2;
	}
	}
</script>

</body>
</html>

2: in js
singleButton({name:“Led On”, action:“digitalWrite”,
pin:“2”, value:“HIGH”})

Please help.

Thanks,
Jesal Patel

@jesalpatel.1911 Can you please try to remove the start_timer() function in your code and check if the issue persists?

@shoeb.ahmed Yes , I’ve tried removing the function ; but it still persisted.
The observation i found is with the data collection rate set in the IOT hardware.
If i configure it to 30seconds; the gpio turns low by the near by time of 30 seconds; I tried configuring the data collection rate with 1min; 5min and observed the same.
Due to data collection the Bolt iot module resets its GPIO’s .
I guess its a firmware issue.
Hope to get a response soon.
Thanks