Bolt Cloud Doubt

Can someone please elaborately tell me about the Bolt Cloud and how we can use it in our projects in our Python Editor?
I want to know the process that goes on with the bolt module and bolt cloud when we do the connections and run our code.

Your question is (Can someone please elaborately tell me about the Bolt Cloud and how we can use it in our projects in our Python Editor?
I want to know the process that goes on with the bolt module and bolt cloud when we do the connections and run our code.)

I will try to give you as much clarity as possible

Hardware: .
1)For suppose you are doing light monitoring project .
2)Now we will connect two pins of the LDR to A0 and the GROUND respectively
This is hardware part . Hardware connections vary from project to project.
3)Now we have our bolt module setup with hardware .

Cloud

  1. Normally we have our software and infrastructure with us .So any data we store on our hard drive and use our cpu computational power.
    2)While cloud we don’t need to use our own storage .We will have our cloud storage hence we can upload data to the cloud over internet and store it there.
    3)An another thing we will have huge computational power on cloud .We no longer rely on our computers computational power.
    4)Now you understood what is cloud and why we are using it .
    5)Now When we create a product on bolt cloud and write necessary code and deploy in our bolt device .The bolt device starts uploading data to our cloud which we can visualize.

Python.

  1. Now as we have used another cloud in our project : Digital Ocean

The steps that happen are as follows
a)Firstly we need the device id and the api key of our bolt device
b)We can find it in our bolt cloud under product and api section respectively.
c)Here device id is used to uniquely identify the bolt device while api something like a key to unlock it .
d)We keep this combination in a seperate file called configuration file .
e)When we write our actual code and deploy it , the cloud will try to identify the device and get access to the device (like key-api key) and deploy the code that we have written for it
Hope this is clear :slightly_smiling_face:

1 Like

Wow. You explained it so simply and cleared a lot of my doubts. Yet I am left with some. Please bear with me.

  1. “Now When we create a product on bolt cloud and write necessary code and deploy in our bolt device .The bolt device starts uploading data to our cloud which we can visualize.”
    How does this happen? Through an API request? Please elaborate this process. How this happens? What is bolt cloud api and api request in case of bolt? And how the data is sent to bolt cloud? Please explain this

  2. I am using Vscode. Not digital ocean or anything.
    I am installing and using Bolt Library. Can you tell me what role this bolt library plays in this whole thing?

  3. What does Bolt(api key, device id) do? Is this the line that sends the api request to the bolt cloud?

  4. Also, what is the bolt cloud api physically?

Thanks a lot. I’m sorry if these are too much but I really need to know the whole working behind the project(Temperature Monitoring Project) as I intend on mentioning in my CV.

1 Like

I to have the same doubt that you have asked (1st one).I would explain the rest.
This bolt libraries are not much different from other libraries they too have related codes to be excuted but they would be able to access your bolt module in particular and collect data from it ,which answers your third question as well. Comming to your 4th question you can imagine it as a instructions or way of communicating with your cloud (sending and receiving data basically).

I hope this helps.

Hey thanks.
I got that.
Can you tell me if the Bolt library is the one that sends the api request to collect data to and from the Bolt cloud?
And where is the api(set of instructions) located or present ?

The full form of API is Application ProgramMing Interface. It is a type of software interface, offering a service to other pieces of software. It’s like a general or like a protocol that has those instructions that send and receive at both ends.

I understood that but I want to know where those instructions are present or defined? In the bolt cloud library?
And is importing bolt library the one that sends the api request to the cloud?

See when you purchase Bolt module a key is provided for you to access Bolt API to request bolt cloud
this key is called API key. whenever we talk about Api just imagine it as a waiter who takes your order and and lets your order know the chef ,the chef gives response and waiter delivers you the response in the same way APIs work they provide you the service you need by requesting the service provider.

Now lets talk about what role does API do in this scenario .when we code a python script we assign API key to some variable API_KEY and also device id also assigned to some variable DEVICE_ID use it in some imported Bolt library function. following is line which is responsible to access bolt API

mybolt = Bolt(API_KEY,DEVICE_ID)

after this you can use it some services like digitalRead,digitalWrite.etc
lets say you want to turn on LED connected to GPIO pin 0 .then we can simply access digital Write function by following line

mybolt.digitalWrite(‘0’,‘HIGH’)

by the above command you will send API request to Bolt Cloud to make GPIO pin 0 HIGH ,and response is sent back by BOLT cloud you can store response by writing a simple line of code

response = mybolt.digitalWrite(‘0’,‘HIGH’)

and to print response by print(response)

so overal below will be your code to turnon your led

from boltiot import Bolt
api_key = “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”
device_id = “BOLTXXXXX”
mybolt = Bolt(api_key, device_id)
response = mybolt.digitalWrite(‘0’, ‘HIGH’)
print (response)

i hope this will be clear if not just lemme knoe

@akshayan.sinha correct me if im wrong somewehere.

3 Likes

@kondruabhay Well explained. But the question still remains, how does writing digitalWrite and Bolt(api, device) on python control your module.

Give an example of API URLs and breakdown the URL.

@harrisonshruti If you still have a doubt after that, let me know I’ll answer

1 Like

yeah i thought it will be difficult for him to understand all at once if he wants ill give an example of API URLs, @harrisonshruti if you want to know more in detail refer this doc


still you dont get it just lemme kniow
1 Like

@harrisonshruti
1)API stands for Application Programming Interface .
Suppose let us take the example of a hotel .
You go and order something and they deliver .
Here in our case we are giving our cloud the details of our device that is device id and also as the name suggests api key like a key to get access to device .Using these values it uniquley identifies your device and fetch data.

2)Generally a library will have predefined methods/functions which we can use in our code by importing it to our code .
Here in our project we have analogRead() function for which we have not written any code rather we are imported boltiot library and created an Object of that and calling that method to get out data from bolt device.
3)Yes you are correct we use api key and device id to send request.
Here suppose if our bolt device is a lock the api is its key to get access to the device to collect data

1 Like