Connection error for setting Bolt library

The program is executed correctly but I am not getting the required output. It shows a connection error instead of showing whether my devices Online or Offline. Kindly help Me…

You need to import the Bolt Class from the boltiot python module. It can be done by typing this line before the api_key line in the script:
from boltiot import Bolt
If you haven’t installed the Bolt python library(If you haven’t installed it, you can’t import from boltiot python module),you can do so by typing these commands into the command line(in this order):
sudo apt-get update
sudo apt install python3-pip
sudo pip3 install boltiot
And I don’t think there is a need for keeping the device_id in brackets. Just keeping them in between the double quotes is enough

You might need to import Bolt class.

You have referenced Bolt class at line 3 but python has no in-built Bolt class. For that, you might need to install boltiot module in your python compiler first and then import the boltiot library which includes the Bolt class.

This shall solve your issue :slight_smile:

After doing with that 1st command. I got like this…I then tried with “sudo apt-get update” also but am getting index files failed to installed. Other command —fix-missing is also giving the same. What can I do now

Try typing like this first:
sudo apt-get update -y
If you still haven’t solved the problem yet,you might be need to install the ubuntu-extras-keyring by typing the command as follows:
sudo apt-get install -y ubuntu-extras-keyring
And proceed with the steps I have described above.
I hope this helps

I have done as you told. But it shows unable to locate package ubuntu-extras-keyring…Kindly Help me…pls

Check these out:

I hope this helps

1 Like

Thank you very much it’s solved I got the device’s status successfully