Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the postBinUrl #9

Open
XiotSamuel opened this issue Feb 10, 2022 · 0 comments
Open

Question about the postBinUrl #9

XiotSamuel opened this issue Feb 10, 2022 · 0 comments

Comments

@XiotSamuel
Copy link

Hi all,

I am using the Mesh App for updating the ESP32 whit OTA, but I found that the device fail to update every time when the username and password is enter to the url.

The postBinUrl seem having error message. The eLog captured as below


2022-02-10 12:29:23.859 21131-21131/h5.espressif.esp32 I/ViewRootImpl@580c9ac[EspWebActivity]: ViewPostIme pointer 0
2022-02-10 12:29:23.942 21131-21131/h5.espressif.esp32 I/ViewRootImpl@580c9ac[EspWebActivity]: ViewPostIme pointer 1
2022-02-10 12:29:23.957 21131-21131/h5.espressif.esp32 D/InputMethodManager: HSIFW - flag : 0
2022-02-10 12:29:23.976 21131-21131/h5.espressif.esp32 D/InputMethodManager: HSIFW - flag : 0
2022-02-10 12:29:24.054 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(368)] "{"bin":"http://test:[email protected]:8000/ESP32Firmware.bin","macs":["7c9ebdf07db4"],"type":3}", source: file:///android_asset/web/app/js/otaInfo.js (368)
2022-02-10 12:29:24.056 21131-25353/h5.espressif.esp32 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2022-02-10 12:29:24.056 21131-25353/h5.espressif.esp32 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2022-02-10 12:29:24.281 21131-25353/h5.espressif.esp32 D/[EspOTAClientImpl2]: OTA url response code = 500
2022-02-10 12:29:24.282 21131-25353/h5.espressif.esp32 D/[EspOTAClientImpl2]: OTA url response content = {"status_code":-1,"status_msg":"Initialize the upgrade status"}
2022-02-10 12:29:24.282 21131-25353/h5.espressif.esp32 W/[EspOTAClientImpl2]: PostBinUrl failed
2022-02-10 12:29:24.282 21131-25353/h5.espressif.esp32 D/[EspOTAClientImpl2]: close()
2022-02-10 12:29:24.282 21131-25353/h5.espressif.esp32 D/[EspOTAClientImpl2]: OTA thread over
2022-02-10 12:29:24.282 21131-24970/h5.espressif.esp32 I/[AppApiForJSImpl]: onOTAResult: 10.0.1.145 : []
2022-02-10 12:29:24.282 21131-24970/h5.espressif.esp32 D/[EspOTAClientImpl2]: close()
2022-02-10 12:29:24.285 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(435)] "[]", source: file:///android_asset/web/app/js/otaInfo.js (435)
2022-02-10 12:29:25.009 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(390)] "0", source: file:///android_asset/web/app/js/otaInfo.js (390)
2022-02-10 12:29:27.007 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(390)] "0", source: file:///android_asset/web/app/js/otaInfo.js (390)
2022-02-10 12:29:29.007 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(390)] "0", source: file:///android_asset/web/app/js/otaInfo.js (390)
2022-02-10 12:29:31.008 21131-21131/h5.espressif.esp32 I/chromium: [INFO:CONSOLE(390)] "0", source: 

I found that the error message come form the runOTA() function in EspOTAClientlmpl2.java

    private void runOta() {
        mOtaRunning = true;

        mOtaThread = new Thread(() -> {
            if (getOTACallback() != null) {
                runOtaCallback(() -> getOTACallback().onOTAPrepare(EspOTAClientImpl2.this));
            }

            EventBus.getDefault().register(EspOTAClientImpl2.this);

            for (int t = 0; t < 1; t++) {
                if (mBin != null) {
                    if (!postBinData()) {
                        mLog.w("PostBinData failed");
                        continue;
                    }
                } else if (mBinUrl != null) {
                    if (!postBinUrl()) {
                        mLog.w("PostBinUrl failed");
                        continue;
                    }
                } else {
                    mLog.e("Bin and bin url are both null");
                    break;
                }


                if (!checkProgress()) {
                    mLog.w("checkProgress failed");
                    continue;
                }

                if (willRebootAfterOTA()) {
                    otaReboot();
                }
                mLog.d("Check over");
            }

            EventBus.getDefault().unregister(EspOTAClientImpl2.this);
            close();

            if (getOTACallback() != null) {
                runOtaCallback(() -> {
                    List<String> sucMacList = new LinkedList<>();
                    for (Map.Entry<String, Integer> entry : mProgressValues.entrySet()) {
                        if (entry.getValue() == 100) {
                            sucMacList.add(entry.getKey());
                        }
                    }
                    getOTACallback().onOTAResult(EspOTAClientImpl2.this, sucMacList);
                });
            }

            mOtaRunning = false;
            mLog.d("OTA thread over");
        });
        mOtaThread.start();
    }

The target device also don't have any respond

I (5531680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -53, node num: 4, free heap: 133504
I (5541680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5551680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -51, node num: 4, free heap: 133504
I (5561680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -53, node num: 4, free heap: 133504
I (5571680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -53, node num: 4, free heap: 133504
I (5581680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5591680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5594817) mesh: 5117<assoc>parent layer:1, channel:5, rssi:-50, assoc:3, rssi threshold<-78,-82,-85>
I (5601680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5611680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -54, node num: 4, free heap: 133504
I (5621680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5631680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -50, node num: 4, free heap: 133504
I (5641680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -51, node num: 4, free heap: 133504
I (5651680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5661680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5671680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -53, node num: 4, free heap: 133504
I (5681680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -52, node num: 4, free heap: 133504
I (5691680) [mesh_utils, 150]: System information, channel: [5/2], layer: 2, self mac: 7c:9e:bd:f0:7d:b4, parent bssid: 4c:75:25:c3:af:e9, parent rssi: -55, node num: 4, free heap: 133504

Screenshot of the APP as below
Screenshot_20220210-121948_ESP MeshKit

The sever side log

(base) esp32@Mac-Pro build % sauth test testing 10.0.1.93 8000
Serving "/Users/esp32/Firmware/build" directory on http://10.0.1.93:8000
send header
10.0.1.145 - - [10/Feb/2022 12:29:01] "GET /ESP32Firmware.bin HTTP/1.1" 401 -
send header
10.0.1.145 - - [10/Feb/2022 12:29:26] "GET /ESP32Firmware.bin HTTP/1.1" 401 -

Any reason for the app stop the OTA sequence? and checking/adjustment on the firmware or the app or the server is required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant