I am working with google voice to turn on and off the lights the only problem is with my code as google says here is my code mentioned

https://cloud.boltiot.com/remote/2338fc42-74d3-4dad-89ee-48ff7214eee1/digitalRead?deviceName=BOLT8022923&pin=0

it say error in line 1 character 111.
kindly help me out @boltiot

As you are dealing with the GPIO commands, so while configuring with the 03rd party servers we need to have the command in form of an API request.

The general syntax for writing such API requests is:
https://cloud.boltiot.com/remote/API_KEY/Command_Name?pin&state&deviceName
Basically after the β€˜?’, the attributes are listed for that particular command. In your case, you have written the pin after the deviceName whereas the pin should be before the deviceName.

So, just place the pin before the deviceName and then it will not give any error.

Note: Don’t post your API_KEY and deviceName on the forum platfrom because then anyone can use the information (particularly the API_KEY) to make a product.
So generate a new API key for your products now so that you can be on a safer side. Do not forget to replace the new API key in all of the previous codes/products

Also as I am seeing that you are trying to glow the lights through the Voice command. For this case, you should use the digitalWrite or analogWrite function because the LED/light will fetch the value from any of the GPIO pins. Any read function will not be able to glow the lights.

I hope, this solves your problem.

1 Like

https://cloud.boltiot.com/remote/2338fc42-74d3-4dad-89ee-48ff7214eee1/digitalRead?&state=HIGH&pin=0&deviceName=BOLT8022923

do check this link and please help me out.@boltiot
my led is not glowing with my commands.

@shivamkumar2970 the correct API request is https://cloud.boltiot.com/remote/API_KEY/digitalRead?pin=0&deviceName=BOLTXXXXXX

You have used a β€˜&’ after the ? which is affecting the request. Remove the unnecessary β€˜&’ and then the request will be processed accordingly.

@vishalvats2000
already used as per you suggested still not working.

https://cloud.boltiot.com/remote/2338fc42-74d3-4dad-89ee-48ff7214eee1/digitalRead?&state=HIGH&pin=0&deviceName=BOLT8022923

You have used this API request in the above manner. That’s the wrong syntax. Why you have put an ampersand after ?
Remove that & after the ?. Also swap the pin and state.

Final API syntax will be like this:
https://cloud.boltiot.com/remote/2338fc42-74d3-4dad-89ee-48ff7214eee1/digitalRead?pin=0&state=HIGH&deviceName=BOLT8022923

2 Likes

@shivamkumar2970 Is the problem solved?