Open rokitski opened 3 years ago
Thanks for pointing that out.
It looks like my uploaded hadn't been sync'd when I made a change to naming.
I have corrected that. In this version the function is called handleSendPulses
I am away at the moment will pick up again in a few days.Sent from my Samsung Galaxy smartphone. -------- Original message --------From: rokitski @.> Date: 18/09/2021 19:29 (GMT+00:00) To: roberttidey/espI2sClockGen @.> Cc: Subscribed @.***> Subject: [roberttidey/espI2sClockGen] Pulse pattern from a file is not set (#2) It looks like a function in index.htm is expecting a call on /sendpulses, while in the ino file function extraHandlers the name of expected call is "/setpulses": In INO file: // add any extra webServer handlers here void extraHandlers() { server.on("/setclock", handleSetClock); server.on("/setpulses", handleSetPulses); server.on("/getpulsefiles", handleGetPulseFiles); } and in index.htm: function sendPulseFile(filename) { if(filename.length) { $.get("http://" + host + "/sendpulses", {'filename':filename}); } } Original code doesn't set the pulse pattern. After changing the call in INO file to "server.on("/sendpulses", handleSetPulses);" resolves the issue and pulse pattern from a file is set correctly.
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/roberttidey/espI2sClockGen/issues/2", "url": "https://github.com/roberttidey/espI2sClockGen/issues/2", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
It looks like a function in index.htm is expecting a call on /sendpulses, while in the ino file function extraHandlers the name of expected call is "/setpulses":
In INO file: // add any extra webServer handlers here void extraHandlers() { server.on("/setclock", handleSetClock); server.on("/setpulses", handleSetPulses); server.on("/getpulsefiles", handleGetPulseFiles); }
and in index.htm: function sendPulseFile(filename) { if(filename.length) { $.get("http://" + host + "/sendpulses", {'filename':filename}); } }
Original code doesn't set the pulse pattern. After changing the call in INO file to "server.on("/sendpulses", handleSetPulses);" resolves the issue and pulse pattern from a file is set correctly.