Python API for Bolt IOT


#1

I have a Bolt IOT module up and running, standalone with sensors connected as well as interfaced to an Arduino board with UART interface.
I have problems with making the Python API interface. If the Bolt IOT already has a product associated and uploaded to it, will the Python API functions work?
I am calling the Python APIs from a Windows laptop with Ananconda loaded. The Bolt IOT Python package has been successfully loaded since the import of the package does not throw up any errors


#2

@radhanand.anantha Can you please describe what problem you are facing? Any screenshots of the error and code would be great!


#3

from boltiot import Bolt
api_key=“XXXXXXXXXXXXXXXXXXXXXX”
device_id=“BOLTXXXX”
mybolt=Bolt(api_key,device_id)
mybolt.serialBegin(‘9600’)
mybolt.serialWrite(‘RD/r’)
response=mybolt.serialRead()

Error:
TypeError: serialRead() missing 1 required positional argument: ‘char_till’

The api_key and device_id are ok since I am getting responses for version() and isOnline() functions


#4

I have the Arduino code working with the Bolt library and I am sending three parameter values using the processPushDataCommand. I am able to draw line graphs of the three values in the Bolt IDE, so the values are being transmitted from the Arduino board. My requirement is to get the parameter values in Python so that I can run some ML algorithms


#5

This code does not throw up an error but no data is returned. It shows success and blank data


#6

Problem sorted out. Used the DHT22 example and did a SetCommandString and set my own command string. Able to get data in Python. Same thing should have worked with ProcessPushCommand in Arduino and calling with RD\r command in Python, but I guess some issues with CR+LF