plambrechtsen / pethublocal

Local docker stack to replace the SurePetCare "Connect" cloud service.
GNU General Public License v3.0
74 stars 10 forks source link

Unable to download credentials #14

Open ShogunPanda opened 1 year ago

ShogunPanda commented 1 year ago

Hello! I was following your guide to download the AWS MQTT certificate with no luck.

If I execute the following request (got with Insomnia, but curl returns the same):

* Preparing request to http://hub.api.surehub.io/api/credentials
* Current time is 2023-06-01T12:36:39.269Z
* Enable automatic URL encoding
* Using default HTTP version
* Enable SSL validation
* Enable cookie sending with jar of 2 cookies
* Too old connection (4506 seconds), disconnect it
* Connection 10 seems to be dead!
* Closing connection 10
* TLSv1.2 (OUT), TLS alert, close notify (256):
*   Trying 34.226.18.158:80...
* Connected to hub.api.surehub.io (34.226.18.158) port 80 (#11)

> POST /api/credentials HTTP/1.1
> Host: hub.api.surehub.io
> Content-Type: application/x-www-form-urlencoded
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Accept: */*
> Content-Length: 93
>
> serial_number=H010-0REDACTED&mac_address=REDACTED&product_id=1&firmware_version=2.43

* Mark bundle as not supporting multiuse

< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 01 Jun 2023 12:36:39 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Update: 1
< X-Update-Data: 00e900d1010100e900880102
< X-Signature: 7258d0be7234dc771619a44a03c1771dd4846d3daeb65c7594cf86990eac8aee
< X-Time: 1685622999558
<
< v02:0::::1:::

* Received 23 B chunk
* Connection #11 to host hub.api.surehub.io left intact

So the response body is:

v02:0::::1:::

Do you have any idea of what I'm doing wrong? Note that I also tried to reboot my hub to force a firmware update.

According to the the /api/me/start, here are the device informations:

"devices": [
    {
        "id": REDACTED,
        "product_id": 1,
        "product_firmware_id": 193,
        "household_id": REDACTED,
        "name": "Garage",
        "serial_number": "H010-0REDACTED",
        "mac_address": "REDACTED",
        "version": "NDA1MjI=",
        "created_at": "2020-03-19T13:45:34+00:00",
        "updated_at": "2023-06-01T11:20:55+00:00",
        "control": {
            "led_mode": 4,
            "pairing_mode": 0
        },
        "status": {
            "led_mode": 4,
            "pairing_mode": 0,
            "version": {
                "device": {
                    "hardware": 3,
                    "firmware": 233.364
                }
            },
            "online": true
        }
    },
plambrechtsen commented 9 months ago

The problem is your firmware has been upgraded on the hub "firmware": 233.364 so you are unfourtunately completely locked out. The only option now is to build a completely new hub with a ESP32 or similar as per #15