That stinks. Do you get a response when you run ‘nodejs --version’ ?
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.
Ok, I will try that.
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…
Ok works perfectly. HybridObject server is up and running.
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
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
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
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:
- sudo apt-get update
- sudo apt-get upgrade -y
- curl -sLS https://apt.adafruit.com/add | sudo bash
- sudo apt-get install node
- node -v
- git clone https://github.com/openhybrid/object.git
- cd object
- sudo npm --unsafe-perm install
- node server.js
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”
Yes that’s what I did too. Except for the - - unsafe-perm that wasn’t necessary for me.
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!
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.
@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
and follow the development thread Raspberry Pi GPIO Support to keep updated
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
Use NOOBS to install the base Raspian image.
Update the system software.
sudo apt-get update sudo apt-get upgrade -y
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
Get the latest OpenHybrid Object code and download dependencies.
git clone https://github.com/openhybrid/object.git cd object npm install
Run the OpenHybrid Object code.
Welcome to the community!
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.
@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.
@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.
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