Send data from FiPy to server
I am trying to send sensor data from FiPy to server. (Ex. i am using my local computer as server with MySQL as DB). Am running below code in atom but getting ImportError No module named MySQLdb.
#Setting up connection
db = MySQLdb.connect(host=" ", # your host
user=" ", # username
passwd=" ", # password
db=" ") # fill with dredentials
cursor = db.cursor()
sql = "INSERT INTO EMPLOYEE(FIRST_NAME,
LAST_NAME, AGE, SEX, INCOME)
VALUES ('%s', '%s', '%d', '%c', '%d' )"
db.commit() #// SAVE PERMANENTLY
db.rollback() #// IF U GOT ERROR ROLL BACK ALL UR CHANGES
Please help me with this. How to send data from FiPy to server, if anyone can share code for the same it would be great help.
Waiting for you valuable responses , kindly reply as soon as possible.
Thank you very much for your quick response, as am new to server and pycom, it would be great help if you could share the code from fipy side and server side with step by step procedure.
livius last edited by
You cannot use mysql directly - create some service on your computer and connect your Fipy to it