rsg98 / homebridge-gpio-wpi2

Homebridge Raspberry Pi GPIO Platform (API 2) Plugin - using WiringPi as a backend
48 stars 16 forks source link

Error: The requested platform 'WiringPiPlatform' was not registered by any plugin. #23

Closed bonelessc closed 7 years ago

bonelessc commented 7 years ago

Hi!

Started playing around with homebridge, worked fine earlier today, messed it up somehow and did a clean Jessie install, and am having trouble getting stuff to work.

Followed the instructions, but am running into an issue when trying to start homebridge with your example config file:

Error: The requested platform 'WiringPiPlatform' was not registered by any plugin.

Any tips/hints?

Thanks!

rsg98 commented 7 years ago

It usually means a missing dependency or config error. If you can post the full error log, we should be able to figure it out.

bonelessc commented 7 years ago

Hi! Thanks for the quick reply! I am unable to find any logs (/var/log). No messages in daemon.log. This is the complete error that is thrown:

`[5/26/2017, 7:31:42 AM] No plugins found. See the README for information on installing plugins. [5/26/2017, 7:31:42 AM] Loaded config.json with 0 accessories and 1 platforms. [5/26/2017, 7:31:42 AM] --- [5/26/2017, 7:31:43 AM] Loading 1 platforms... /usr/local/lib/node_modules/homebridge/lib/api.js:122 throw new Error("The requested platform '" + name + "' was not registered by any plugin."); ^

Error: The requested platform 'WiringPiPlatform' was not registered by any plugin. at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:284:45) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) `



And the config.json
`{
    "bridge": {
            "name": "Homebridge",
            "username": "CC:22:3D:E3:CE:30",
            "port": 51826,
            "pin": "031-45-155"
    },
    "description": "This is an example configuration file with one fake accessory and one fake platform.",

    "platforms": [
        {
            "platform" : "WiringPiPlatform",
            "name" : "Pi GPIO (WiringPi)",
            "overrideCache" : "false",
            "autoExport" : "true",
                "gpiopins" : [{
                        "name" : "GPIO2",
                        "pin"  : 27,
                "enabled" : "true",
                        "mode" : "out",
                "pull" : "down",
                        "inverted" : "false",
                "duration" : 0
                },{
                        "name" : "GPIO3",
                        "pin"  : 22,
                "enabled" : "true",
                        "mode" : "out",
                "pull" : "down",
                        "inverted" : "false",
                "duration" : 0
            },{
                        "name" : "GPIO4",

```  "pin"  : 23,
                "enabled" : "true",
                        "mode" : "out",
                "pull" : "down",
                        "inverted" : "false",
                "duration" : 0
            },{
                        "name" : "GPIO5",
                        "pin"  : 24,
                "enabled" : "true",
                        "mode" : "out",
                "pull" : "down",
                        "inverted" : "false",
                "duration" : 0
            },{
                        "name" : "GPIO6",
                        "pin"  : 25,
                "enabled" : "true",
                        "mode" : "out",
                "pull" : "down",
                        "inverted" : "false",
                "duration" : 0
            }]
        }

    ]
}`
rsg98 commented 7 years ago

It looks like it can't find the homebridge-gpio-wpi2 plugin at all... do you know where npm has put it? There's some more info on npm paths here:

https://stackoverflow.com/questions/5926672/where-does-npm-install-packages

The user you're running homebridge as will need access to the module, and it needs to be on the module path that node is searching. You can also force homebridge to look for modules in a specific place using -P, e.g. homebridge -D -P /path/to/my/plugins (-D does a bit more debug logging as well).

bonelessc commented 7 years ago

Thanks! I will check that out.

Where is homebridge expecting the plugins? And how can I make sure they are installed there in the first place?

rsg98 commented 7 years ago

It looks through all the node paths (rather than this being anything special about homebridge)

One way to make sure is to install the plugins globally, i.e.

sudo npm install -g homebridge-gpio-wpi2

You should then find it under /usr/local/bin/node_modules/homebridge-gpio-wpi2 - but it may be somewhere else depending on how node / npm are configured. You can run npm list and npm -g list to see what modules it can find.

bonelessc commented 7 years ago

alright, I thought I had all that covered, but I will start over (for the 3rd time) with a clean install :).

one more thing, any recommendations for a version of node? I am on a armv6 model.

Thanks so much!

rsg98 commented 7 years ago

I usually use the stock Node that ships with Raspbian - but any recent version of Node should be fine. On Fri, 26 May 2017 at 14:27, tonverra notifications@github.com wrote:

alright, I thought I had all that covered, but I will start over (for the 3rd time) with a clean install :).

one more thing, any recommendations for a version of node? I am on a armv6 model.

Thanks so much!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/rsg98/homebridge-gpio-wpi2/issues/23#issuecomment-304282178, or mute the thread https://github.com/notifications/unsubscribe-auth/ARe_tau4_sYhDz4hP1jdqCaclu_BqKI-ks5r9tMzgaJpZM4NnJJV .

bonelessc commented 7 years ago

Thanks for all the help! I redid everything, making sure I was using -G and the latest node version. Thanks for all the work you do!