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

What's the preferred way for installing and loading custom drivers? #3

Closed
miguelaferreira opened this issue Jan 9, 2015 · 8 comments

Comments

@miguelaferreira
Copy link
Contributor

I've installed the kodi driver in my sphere in the under /data/ninjablocks/customdrivers because the directory where all the other drivers are (/opt/ninjablocks/drivers) is on a read-only file system.
Is there a default location for installing drivers?

Then I've started the driver on the command line. Is there a way to specify which drivers should be loaded on boot?

@wolfeidau
Copy link
Contributor

We are a bit short of documentation at the moment but the gist of it is:

  1. remount root to change to rw filesystem while hacking mount -o rw,remount /
  2. make a directory in /opt/ninjablocks/drivers matching the name of the driver
  3. copy the driver and package.json into that directory
  4. restart the sphere stack, I think it is sudo service restart spheramid

Our packaging system uses the stuff in the ninjapack directory, take a look in there and you will find a root which mirrors what we add to sphere.

Look around in /opt/ninjablocks/drivers you will see the pattern of how things are layed out.

One thing to note is I am not sure how much of this driver is built out yet only @elliots can answer that question.

@thatguydan
Copy link

4 should be:

sudo service sphere-director restart

@elliots
Copy link
Member

elliots commented Jan 10, 2015

Hey! Very cool to see people start looking through this, though it's making it clear very quickly we need to get more documentation written!

Here are some slightly adjusted instructions... =)

  1. Switch to root with sudo -i then run with-rw bash
  2. Make a directory in /opt/ninjablocks/drivers matching the name of the driver
  3. Build and copy from your machine with GOOS=linux GOARCH=arm go build && scp driver-kodi ninja@ninjasphere.local:/opt/ninjablocks/drivers/driver-kodi/ (you'll also need to copy over the package.json into the same dir)
  4. Starting it on the sphere itself run nservice driver-kodi start (if you want it to always start, edit the homecloud.autostart list in /opt/ninjablocks/config/default.json)

Alternatively, you can run the driver on your own machine during development (we dev on macs, but windows and linux will be fine)... run go build && DEBUG=* ./driver-kodi --mqtt-host=ninjasphere.local to run it connected to your sphere (so it will work with the phone app and LED controller) or go build && DEBUG=* ./driver-kodi --autostart to run it standalone.

@elliots
Copy link
Member

elliots commented Jan 10, 2015

And I'll make it so drivers can also be loaded from /data/drivers, save the hassles with the RO filesystem.

@elliots
Copy link
Member

elliots commented Jan 10, 2015

Last I checked it was able to play/pause, next/previous and adjust the volume/mute... as well as getting a low battery notification (which isn't actually shown anywhere yet). You can also check out https://github.com/ninjasphere/driver-upnp which works with kodi too. Not sure which one we'll end up using. Possibly both.

@miguelaferreira
Copy link
Contributor Author

Thanks for all the support guys.

The instructions to install the driver worked perfectly.

I was already planning to start documenting all the stuff I'm learning in a git repo, but if you guys don't mind, I will also update the README of this repo and then make a PR.

@thatguydan
Copy link

In short, please PR. Thanks. As you may have gotten we have a large surface area of code :)

On Sat, Jan 10, 2015 at 3:04 AM, Miguel Ferreira notifications@github.com
wrote:

Thanks for all the support guys.
The instructions to install the driver worked perfectly.

I was already planning to start documenting all the stuff I'm learning in a git repo, but if you guys don't mind, I will also update the README of this repo and then make a PR.

Reply to this email directly or view it on GitHub:
#3 (comment)

@miguelaferreira
Copy link
Contributor Author

PR: #4

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

4 participants