How to send data from bolt cloud to server. I have sent the MQ7 data from arduino UNO to BOLT cloud and now I want that same data on the Server

Can you tell the cause of these error:

“Invalid literal for int() with base 10”

That is not the issue. Its a null value. Nothing is in the serialRead. That’s it.

I am trying to figure out why the data is not visible on the monitor, but it is available on the cloud.

Its available on cloud because I’ve written “boltiot.processPushDataCommand(ppm)”

Also I noticed that, I am getting the Data on monitor(PuTTY) when I am NOT using the “boltiot.processPushDataCommand(ppm)”

Is it so that “we cannot use the setStringCommand and processPushDataCommand together in one Code” ?

You had both of them in the program? They mentioned in the document about it. processpushDataCommand and handle command does the same job, but different methods.

I thought you were following this the whole time.

Anyways, is your serialRead returning the values?

Yeah, sorry for that.
Yes, it is returning values in the monitor, but now it is not showing the Graph, I think I’ve created a mess.

You’re sending data to both cloud and your python. I told you in the beginning, both of them do the same job, i.e. run API requests and take values. Those values can be altered by us for viewing or doing anything.

Cloud surely is compatible with processpushdataCommand, while other API requests in JSON format can be helped with handleCommand.

Its okay where you are right now, Python has many capabilities, one of them is making graphs. You can use your data to be stored in a temporary folder and use that data to build the graph as your python is running.

1 Like

with setStringCommand, can I send a value Stored in variable ppm, into the python code ?

It will go by the means of serial communication. You send whatever you wish. VALUE, STRING, DATA, It has to be in the form of numbers and strings only. Your python code has to be good enough to understand what the data sent by the arduino really means.

Again facing some issue, it showed sensor data 2 times, then it again returns error

Yes, I was following this, but I did not knew that I need to remove the pushDatacommand, which I wrote earlier…

It’s fine. Your data was read once right. After that, maybe your arduino did not send any data.

On your serial monitor, it has to be like -

66
66

And after that, no data was put on the serial communication. I hope you understood this part.

Now, add an if statement, to print(“No input”), when

if (not sensor_value):

OR

if (len(sensor_value) == 0):

You can do any other function or keep sensing with continue, instead of printing

Hey, it has started displaying the values…but it is also printing the error message along…

look, something very Strange happened: Why??

Yeah, that’s because your sensor value is integer, but it is also reading ‘\n’ and sometimes null with it.

1 Like

You are using Free plan of bolt right? That’s why. Get the BoltCloud Pro plan when possible.
For more info - https://docs.boltiot.com/docs/api-access-rules

1 Like

Right now, i can ask you to either use string, which will restrict you from using the threshold feature, or remove the try - catch block which wont show you future errors.

Thanks brother, it has been resolved, turns out int() does not accept strings which are in float form, using float() worked

What about ‘\n’ that isn’t disturbing the flow, right?