You should probably have a read of this and understand it. Also if you are going to use my code in the manner that you have you need to read the license information and comply with it. You are better off forking the repo and making your modifications. Thanks
Dude you need to supply a little more info. Which model of Sonoff. As for OTA there are a number of reasons it may not work. What have you tried, what is your environment, what is actually happening. That a very simplistic question for a complex answer I’m sorry
Sorry,mine is the normal version I try both your firmware sonoff 1.01p OTA, but once uploaded and connected the led light doesn’t off even the relay is off. And I try to upload by OTA say error while opening python I had install python already.
Manage to get the OTA works!(very nice!!) but how can the led light work as your 1st version when relay is on led light on when off led also off? After update OTA led light up even relay is off
I’m running into a problem with this. I have the basic Sonoff with your firmware installed. When it’s still powered by the FTDI adapter, it connects to my wifi and mqtt just fine, and I can control it from Home Assistant perfectly. However, as soon as I power it from mains AC, it connects to wifi but not my mosquitto broker. If I try pinging it i get a lot pockets dropped and much higher than normal ping times. The button does work to control the relay on AC power.
There is no difference. I even re downloaded a Sonoff I have here with the exact code from Github and it works normally. Sorry not sure what your problem is.
Are you sure you are holding the button down on the Sonoff before you plug in your FTDI? You can release after power is applied.
Is the switch physically located in he same spot on both occasions?
Yes, I’ve determined this is not a problem with your firmware, it seems to be a bad batch of Sonoffs. I’ve tried several other firmwares with the same result. They function perfectly on FTDI power and then function like shit on AC power. Seems like the power supply on mine are bad. Pinging to FTDI power is zero packet loss and about 2 ms. Pinging on AC power is 40-80% packet loss and 60-120 ms. Also constant reboots. Lame.
Can you take a photo of both sides of the main board and post it up here. I wanna compare any obvious component changes to working boards. Seems the power supply isn’t filtering AC properly. It will be a bad capacitor somewhere I recon unless they’ve made changes to the board that is. That’s no good. If we spot something I can let ITEAD know as well. Sorry to hear dude.