I still need your help. As suggested, another var was added. Part of the code for X axis was outcommented...then stateis_1 was created and modification on response was done...I can run the code without error, but no chart on client side.
Obviously I am doing somethin wrong...
Code:
<script> var input = %s; var labels = %s; // build the labels on the fly. Could be provided // from the application here as code uses RTC //const labels = []; //for(var i = 0; i < input.length; i ++ ){ // labels.push(i); } const data = { labels: labels,
Code:
async def serve_client(reader, writer): global OUT_Buffer_temperature, OUT_Buffer_hours #print("Client connected") request_line = await reader.readline() #print("Request:", request_line) # We are not interested in HTTP request headers, skip them while await reader.readline() != b"\r\n": pass # find() valid garage-door commands within the request request = str(request_line) cmd_up = request.find('DOOR=UP') cmd_down = request.find('DOOR=DOWN') cmd_stop = request.find('DOOR=STOP') stateis = "" # Keeps track of the last command issued stateis_1 = "" # Carry out a command if it is found (found at index: 8) if cmd_stop == 8: #stateis = ": STOP" #b = ReadTemperature() #stateis = (": Temp.garaza = " + str(b) + " *C") #": STOP" stateis = str(OUT_Buffer_temperature) stateis_1 = str(OUT_Buffer_hours) #print(stateis) #print(stateis_1) control_door('stop') elif cmd_up == 8: stateis = ": ODPRI" #print(stateis) control_door('up') elif cmd_down == 8: stateis = ": ZAPRI" #print(stateis) control_door('down') response = html % (stateis, stateis_1) writer.write('HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n') writer.write(response) print(response) await writer.drain() await writer.wait_closed()
Obviously I am doing somethin wrong...
Statistics: Posted by California — Sat Jan 20, 2024 3:19 pm