First step to install Open Hybrid on raspberry pi?


#41

That stinks. Do you get a response when you run ‘nodejs --version’ ?


#42

Yes, Segmentation fault :smile:


#43

booo. Maybe the nodesource.com build is using Pi 2 specific HW flags.

Could you guys try uninstalling the current nodejs and install adafriut’s distro?

curl -sLS https://apt.adafruit.com/add | sudo bash

I will do the same.


#44

Ok, I will try that.


#45

OK, that seems to work, it installs node v0.12.6 and npm v2.11.2. What I did (caution: the nodejs package is called node in the adafruit repos and not nodejs):

curl -sLS https://apt.adafruit.com/add | sudo bash
sudo apt-get install node

Currently I’m running npm install. It’s taking forever…

UPDATE
Ok works perfectly. HybridObject server is up and running.


#46

yes , i think i should also use node instead of nodejs , i had used node last time , that may solve the problem ,will let you guys know :smile:


#47

What do you mean @V_Mohammed_Ibrahim ? What I meant was that you have to install the adafruit nodejs version with

sudo apt-get install node instead of sudo apt-get install nodejs because it’s called node in the adafruit repo. See https://learn.adafruit.com/node-embedded-development/installing-node-dot-js


#48

yeah i meant the same i used apt-get install node the time when all was working but i used this
curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
sudo apt-get install -y nodejs
while testing the install manual and ended up in a illegal instruction error


#49

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.


#50

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”


#51

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


#52

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!


#53

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.


#54

@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:


#55

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
    

#56

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.


#57

@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


#58

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


#59

@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


#60

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: