First step to install Open Hybrid on raspberry pi?

Ah, ok, but when you install from nodesource you have to use nodejs because that’s what they call their package, I think… But you could try to install the adafruit node, as well. You are running Wheezy right? If that works, we could change the manual to use adafruit instead of nodesource and add Wheezy and Jessie to the supported OSes list. Hopefully it will even work on the PI 2, which is what Kevin is figuring out right now.

Installed on pi B+, works good!
steps I followed:

  1. sudo apt-get update
  2. sudo apt-get upgrade -y
  3. curl -sLS https://apt.adafruit.com/add | sudo bash
  4. sudo apt-get install node
  5. node -v
  6. git clone https://github.com/openhybrid/object.git
  7. cd object
  8. sudo npm --unsafe-perm install
  9. node server.js

note:
sudo npm --unsafe-perm install will take care of all the permission issues

gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/0.12.6”

2 Likes

Yes that’s what I did too. Except for the - - unsafe-perm that wasn’t necessary for me.

1 Like

You guys are great! I ran the script above on my out-of-the-box Pi 2, and it worked without complaint.

Then I picked my way through some of the tutorials for Arduino, and after a few gyrations got a test Vuforia object built and apparently somewhat loaded. I loaded Reality Editor on my iPhone, and pointed it at my target. I haven’t added any object code to the Pi, so I’m not sure what it should do, but after pressing the icons at the top I get a dev’p page that shows my Pi’s IP address under “Found Objects”. No highlights or anything on the screen, though…I assume because I’ve added nothing.

So, now I’m a bit confused. Can I ignore some of the Arduino-ish parts and go straight to the Adding Web Content part? Should I already see something as an overlay?

Tomorrow, I’ll plink around with adding files to the Add Interface and see what happens with some trial and error. But if somebody has advice that’d be appreciated too!

1 Like

Thanks for the confirmation, @AndrewsJustin, that’s awesome!

The reason you needed the ‘–unsafe-perm’ flag is because you ran npm install as root. If you remove your node_modules directory and try again without sudo, you should not run into the EACCES warnings.

Also you may want to check dpkg --get-selections | grep node to see if you have two packages installed (node and nodejs - nodejs typically comes pre-installed on Raspian). sudo apt-get remove nodejs should get rid of the default package.

1 Like

@psomdecerff you can skip the arduino parts, the arduino code is for controlling the GPIO or I/O points, you can directly add web interfaces,
The GPIO interface for the pi is under development you can use this version here
https://github.com/KevinOrtman/object/commit/e6f8bfeba08e31098e36a025d9e72ab75bde3564
and follow the development thread Raspberry Pi GPIO Support to keep updated :smile:

1 Like

I can confirm that the adafruit repo installs on well my hardware.
Like Carsten, I get node v0.12.6

Pi 2 Model B v1.1
OS: Raspbian GNU/Linux 8.0 (jessie)

Thanks EVERYONE for verifying the install process!
I updated the README.md as follows:

How to install on a Raspberry Pi

  1. Use NOOBS to install the base Raspian image.

  2. Update the system software.

    sudo apt-get update
    sudo apt-get upgrade -y
    
  3. Remove the default nodejs instance and replace it with v0.12 or higher.

    sudo apt-get remove nodejs
    curl -sLS https://apt.adafruit.com/add | sudo bash
    sudo apt-get install -y node
    
  4. Get the latest OpenHybrid Object code and download dependencies.

    git clone https://github.com/openhybrid/object.git
    cd object
    npm install
    
  5. Run the OpenHybrid Object code.

    node server.js
    
1 Like

Welcome to the community!

As @V_Mohammed_Ibrahim pointed out, this thread has more info on the GPIO support: Raspberry Pi GPIO Support and a video demo is here: https://flic.kr/p/BgiNms

Also, make sure you check out valentin’s videos (especially http://openhybrid.org/adding-object-and-marker.html )

Fortunately, valentin merged my pull request into carsten’s new Hardware Interfaces branch, so you can get the latest code by running a git checkout beta_hardwareInterfaces. The config.json file allows you to define your I/O pins.

3 Likes

@KevinOrtman i tested the manual on my pi B+ v1.2 it is working ,

i installed the Raspbian directly to the SD card using win32disk imager, ( didnt have Noobs )
ran into an issue at npm install ( waited half hour to complete but still didnt complete)
after using these steps npm install worked fine ( took only about 5 mins)

sudo apt-get install libasound2-dev
sudo apt-get install npm

this might have occurred because i didnt use NOOBS

Thanks @KevinOrtman, good point on the -unsafe-perm flag. there was no nodejs on my pi, so didn’t have to remove it.

1 Like

@KevinOrtman, thanks to you and the others this newbie is having some success. I have plinked around and created a few test interfaces and successfully gotten overlay buttons, sliders, and other oddball graphics to overlay, (simplistically, I know). I learned enough git to get the beta branch down and working, too. The Pi + Reality Editor solution is really surprisingly robust in finding targets and applying overlays!

My next goal is to control a white Hue (dimmer) with a slider. I’ve got the control slider, but am unsure where to start to tie in the Hue REST interface (curl scripting?). Does it all go into index.html – that seems wrong, the object control should talk to the Pi, and the Pi should talk to the Hue? I looked through the Arduino Yun Example for twiddling analog outputs for a LED, and I gather the Web part at the bottom goes in index.html to add some meat to the slider object overlay. But where in the Pi code does the back-end go? There is some Arduino code in the example, but no file identifier, and the helpful link to instructions goes to 404.

If you have time to advise, I would much appreciate it, else after some errands today I’ll go read some of the Pi code framework and see what I discover.

Thanks!
Peter

1 Like

hi @psomdecerff the javascript code at the bottom of the index.html helps in communication between the AR element and the hybridobject , you can do the same for the pi ,
but the pi does not have direct analog output as you might know , you may need DAC to use analog values ,the GPIO test interface made by @KevinOrtman is in the beta_branch , you can use the GPIO of the pi by entering info for the pins in the config.json file
let me know if this helps :smile:

@psomdecerff, I gather from the other thread that you are well on your way to communicating with the Hue via Carsten’s HW Interface example, is that correct?

If you still need help or advice, we’re here and happy to help - start a new thread or message us directly?

I’m in good shape - thanks! I suspect that those familiar with the tools and the codebase could have done what I did in a fraction of the time. I’m just learning as I go, as this is my first dive into open source, and it’s working out.

3 Likes

Its a good start!
:sunglasses:

So rasberry pi 3 has now wifi included that will be easier to setup? the process will be different?

@fabianrios no it will be same, the install process will be the same for PI 3,
Only difference is you don’t need an external wifi adapter or LAN cable to connect to network as there is inbuilt wifi .
Right @valentin ?

I have not seen the PI 3. Looks wonderful.

Thanks for the reply, I have access to one PI 3. My question is, in that case the Arduino Yun is still a necessity to make the slider example? or is it possible to use the PI 3 for that purpose as well using something like Wiring Pi?

@fabianrios You can have the slider exapmle on the PI 3 also , but as far as i know the PI has only digital pins ,so you cannot have the full range of control for the slider, Instead you can either use the already existing PI hardware interface or create hardware interface for yourself to obtain ON/OFF functionality with the slider
However if you really need the full analog range function of the slider , you could use some kind of A/D converter :slight_smile:

@valentin the PI 3 is great, it has inbuilt wifi module like the Yun and also more power

1 Like