pyserial to ajax php jquery javascript -
this high level question. have hardware generating serial data every 3 seconds. use pyserial script read port , write data text file.
ser = serial.serial( port='com3', baudrate=2400, parity=serial.parity_none, stopbits=serial.stopbits_one, bytesize=serial.sevenbits ) array = []; while true: message = ser.read(); fo = open("../wamp/www/amt/test5.txt", "w") fo.write(message); array = []; fo.close()
this isn't whole script, represents i'm doing. web application uses ajax $.get call retrieve data text file. can make data dance me. (data likes dance)
$.get('test5.txt', function (data) { var = data.substring(data.indexof('a')+1,data.indexof('a')+4); var v = data.substring(data.indexof('v')+1,data.indexof('v')+4); }
the problem anywhere between 5 hours , 2 days systems stops working. no feedback. things fixes changing name of text file.
i assume hitting limit on read , write of text file. theory hitting max on memory usage , software fails. think? how fix more permanently?
Comments
Post a Comment