Git Product home page Git Product logo

Comments (11)

tigoe avatar tigoe commented on July 22, 2024

Note: I tried with npm install --python=2.7.3, no love.

from onoff.

fivdi avatar fivdi commented on July 22, 2024

The python-compiler package is a prerequisite for node-gyp. This package isn't installed by default on the Ångström distribution of Linux for the BeagleBone. Perhaps it's not installed on your system. If the following command outputs nothing to the screen it's not installed:

opkg list-installed python-compiler

It can be installed with the following commands:

opkg update
opkg install python-compiler

from onoff.

tigoe avatar tigoe commented on July 22, 2024

Thanks, I'll give that a try!

On Jul 25, 2013, at 12:57 PM, fivdi [email protected] wrote:

The python-compiler package is a prerequisite for node-gyp. This package isn't installed by default on the Ångström distribution of Linux for the BeagleBone. Perhaps it's not installed on your system. If the following command outputs nothing to the screen it's not installed:

opkg list-installed python-compiler

It can be installed with the following commands:

opkg update
opkg install python-compiler


Reply to this email directly or view it on GitHub.

from onoff.

tigoe avatar tigoe commented on July 22, 2024

Sadly, that's not it. Or not all of it. installed python-compiler - 2.7.3-r0.3.6, and got the same error message.

from onoff.

fivdi avatar fivdi commented on July 22, 2024

I tried the following on the BeagleBone (white, not black!)

  • Created a new SD card with Ångström from 2013.06.17 (http://downloads.angstrom-distribution.org/demo/beaglebone/)
  • After booting with the new SD card, executed the commands:
    opkg update and
    opkg install python-compiler
  • Downloaded the ZIP file for your GettingStartedWithNFC repository to the BeagleBone and unzipped it
  • Did a cd to directory NodeTagToLedPi
  • Executed the commad:
    npm update

Everything worked correctly and onoff compiled successfully.

The following part of the error you're getting is very unusual:

gyp ERR! stack Error: Python executable "python" is v2.7.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:118:14)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:107:9

Here's a snippet of code from configure.js:

  if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) {
    getNodeDir()
  } else {
    failPythonVersion(version) // <-- configure.js line 107
  }

version is '2.7.3' when this code is executed. I'd be very surprised if the semver module has an issue in its gte or lt functions.

I'm not sure, but I think something may be messed up on your system.

from onoff.

tigoe avatar tigoe commented on July 22, 2024

Interesting. I am on a black, not white, but using the same build as you, so it's not the base image.

I added libnfc and libfreefare and libsb-1.0-dev. I doubt they play into it, but i could try a build without them and see if that's it. of course if they are, I have a larger problem, as the ndef lib won't work without them. But at least I'll know.

Yeah, the 2.7.3 thing flummoxed me too. I wonder if maybe that error is a red herring.

Either way, thanks for your attention to this. I'll try a build without the nfc libs and see what happens, and report if I make progress.

Thanks!

t.

On Jul 26, 2013, at 3:50 PM, fivdi [email protected] wrote:

I tried the following on the BeagleBone (white, not black!)

Created a new SD card with Ångström from 2013.06.17 (http://downloads.angstrom-distribution.org/demo/beaglebone/)
After booting with the new SD card, executed the commands: opkg update opkg install python-compiler
Downloaded the ZIP file for your GettingStartedWithNFC repository to the BeagleBone and unzipped it
Did a cd to directory NodeTagToLedPi
Executed the commad: npm update
Everything worked correctly and onoff compiled successfully.

The following part of the error you're getting is very unusual:

gyp ERR! stack Error: Python executable "python" is v2.7.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:118:14)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:107:9

Here's a snippet of code from configure.js:

if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) {
getNodeDir()
} else {
failPythonVersion(version) // <-- configure.js line 107
}
version is '2.7.3' when this code is executed. I'd be very surprised if the semver module has an issue in its gte or lt functions.

I'm not sure, but I think something may be messed up on your system.


Reply to this email directly or view it on GitHub.

from onoff.

tigoe avatar tigoe commented on July 22, 2024

So the mystery deepens. I did a fresh install from the latest BeagleBone Black image: (2016-06-20, found here: http://beagleboard.org/latest-images) and followed the exact same steps you did. I left out the other libraries in my previous build to make sure it wasn't them. Got the same result I did before, with the mysterious 2.7.3 error. Tried setting the Python flag to 2.7, with no luck. Which makes me wonder if something changed in the BBB build from 2013.06.17 to 2013.06.20. I'll check on that.

from onoff.

fivdi avatar fivdi commented on July 22, 2024

So, tried with 2013.06.20 and everything worked fine on the BeagleBone. The output is down below.

Perhaps something is wrong with semver, or the python version information.

Check the python version information first. If you run the following command do you get the exact same output?

root@dhcppc3:~# python -c "import platform; print(platform.python_version());" | od -a
0000000 2 . 7 . 3 nl
0000006

If the correct version information is displayed then maybe there is an issue in semver. The problem you are having occurs in configure.js so you could modify it. Here are lines 104 through 108 of configure.js:

  if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) {
    getNodeDir()
  } else {
    failPythonVersion(version)
  }

Replace all five lines with the following one:

  getNodeDir();

The full path for configure.js is: /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js

root@dhcppc3:/nfc# ls -la
total 45860
drwxr-xr-x 3 root root 4096 Jul 28 19:01 .
drwxr-xr-x 4 root root 4096 Jul 28 19:00 ..
drwxrwxrwx 29 root root 4096 Jul 28 19:01 GettingStartedWithNFC-master
-rw-rw-r-- 1 root root 46947319 Jul 26 18:51 GettingStartedWithNFC-master.zip
root@dhcppc3:
/nfc# cd GettingStartedWithNFC-master
root@dhcppc3:/nfc/GettingStartedWithNFC-master# ls -la
total 124
drwxrwxrwx 29 root root 4096 Jul 28 19:01 .
drwxr-xr-x 3 root root 4096 Jul 28 19:01 ..
-rw-r--r-- 1 root root 40 Jul 28 19:01 .gitignore
drwxrwxrwx 6 root root 4096 Jul 28 19:01 BumpFinder
drwxrwxrwx 6 root root 4096 Jul 28 19:01 FileSender
drwxrwxrwx 6 root root 4096 Jul 28 19:01 FoursquareCheckin
drwxrwxrwx 6 root root 4096 Jul 28 19:01 FoursquareCheckinAdvanced
drwxrwxrwx 6 root root 4096 Jul 28 19:01 Handover
drwxrwxrwx 2 root root 4096 Jul 28 19:01 HotelNodeApp
drwxrwxrwx 2 root root 4096 Jul 28 19:01 HotelTagReader
drwxrwxrwx 2 root root 4096 Jul 28 19:01 HotelTagWriter
drwxrwxrwx 6 root root 4096 Jul 28 19:01 HueSwitch
drwxrwxrwx 6 root root 4096 Jul 28 19:01 MimeReader
drwxrwxrwx 6 root root 4096 Jul 28 19:01 MimeWriter
drwxrwxrwx 6 root root 4096 Jul 28 19:01 MoodSetter
drwxrwxrwx 6 root root 4096 Jul 28 19:01 MultiMimeListener
drwxrwxrwx 6 root root 4096 Jul 28 19:01 MusicPlayer
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeNdefBasics
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeNdefReaderWriter
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeNdefWeb
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeNdefWriterWeb
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeTagToLed
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeTagToLedPi
drwxrwxrwx 2 root root 4096 Jul 28 19:01 NodeWebTagReader
drwxrwxrwx 6 root root 4096 Jul 28 19:01 P2P
-rw-r--r-- 1 root root 342 Jul 28 19:01 README.md
drwxrwxrwx 2 root root 4096 Jul 28 19:01 SerialLed
drwxrwxrwx 6 root root 4096 Jul 28 19:01 hello
drwxrwxrwx 6 root root 4096 Jul 28 19:01 locator
drwxrwxrwx 6 root root 4096 Jul 28 19:01 ndefReader
drwxrwxrwx 6 root root 4096 Jul 28 19:01 nfcReader
root@dhcppc3:
/nfc/GettingStartedWithNFC-master# cd NodeTagToLedPi/
root@dhcppc3:/nfc/GettingStartedWithNFC-master/NodeTagToLedPi# ls -la
total 20
drwxrwxrwx 2 root root 4096 Jul 28 19:01 .
drwxrwxrwx 29 root root 4096 Jul 28 19:01 ..
-rw-r--r-- 1 root root 1987 Jul 28 19:01 index.js
-rw-r--r-- 1 root root 347 Jul 28 19:01 package.json
-rw-r--r-- 1 root root 211 Jul 28 19:01 suexport.js
root@dhcppc3:
/nfc/GettingStartedWithNFC-master/NodeTagToLedPi# cat package.json
{
"name": "NodeTagToLedPi",
"author": "username",
"version": "0.0.1",
"description": "Read a tag, light LEDs",
"main": "index.js",
"keywords": [
"NDEF",
"NFC",
"onoff"
],
"dependencies" : {
"mifare-classic": "0.0.1",
"ndef" : ">=0.0.4",
"onoff" : ">=0.1.6"
},
"engines": {
"node": ">=0.8"
}
}
root@dhcppc3:/nfc/GettingStartedWithNFC-master/NodeTagToLedPi# opkg update
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/base.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/machine/beaglebone/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/machine/beaglebone/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/beaglebone.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/debug/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/debug/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/debug.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/gstreamer/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/gstreamer/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/gstreamer.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/all/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/no-arch.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/perl/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/perl/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/perl.
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/Packages.gz.
Inflating http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/python.
root@dhcppc3:
/nfc/GettingStartedWithNFC-master/NodeTagToLedPi# opkg install python-compiler
Installing python-compiler (2.7.3-r0.3.6) to root...
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/python-compiler_2.7.3-r0.3.6_armv7a-vfp-neon.ipk.
Configuring python-compiler.
root@dhcppc3:~/nfc/GettingStartedWithNFC-master/NodeTagToLedPi# npm update
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/mifare-classic/0.0.1
npm http GET https://registry.npmjs.org/ndef
npm http GET https://registry.npmjs.org/onoff
npm http 200 https://registry.npmjs.org/ndef
npm http GET https://registry.npmjs.org/ndef/-/ndef-0.0.4.tgz
npm http 200 https://registry.npmjs.org/mifare-classic/0.0.1
npm http GET https://registry.npmjs.org/mifare-classic/-/mifare-classic-0.0.1.tgz
npm http 200 https://registry.npmjs.org/onoff
npm http GET https://registry.npmjs.org/onoff/-/onoff-0.1.6.tgz
npm http 200 https://registry.npmjs.org/ndef/-/ndef-0.0.4.tgz
npm http 200 https://registry.npmjs.org/onoff/-/onoff-0.1.6.tgz
npm http 200 https://registry.npmjs.org/mifare-classic/-/mifare-classic-0.0.1.tgz
npm http GET https://registry.npmjs.org/ndef/0.0.4
npm http GET https://registry.npmjs.org/onoff/0.1.6
npm http 200 https://registry.npmjs.org/onoff/0.1.6
npm http 200 https://registry.npmjs.org/ndef/0.0.4
npm http GET https://registry.npmjs.org/ndef/-/ndef-0.0.4.tgz
npm http GET https://registry.npmjs.org/onoff/-/onoff-0.1.6.tgz
npm http 200 https://registry.npmjs.org/onoff/-/onoff-0.1.6.tgz
npm http 200 https://registry.npmjs.org/ndef/-/ndef-0.0.4.tgz

[email protected] install /home/root/nfc/GettingStartedWithNFC-master/NodeTagToLedPi/node_modules/onoff
node-gyp rebuild

[email protected] node_modules/mifare-classic
└── [email protected]
[email protected] node_modules/ndef
gyp http GET http://nodejs.org/dist/v0.8.22/node-v0.8.22.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.22/node-v0.8.22.tar.gz
make: Entering directory /home/root/nfc/GettingStartedWithNFC-master/NodeTagToLedPi/node_modules/onoff/build' CXX(target) Release/obj.target/gpiowatcher/src/gpiowatcher.o SOLINK_MODULE(target) Release/obj.target/gpiowatcher.node SOLINK_MODULE(target) Release/obj.target/gpiowatcher.node: Finished COPY Release/gpiowatcher.node make: Leaving directory/home/root/nfc/GettingStartedWithNFC-master/NodeTagToLedPi/node_modules/onoff/build'
[email protected] node_modules/onoff
root@dhcppc3:~/nfc/GettingStartedWithNFC-master/NodeTagToLedPi#

from onoff.

tigoe avatar tigoe commented on July 22, 2024

Turns out the change you mentioned did it, and I confirmed with Jason that there is a bug in server, so that solved it.

One other thing, if you want to control the on-board LEDs on the BBB, you can't do it with onoff, because they require a different fs call, see https://github.com/jadonk/bonescript/blob/master/node_modules/bonescript/index.js lines 123 and following for a solution.

Thanks much!

from onoff.

fivdi avatar fivdi commented on July 22, 2024

Well, at least it compiles now!

onoff is intended for usage with GPIOs followings the access conventions described here: https://www.kernel.org/doc/Documentation/gpio.txt. The on-board user LEDs on the BB and BBB don't fall under this category.

from onoff.

fivdi avatar fivdi commented on July 22, 2024

Maybe a bit too late for @tigoe, but if you want to control on-board LEDs that can be controlled the led module can be used.

from onoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.