elfive / homebridge-petkit-feeder-mini

control your petkit feeder mini from homekit, get full use of iOS automation
Apache License 2.0
31 stars 10 forks source link

Stuck on initialize petkit feeder mini #21

Closed RobertD502 closed 3 years ago

RobertD502 commented 3 years ago

Describe the bug I am unable to get this plugin to work. I have double checked and made sure that the X-Session value is correct, but my logs show that it is getting stuck on "begin to initialize petkit feeder mini.".

Detail Information

  1. NodeJS version: 4.16.0
  2. Homebridge version: 1.3.3
  3. Plugin version: 1.10.4
  4. Example of configure(REMOVE sensitive info!):
    {
    "name": "LeftFeeder",
    "DropMeal_name": "DropMeal",
    "MealAmount_name": "MealAmount",
    "FoodStorage_name": "FoodStorage",
    "DesiccantLevel_name": "DesiccantLevel",
    "ManualLock_name": "ManualLock",
    "LightMode_name": "LightMode",
    "Battery_name": "Battery",
    "location": "north_america",
    "headers": [
        {
            "key": "X-Session",
            "value": "removed"
        },
        {
            "key": "X-Api-Version",
            "value": "7.24.0"
        },
        {
            "key": "X-Timezone",
            "value": "-5.0"
        },
        {
            "key": "X-Client",
            "value": "ios(13.5;iPhone10,6)"
        },
        {
            "key": "X-TimezoneId",
            "value": "America/New_York"
        },
        {
            "key": "X-Locale",
            "value": "en_US"
        },
        {
            "key": "Accept",
            "value": "*/*"
        },
        {
            "key": "Accept-Language",
            "value": "en;q=1"
        },
        {
            "key": "Accept-Encoding",
            "value": "gzip, deflate"
        },
        {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
        },
        {
            "key": "User-Agent",
            "value": "PETKIT/7.24.0 (iPhone; iOS 13.5; Scale/3.00)"
        },
        {
            "key": "F-Session",
            "value": "removed"
        }
    ],
    "deviceId": "removed",
    "autoDeviceInfo": true,
    "sn": "PetkitFeederMini",
    "firmware": "1.0.0",
    "manufacturer": "Petkit",
    "model": "Petkit feeder mini",
    "enable_polling": true,
    "polling_interval": 60,
    "enable_desiccant": false,
    "alert_desiccant_threshold": 7,
    "enable_autoreset_desiccant": false,
    "reset_desiccant_threshold": 5,
    "enable_manualLock": false,
    "enable_lightMode": false,
    "reverse_foodStorage_indicator": true,
    "fast_response": false,
    "accessory": "petkit_feeder_mini"
    }
  5. Logs(REMOVE sensitive info and homebridge debug mode):
    [3/11/2021, 4:01:11 PM] Loaded config.json with 1 accessories and 1 platforms.
    [3/11/2021, 4:01:11 PM] Loaded 0 cached accessories from cachedAccessories.
    [3/11/2021, 4:01:11 PM] ---
    [3/11/2021, 4:01:11 PM] Loaded plugin: homebridge-config-ui-x@4.40.0
    [3/11/2021, 4:01:11 PM] Registering platform 'homebridge-config-ui-x.config'
    [3/11/2021, 4:01:11 PM] ---
    [3/11/2021, 4:01:11 PM] Loaded plugin: homebridge-petkit-feeder-mini@1.10.4
    [3/11/2021, 4:01:11 PM] Registering accessory 'homebridge-petkit-feeder-mini.petkit_feeder_mini'
    [3/11/2021, 4:01:11 PM] ---
    [3/11/2021, 4:01:11 PM] Loading 1 platforms...
    [3/11/2021, 4:01:11 PM] [Config] Initializing config platform...
    [3/11/2021, 4:01:11 PM] [Config] Running in Service Mode
    [3/11/2021, 4:01:11 PM] Loading 1 accessories...
    [3/11/2021, 4:01:11 PM] [LeftFeeder] Initializing petkit_feeder_mini accessory...
    [3/11/2021, 4:01:11 PM] [LeftFeeder] begin to initialize petkit feeder mini.
RobertD502 commented 3 years ago

Just tested the api out in postman and I am receiving this error in response:

{
    "error": {
        "code": 1,
        "msg": "Oops, our system is busy, try again in a bit"
    }
}

This seems to be what is holding it up, but I am not sure how to fix it as this has been going on for several days. It'll require a deeper investigation as navigating the api endpoints through the app doesn't trigger the error seen above.

Nevermind, I didn't set the body properly in my postman request. Once I did that, it worked, which doesn't answer me what is going wrong with the plugin.

elfive commented 3 years ago

is the plugin work now? I note that your homebridge is version 1.3.3, this plugin currently not compatible with homebridge 1.3.x, this may cause homebridge hangs up and output no error log.

RobertD502 commented 3 years ago

I just went ahead and built out the functions of the feeder by using node red since my end goal was to get the sensors into home assistant. I'll come back and test the plugin out once it is compatible with 1.3.x versions. Thanks for the response!

elfive commented 3 years ago

petkit feeder mini plugin v2.0.0 is released, you can now safely install and work with it.