hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
552 stars 51 forks source link

HOOBS rebooting on its own Daily #1819

Closed LeviJSmith closed 2 years ago

LeviJSmith commented 2 years ago

Description My HOOBS device is restarting on it's own daily. I believe this has something to do with a Javascript heap out of memory error I am seeing in the syslog. I upgraded to a bigger Raspberry PI with more RAM to try and address this but it did not seem to help. Is there a way to increase the heap size? I would prefer not to consolidate my bridges if I can avoid it.

Version Hoobs 4.2.5 Node 16..15.0 Homebridge 1.4.1

Did you upgrade Please let us know if you upgraded from a previous version.

Pervious version If you upgraded, please let us know your previous version.

What device are you using? Please let us know the device you are running HOOBS on.

If this is a custom install, what's your operating system? CanaKit Raspberry Pi 4 64 bit quad core processor running @1.5 ghz & 8gb RAM. I had a HOOBS box before so I downloaded the HOOBS image off the HOOBS website and installed it on the this new box.

List your plugins Please include a list of the plugins you are using. We need to be able to find it on NPM. If the plugin is no published, please include a link to the repository. Dummy Bond Braava Enphase Envoy Mysmartblinds Nest Rachio Platform Ring Rommba2 SmartThings Sonybravia Platform Sure Petcare Platform Tplink Smarthome Wideq

Post your config This can be found in the interface, Configuration -> Advanced or you can get it via SSH cat ~/.hoobs/etc/config.json

POST CONFIG HERE
HOBBS2-Dummy
{
    "accessories": [
        {
            "name": "Alarm Off",
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Unlock Garage Door",
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Open Garage Door",
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Unlock Front Door",
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Router UPS Power On",
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Test",
            "time": 1000,
            "accessory": "DummySwitch"
        }
    ],
    "platforms": []
}

HOOBS2-Bond
{
    "accessories": [],
    "platforms": [
        {
            "platform": "Bond",
            "bonds": [
                {
                    "ip_address": "IP ADDRESS",
                    "token": "TOKEN"
                }
            ],
            "include_dimmer": true,
            "include_toggle_state": true,
            "fan_speed_values": true
        }
    ]
}

HOOBS2-Braava
{
    "accessories": [
        {
            "name": "Moppie",
            "model": "m6",
            "blid": "BLID",
            "robotpwd": "PWD",
            "ipaddress": "IP",
            "keepAliveEnabled": true,
            "cacheTTL": 30,
            "accessory": "Braava"
        }
    ],
    "platforms": []
}

HOOBS2-Envoy
{
    "accessories": [],
    "platforms": [
        {
            "platform": "enphaseEnvoy",
            "devices": [
                {
                    "name": "Envoy",
                    "host": "IP",
                    "refreshInterval": 5,
                    "powerProductionMaxDetected": 0,
                    "energyProductionLifetimeOffset": 0,
                    "powerConsumptionTotalMaxDetected": 0,
                    "energyConsumptionTotalLifetimeOffset": 0,
                    "powerConsumptionNetMaxDetected": 0,
                    "energyConsumptionNetLifetimeOffset": 0
                }
            ]
        }
    ]
}

HOOBS-MySmartblinds
{
    "accessories": [],
    "platforms": [
        {
            "username": "USER",
            "pollingInterval": 0,
            "platform": "MySmartBlindsBridge",
            "password": "PASSWORD",
            "closeUp": true,
            "name": "MySmartBlindsBridge"
        }
    ]
}

HOOBS2-Nest
{
    "accessories": [],
    "platforms": [
        {
            "platform": "Nest",
            "name": "Nest",
            "fanDurationMinutes": 15,
            "googleAuth": {
                "issueToken": "ISSUE TOKEN",
                "cookies": "COOKIES",
                "apiKey": "APIKEY"
            },
            "options": [
                "Thermostat.SeparateBuiltInTemperatureSensor.Enable",
                "Thermostat.SeparateBuiltInHumiditySensor.Enable",
                "HomeAway.AsOccupancySensorAndSwitch"
            ]
        }
    ]
}

HOOBS2-Rachio
{
    "accessories": [],
    "platforms": [
        {
            "platform": "Rachio-Platform",
            "external_webhook_address": "WEBHOOB",
            "internal_webhook_port": PORT,
            "name": "Rachio Controller",
            "api_key": "KEY"
        }
    ]
}

HOOBS2-Ring
{
    "accessories": [],
    "platforms": [
        {
            "platform": "Ring",
            "hideUnsupportedServices": true,
            "sendDoorbellMotionNotificationsToTv": true,
            "avoidSnapshotBatteryDrain": false,
            "refreshToken": "TOKEN",
            "cameraStatusPollingSeconds": 20,
            "cameraDingsPollingSeconds": 2,
            "hideInHomeDoorbellSwitch": false,
            "nightModeBypassFor": "some"
        }
    ]
}

HOBBS2-Roomba
{
    "accessories": [
        {
            "binContactSensor": true,
            "runningContactSensor": true,
            "stopBehaviour": "home",
            "robotpwd": "ROBOTPWD",
            "blid": "BLID",
            "ipaddress": "IPADDRESS",
            "dockingContactSensor": true,
            "model": "S9+",
            "dockContactSensor": true,
            "name": "Sasha",
            "accessory": "Roomba2"
        }
    ],
    "platforms": []
}

HOOBS2-SmartThings
{
    "accessories": [],
    "platforms": [
        {
            "platform": "SmartThings-v2",
            "name": "SmartThings-v2",
            "direct_port": 8000,
            "app_url": "URL",
            "app_id": "ID",
            "access_token": "TOKEN",
            "temperature_unit": "F",
            "validateTokenId": true,
            "logConfig": {
                "showChanges": true,
                "file": {
                    "level": "error"
                },
                "debug": false
            }
        }
    ]
}

HOOBS2-SonyBravia
{
    "accessories": [],
    "platforms": [
        {
            "platform": "SonyBravia",
            "ipadress": "IP",
            "extraInputs": false,
            "interval": 5,
            "volumeEnabled": true,
            "maxVolume": 100,
            "name": "SonyTV Family Room",
            "polling": true,
            "cecs": [
                {
                    "logaddr": 4,
                    "port": 1,
                    "label": "Apple TV"
                }
            ],
            "psk": "PSK"
        }
    ]
}

HOOBS2-SurePetcare
{
    "accessories": [],
    "platforms": [
        {
            "platform": "SurePetcare",
            "occupancy_flipped": false,
            "poll_interval": 30,
            "password": "PWD",
            "email": "EMAIL",
            "pet_occupancy": true,
            "lock_mode": 1
        }
    ]
}

HOOBS2-Tplink
{
    "accessories": [],
    "platforms": [
        {
            "platform": "TplinkSmarthome",
            "name": "NAME",
            "addCustomCharacteristics": true,
            "transport": "tcp"
        }
    ]
}

HOOBS2-WideQ
{
    "accessories": [],
    "platforms": [
        {
            "platform": "WideQ",
            "country": "US",
            "language": "en-US",
            "interval": 10,
            "refresh_token": "TOKEN"
        }
    ]
}

**Post your log**
You can get the log from the interface. This is in the Log section.

POST LOG HERE

SYSLOG

May 30 23:06:11 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:12 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:12 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:13 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:13 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:14 hoobs hoobsd[420]: <--- Last few GCs ---> May 30 23:06:14 hoobs hoobsd[420]: [420:0x1fb191d0] 99276412 ms: Mark-sweep (reduce) 253.8 (261.4) -> 253.1 (261.4) MB, 319.3 / 0.2 ms (+ 402.1 ms in 245 steps since start of marking, biggest step 28.6 ms, walltime since start of marking 1285 ms) (average mu = 0.953, current mu = 0.967) f[420:0x1fb191d0] 99302913 ms: Mark-sweep (reduce) 254.1 (261.4) -> 253.2 (261.6) MB, 317.9 / 0.2 ms (+ 502.4 ms in 355 steps since start of marking, biggest step 19.0 ms, walltime since start of marking 1265 ms) (average mu = 0.961, current mu = 0.969) f May 30 23:06:14 hoobs hoobsd[420]: <--- JS stacktrace ---> May 30 23:06:14 hoobs hoobsd[420]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory May 30 23:06:14 hoobs hoobsd[420]: 1: 0xafb5c8 node::Abort() [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 2: 0xa22a88 node::FatalError(char const, char const) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 3: 0xcd0888 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 4: 0xcd0a14 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 5: 0xe7e5f0 v8::internal::Heap::EnsureFromSpaceIsCommitted() [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 6: 0xe8d930 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 7: 0xe8e738 v8::internal::Heap::FinalizeIncrementalMarkingIfComplete(v8::internal::GarbageCollectionReason) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 8: 0xe91d44 v8::internal::IncrementalMarkingJob::Task::RunInternal() [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 9: 0xd93a0c non-virtual thunk to v8::internal::CancelableTask::Run() [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 10: 0xb5f310 node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete >) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 11: 0xb61080 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 12: 0x14c6754 [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 13: 0x14d7b28 [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 14: 0x14c70f0 uv_run [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 15: 0xa49074 node::SpinEventLoop(node::Environment) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 16: 0xb36b98 node::NodeMainInstance::Run(node::EnvSerializeInfo const) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 17: 0xac4440 node::Start(int, char**) [hoobsd] May 30 23:06:14 hoobs hoobsd[420]: 18: 0xffffa79f6218 __libc_start_main [/lib/aarch64-linux-gnu/libc.so.6] May 30 23:06:14 hoobs hoobsd[420]: 19: 0xa473dc [hoobsd] May 30 23:06:14 hoobs systemd[1]: hoobsd.service: Main process exited, code=killed, status=6/ABRT May 30 23:06:14 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:14 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:15 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:15 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:16 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:16 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:17 hoobs systemd[1]: hoobsd.service: Failed with result 'signal'. May 30 23:06:17 hoobs systemd[1]: hoobsd.service: Consumed 4h 35min 41.640s CPU time. May 30 23:06:17 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:17 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:18 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:18 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:19 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:19 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:20 hoobs systemd[1]: hoobsd.service: Scheduled restart job, restart counter is at 1. May 30 23:06:20 hoobs systemd[1]: Stopped HOOBSD. May 30 23:06:20 hoobs systemd[1]: hoobsd.service: Consumed 4h 35min 41.640s CPU time. May 30 23:06:20 hoobs systemd[1]: Started HOOBSD. May 30 23:06:20 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:20 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:21 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:21 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:22 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:22 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:23 hoobs lircd[485]: lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found May 30 23:06:23 hoobs lircd-0.10.1[485]: Error: No /sys/class/rc/ devices found

Plugin Logs

5/30/2022, 11:06:41 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Dorena Main Floor Hall Lights] plug [800637BC9D458F97B1FA7BBF967C411B1991CB56] 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeDevice First Online: [Dorena Rachio Plug] plug [8006A59E2231FC7AF4E4BB4C495974181E4D32CF] 192.168.1.128 9999 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Dorena Rachio Plug] plug [8006A59E2231FC7AF4E4BB4C495974181E4D32CF] 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeDevice First Online: [Dorena Ring Chime DS Plug] plug [8006D2AF0D503E0D01D1BE2A319312F81E4DDA61] 192.168.1.22 9999 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Dorena Ring Chime DS Plug] plug [8006D2AF0D503E0D01D1BE2A319312F81E4DDA61] 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeDevice First Online: [Dorena Zoe Bedroom Lamp] plug [8006656233CA8A421D7F37010209FC5A1DD960B4] 192.168.1.191 9999 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Dorena Zoe Bedroom Lamp] plug [8006656233CA8A421D7F37010209FC5A1DD960B4] 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeDevice First Online: [Front Porch West] bulb [80125D3D6334D1964789DCC2915CD4FE18DFBC6E] 192.168.1.149 9999 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Front Porch West] bulb [80125D3D6334D1964789DCC2915CD4FE18DFBC6E] 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeDevice First Online: [Dorena Formal Living Room Lamp] plug [80064C57AD3FB2741D9FA4593E1C306918A5C5DF] 192.168.1.236 9999 5/30/2022, 11:06:42 PMHOOBS2-TplinkTplinkSmarthomeAdding: [Dorena Formal Living Room Lamp] plug [80064C57AD3FB2741D9FA4593E1C306918A5C5DF] 5/30/2022, 11:06:42 PMHOOBS2-SmartThingsBridge is running on port 51866. 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaLoaded plugin 'homebridge-sonybravia-platform' 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaLoading 1 platforms... 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaSonyTV Family RoomCritical interval value! Setting interval to 10 seconds 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaSonyTV Family RoomApps not enabled. Skipping discovery. 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaSonyTV Family RoomChannels not enabled. Skipping discovery. 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaSonyTV Family RoomInputs not enabled. Skipping discovery. 5/30/2022, 11:06:43 PMHOOBS2-SonyBraviaSonyTV Family RoomCEC detection not enabled. Skipping discovery. 5/30/2022, 11:06:44 PMHOOBS2-SonyBraviaSonyTV Family RoomExtra Inputs not enabled. Skipping discovery. 5/30/2022, 11:06:44 PMHOOBS2-SonyBraviaSonyTV Family RoomFound 0 HDMI input(s) with 0 CEC device(s), 0 extra input(s), 0 app(s) and 0 channel(s) 5/30/2022, 11:06:45 PMHOOBS2-SonyBraviaBridge is running on port 51946. 5/30/2022, 11:06:45 PMHOOBS2-RoombaLoaded plugin 'homebridge-roomba2' 5/30/2022, 11:06:45 PMHOOBS2-RoombaLoading 1 accessories... 5/30/2022, 11:06:45 PMHOOBS2-BraavaLoaded plugin 'homebridge-braava' 5/30/2022, 11:06:45 PMHOOBS2-TplinkTplinkSmarthomeWARNING[Front Porch West] getValue: Invalid Watts: undefined 5/30/2022, 11:06:45 PMHOOBS2-TplinkTplinkSmarthomeWARNING[Front Porch East] getValue: Invalid Watts: undefined 5/30/2022, 11:06:45 PMHOOBS2-BraavaLoading 1 accessories... 5/30/2022, 11:06:46 PMHOOBS2-BraavaMoppieEnabling keepAlive 5/30/2022, 11:06:46 PMHOOBS2-TplinkTplinkSmarthomeWARNING[Garage Light East] getValue: Invalid Watts: undefined 5/30/2022, 11:06:46 PMHOOBS2-TplinkTplinkSmarthomeWARNING[Side Porch] getValue: Invalid Watts: undefined 5/30/2022, 11:06:46 PMHOOBS2-TplinkTplinkSmarthomeWARNING[Garage Light West] getValue: Invalid Watts: undefined 5/30/2022, 11:06:47 PMHOOBS2-EnvoyLoaded plugin 'homebridge-enphase-envoy' 5/30/2022, 11:06:47 PMHOOBS2-EnvoyLoading 1 platforms... 5/30/2022, 11:06:47 PMHOOBS2-BraavaBridge is running on port 51896. 5/30/2022, 11:06:47 PMHOOBS2-RoombaBridge is running on port 51926. 5/30/2022, 11:06:48 PMHOOBS2-EnvoyBridge is running on port 51836. 5/30/2022, 11:06:49 PMHOOBS2-SurePetcareLoaded plugin 'homebridge-sure-petcare-platform' 5/30/2022, 11:06:49 PMHOOBS2-SurePetcareLoading 1 platforms... 5/30/2022, 11:06:50 PMHOOBS2-NestLoaded plugin 'homebridge-nest' 5/30/2022, 11:06:50 PMHOOBS2-NestLoading 1 platforms... 5/30/2022, 11:06:50 PMHOOBS2-NestNestFetching Nest devices. 5/30/2022, 11:06:50 PMHOOBS2-SurePetcareBridge is running on port 51936. 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieRunning status requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieBattery status requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieBattery level requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieCharging status requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieTank state requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppieTank fill level requested 5/30/2022, 11:06:50 PMHOOBS2-BraavaMoppiePad state requested 5/30/2022, 11:06:51 PMHOOBS2-BraavaMoppieBraava[{"running":0,"charging":1,"batteryLevel":100,"batteryStatus":0,"padDetected":1,"padType":"invalid","tankReady":1,"tankLevel":0}] 5/30/2022, 11:06:51 PMHOOBS2-BraavaMoppieBraava[{"running":0,"charging":1,"batteryLevel":100,"batteryStatus":0,"padDetected":1,"padType":"invalid","tankReady":1,"tankLevel":0}] 5/30/2022, 11:06:51 PMHOOBS2-BraavaMoppieBraava[{"running":0,"charging":1,"batteryLevel":100,"batteryStatus":0,"padDetected":1,"padType":"invalid","tankReady":1,"tankLevel":0}]

Additional context This was happening on a HOOBS box that I had bought from Hoobs.org. I had a feeling it had to do with the amount of RAM available on that box so I bought a RaspberryPI with more RAM as indicated above. Even with the 8gb or RAM I am still getting the error. I realize I am running all 14 of my plugins on a separate bridges but I was hoping I wouldn't have to combine any. Is there a way to increase the java heap size?

mkellsy commented 2 years ago

You can do this currently by editing the binary file. It's not hard to do.

From the terminal run this command.

sudo nano /usr/bin/hoobsd

The file contents will look like this.

#!/usr/bin/env -S node --max-old-space-size=256 --v8-pool-size=10

/**************************************************************************************************
 * hoobsd                                                                                         *
 * Copyright (C) 2020 HOOBS                                                                       *
...

Edit the shebang (#!) line.
Change --max-old-space-size=256 to --max-old-space-size=4096
Only change numbers, leave the rest of the line alone, you can break it.

Note that you will have to change this when hoobsd updates.

We are planing on removing this directive and using what Node uses out of the box, because as of Node 16 they increased this to 4.03 GB and using the build-in heap setting allows Node to dynamically change this on lower memory systems.

LeviJSmith commented 2 years ago

Thanks for the info. I made the change this morning. Will also keep in mind I will need to make this change each time hoobsd updates. Have a great day. closing issue.