mirko / SonOTA

Flashing Itead Sonoff devices with custom firmware via original OTA mechanism
GNU General Public License v2.0
718 stars 105 forks source link

ESP8285 based relay board doesn't like certificate #164

Open therealbat opened 5 years ago

therealbat commented 5 years ago

link to the device: https://www.diymore.cc/products/diymore-dc12v-esp8285-self-lock-smart-home-wifi-wireless-switch-delay-relay-module-by-app-control-ios-android

process get stuck at stage2, the device is periodically trying to contact tornado (tried both 8443 and legacy) but the connection is FIN,ACK-ed after a few packets. did a packet capture, and it seems the stuff goes off right after server hello. with legacy the device returns to its original working state after two tries, with port 8443 it tries to update forever.

therealbat commented 5 years ago

(pressed enter accidentally :-)

no actual HTTP communication takes place int stage 2. see debug log.

debug_1549220899.log

sonoff443.pcap.gz sonota8443.pcap.gz

therealbat commented 5 years ago
image

just to make it clear: the device is at 192.168.255.11 and SonOTA runs at 192.168.255.20

therealbat commented 5 years ago

using charles i was able to capture the communication between the EWelink app and the OTA server:

{
    "rtnCode": 0,
    "upgradeInfoList": [{
        "bizRtnCode": 10001,
        "deviceid": "1000xxxxxx",
        "model": "PSF-B01-GL",
        "version": "2.6.1",
        "upgradeText": "2018-12-27 \n•\tFeature:Factory模式版本升级至v1.1.2;\n•\tFeature:IOT框架升级至v1.5.1(支持OTA断点续传);\n•\tBugfix:修复离线超时软重启后,循环定时器失效的bug;\n",
        "binList": [{
            "downloadUrl": "http://52.28.103.75:8088/ota/rom/2us5mWvdMhDRplBEve9goefwK6mcrOxy/user1.1024.new.2.bin",
            "digest": "934aeb49af6b3baac36d1a4ffed5c7ec50672d803396cae8b209907411702e82",
            "name": "user1.bin"
        }, {
            "downloadUrl": "http://52.28.103.75:8088/ota/rom/2us5mWvdMhDRplBEve9goefwK6mcrOxy/user2.1024.new.2.bin",
            "digest": "2e8ada924278dc44b8cc802f4ba9d3bb1a91f3625eadfd95b57dbd7f4ae89e45",
            "name": "user2.bin"
        }],
        "type": 0,
        "forceTime": 0
    }]
}
bibiak1 commented 5 years ago

Hi,

I have same issue. Tried on Mac, on Windows (sonota.exe shutdown unexpectedly), on docker. Is it possible that it's related to cypher type on https communication? Most openssl versions I saw doesn't support SSL2/SSL3 encryption.

NdK73 commented 4 years ago

From SonOff fw 1.6 SonOTA does not work anymore. Started a Twitter campaign to give a signal to Itead. https://twitter.com/NdK_BO/status/1150142117282549760 Retweet at will :)