this is the code i wrote in file name sudo nano device_status.py then I save and exit the file and type
sudo python3 device status.py to run the code the it says invalid syntax
@alamhbk420 why you haven’t seperated the API key and the device id by a comma. If you have stored the api_key and device id in device_id variable then use the variable name in the Bolt function.
mybolt = Bolt(api_key, device_id)
If then also the error is coming then post the screenshot also
i did it on purpose to hide my api key, bolt id
Can you share the error’s message!
It says invalid syntax
@alamhbk420 the correct syntax is:
from boltiot import Bolt
api_key = “f55—”
device_id = “BOLTXXXXXXX”
mybolt = Bolt(api_key, device_id)
response = mybolt.isOnline()
print (response)
Make sure that the Api key is 32 characters long and must be correct
Please create a new Topic and clear doubts there. This thread is Putty related.