Project 6 , python code

Hi,
Sir/Madam

Present i am using ubuntu software in my computer.When i am execute the project 6 code in terminal the output is not clear.The code is correct but output is not clear.

please give the solution.

Hey @viswam2018rkv !
Did you replace the ‘X’ present in your code with your original API Key and Device ID?
You can find that on your Bolt Cloud platform under API and Devices section, respectively.
Also check if your Bolt Module is active or not while running the code.
Hope this helps!

For understanding purpose i replace the original api key with x.

Do one thing, on your terminal. Type ping google.com > Press Ctrl+C after some time > Take a screenshot and send over here.

Your network is working fine. Run the below command to update the dependencies,

sudo apt-get update //first this
sudo apt install python3-pip //then this
sudo pip3 install boltiot //then this

One by one.

I am already run the given commands sir.what next sir.

@viswam2018rkv

Now run your python script. Let me know if you still face the same issue.

There is no difference sir.
Same problem.

@viswam2018rkv

I am inviting @rahul.singh1 to look into your query.

Please solve this problem ASAP.

Hi @viswam2018rkv,

open the python terminal by typing the below command.

python3

Then import the requests in the python terminal and send the get request. (Change the api_key and device_id with your details)

import requests
response = requests.get('https://cloud.boltiot.com/remote/api_key/isOnline?&deviceName=device_id')
print (response.text)

Check if the above command is working. Also, share the screenshot of the output.

It is working sir thank you,but the next project code how to execute in terminal sir. There is any further code to run the project code sir ?

Hi @viswam2018rkv,

You can write the above code in a python file and will be able to run using python3. boltiot library internally uses the request library to send the request and it is just a wrapper on top of the requests library. You can check the code of boltiot library here https://github.com/Inventrom/bolt-api-python/tree/master/boltiot

To exist from python3 terminal type exit() command.

Now run your code again using the boltiot library and check if is working.

Also, type the below command and send me the screenshot of the output.

ls

Thank you sir.
It is working,but coming to next project which code can i write in python file sir.

@rahul.singh1

Sir,
project 7 having same error when i am executing python file in terminal .

You can try reinstalling the boltiot module.

Run pip install --force-reinstall --no-cache-dir boltiot, and let me know once it installs the package.

@viswam2018rkv

Now can you try running your project code? And check if it throws the same error?