Led control code page not working

I have saved the code, still its showing “Error, no code is written for the device”.
What should I do, pls help asap.

@gs5709

Can you send screenshot of the code configuration as well as the product in the homepage? Wherethe name of the product is mentioned beside the Bolt ID?

1 Like

Here are the screenshots.

Make a correction, I believe that might be changing your device name. And blocking access from viewing your device.

Correction -

        <script type = "text/javascript">
            setKey('{{ApiKey}}','{{Name}}');
        </script>

Replace your setKey function with EXACTLY this.

Other wise your configuration is saved. No issues in that. You can make your device public and send the public link over here. I’ll see from my side if the code was hosted on the website.

1 Like

https://cloud.boltiot.com/control?name=BOLT14918245 this is the device link pls check
its still showing error

@gs5709

You’re claiming, you’ve saved your code, right? I’ll inform regarding this to check on our side.

Meanwhile, you can export your product and share the URL here, I’ll check if it works on other account/device ID.

1 Like

Here is the product link . Pls check. Yes, i have saved the code and also sent a mail to the support team regarding this issue.

@gs5709

Yes, found an error in your code.

Correction - Paste this whole script tag.

        <script type="text/javascript">
            setKey('{{ApiKey}}','{{Name}}');
        </script>

Your ‘=’ was replaced with ‘>’. Could be your typing mistake.

1 Like

still showing error after correcting the code. what should i do

@gs5709

Are you sure? Can you send a screenshot or the code directly?

1 Like
Controlling Led ON OFF )

this is the code for that I have written

The error page is saying no code is written for the product. But I have saved and written the code.

@gs5709

Send the code with latest edit you have made.

1 Like

I have mentioned already, paste the exact whole script. Your setkey function takes argument of api key and device ID, writing ‘ApiKey’ and ‘Name’ directly sets the default APIkey and Device ID of your account.


Paste the below script, I have made the required changes.

<!DOCTYPE html>
<html>
<head>
<title>
Controlling Led
</title>
<script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>

<script type="text/javascript">
            setKey('{{ApiKey}}','{{Name}}');
        </script>

</head>
<body>
    <center>
    <button onclick="digitalWrite(0, 'HIGH');">ON</button>
    <button onclick="digitalWrite(0, 'LOW');">OFF</button>
    </center>
</body>
</html>
1 Like

Ok sir. Thank you so much now the page is working. And i have also got the knowledge why its been not working due to mentioning of the api key and name.

1 Like

@gs5709

Right, I have mentioned this in the very beginning as well.

1 Like