As far as I can see, the web server is working. However, when I click on a button on the web page, no data is being sent via the “mySwitch” code. I verified this both by the fact that the wireIess switch did not work, and the fact that I could not see any results via the “ReceiveDemo_Advanced” example script.
I do know that the “server.on” portion of the code is working because I inserted a debug line as seen below:
server.send(200, “text/html”, webPage);
I have tried all possible values for the mySwitch.enableTransmit (x); statement.
Are you sure your module is wired properly?
If the demo code is not working it can be one of the following scenarios: the module is not wired properly or it might be broken?
Were you able to use the module with other projects before?
OK, making progress. I am getting output. The issue now is that the ESP8266 delivers a slightly different output than does the switch itself. Both have the same Tri-State value, but the PulseLength and raw data portions are different. The web generated output will not turn the switch on or off. Here is what I am seeing on the Serial Monitor:
From web page:
Decimal: 1332531 (24Bit) Binary: 000101000101010100110011 Tri-State: 0FF0FFFF0101 PulseLength: 350 microseconds Protocol: 1
Raw data: 10876,320,1084,320,1084,320,1080,1020,388,316,1084,1016,388,316,1084,316,1088,316,1088,1016,384,320,1084,1016,384,320,1084,1016,388,316,1084,1016,388,316,1084,320,1084,1016,388,1012,388,316,1088,312,1088,1020,384,1012,392,
Decimal: 1332531 (24Bit) Binary: 000101000101010100110011 Tri-State: 0FF0FFFF0101 PulseLength: 185 microseconds Protocol: 1
Raw data: 5768,140,608,128,612,132,580,524,216,152,596,516,228,144,600,140,592,148,584,528,224,144,588,524,224,144,588,528,212,164,572,36,3420,28,2656,88,2540,48,600,32,24,64,48,28,148,232,76,300,64,
Can any of this besides the Tri-State value be changed by the Arduino code?
I don’t know why you are getting that issue.
But, there is an optional line of code that you can add to set the pulse length.
In this case, you want the pulse length to be 185. You can add it after the mySwitch.enableTransmit (x); statement.
Let me know if this solves your issue.