Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
3,498 Views

Intel XDK

hello everybody,

I return again this week because now my card captures the wifi but for me it impossible to run a project with Intel xdk you and I make a copy of what he said:

q@1.4.1 ..\..\..\Users\viann\Documents\lcd\node_modules\qtransferring C:\Users\viann\AppData\Local\Temp\xdk-93363d8jc0g.tar from project to board

x icon.png

x lcd.js

x main.js

x package.json

x README.md

x xdk/project-info.json

transferring C:\Users\viann\AppData\Local\Temp\xdk-9336aod2zio.tar from project to board

x q/CHANGES.md

x q/LICENSE

x q/package.json

x q/q.js

x q/queue.js

x q/README.md

q@1.4.1 /home/root/.node_app_slot/node_modules/q

build complete

Upload Complete

Not auto starting by request

UPLOADING: Uploading project bundle to IoT device.

[ Upload Complete ]ERROR: module.js:355

Module._extensions[extension](this, filename);

^

Error: Module did not self-register.

at Error (native)

at Module.load (module.js:355:32)

at Function.Module._load (module.js:310:12)

at Module.require (module.js:365:17)

at require (module.js:384:17)

at Object. (/home/root/.node_app_slot/main.js:21:12)

at Module._compile (module.js:460:26)

at Object.Module._extensions..js (module.js:478:10)

at Module.load (module.js:355:3...

12 Replies
Highlighted
Employee
38 Views

Hi vianney,

Are you using the XDK IDE 2571?

Which image are you using?

Could you attach the code you are using?

Are you able to run the blink example on the XDK?

Regards,

Charlie

Highlighted
New Contributor I
38 Views

hey Charlie,

I use version 2571 intel xdk

the image is the last that is to say 2.1

 

Here is the code to blink :

 

/*jslint node:true, vars:true, bitwise:true, unparam:true */

 

/*jshint unused:true */

/*

 

A simple node.js application intended to blink the onboard LED on the Intel based development boards such as the Intel(R) Galileo and Edison with Arduino breakout board.

MRAA - Low Level Skeleton Library for Communication on GNU/Linux platforms

 

Library in C/C++ to interface with Galileo & other Intel platforms, in a structured and sane API with port nanmes/numbering that match boards & with bindings to javascript & python.

Steps for installing MRAA & UPM Library on Intel IoT Platform with IoTDevKit Linux* image

 

Using a ssh client:

 

1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

 

2. opkg update

 

3. opkg upgrade

Article: https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates

 

*/

var mraa = require('mraa'); //require mraa

 

console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the Intel XDK console

//var myOnboardLed = new mraa.Gpio(3, false, true); //LED hooked up to digital pin (or built in pin on Galileo Gen1)

 

var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13 (or built in pin on Intel Galileo Gen2 as well as Intel Edison)

 

myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output

 

var ledState = true; //Boolean to hold the state of Led

periodicActivity(); //call the periodicActivity function

function periodicActivity()

 

{

 

myOnboardLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)

 

ledState = !ledState; //invert the ledState

 

setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)

 

} !

Here is the error message after you try to deploy blink :

 

Intel XDK - IoT App Daemon v0.0.37 - commands: run, list, debug, status

Upload on board is not from current project - uploading complete project

No NPM modules found.

transferring C:\Users\viann\AppData\Local\Temp\xdk-117602nvyz00.tar from project to board

x icon.png

x main.js

x package.json

x README.md

x xdk/project-info.json

Upload Complete

Not auto starting by request

ERROR: module.js:355

and there is also that before he told me all the time meter of the date and time a day <spa...

Highlighted
New Contributor I
38 Views

Hi,

Here is more information in order to try and resolve my concern continuing to search I try to do the project blink on another computer with the Intel version of xdk 2170 the project here:

/*jslint node:true, vars:true, bitwise:true, unparam:true */

 

/*jshint unused:true */

/*

 

A simple node.js application intended to blink the onboard LED on the Intel based development boards such as the Intel(R) Galileo and Edison with Arduino breakout board.

MRAA - Low Level Skeleton Library for Communication on GNU/Linux platforms

 

Library in C/C++ to interface with Galileo & other Intel platforms, in a structured and sane API with port nanmes/numbering that match boards & with bindings to javascript & python.

Steps for installing MRAA & UPM Library on Intel IoT Platform with IoTDevKit Linux* image

 

Using a ssh client:

 

1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

 

2. opkg update

 

3. opkg upgrade

Article: https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates

 

*/

var mraa = require('mraa'); //require mraa

 

console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the Intel XDK console

//var myOnboardLed = new mraa.Gpio(3, false, true); //LED hooked up to digital pin (or built in pin on Galileo Gen1)

 

var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13 (or built in pin on Intel Galileo Gen2 as well as Intel Edison)

 

myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output

 

var ledState = true; //Boolean to hold the state of Led

periodicActivity(); //call the periodicActivity function

function periodicActivity()

 

{

 

myOnboardLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)

 

ledState = !ledState; //invert the ledState

 

setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)

 

}

the project still does not want to start, here is the error message:

New System Time: Thu Jan 14 2016 00:41:46 GMT+0000 (UTC)

UPLOADING: Uploading project bundle to IoT device.

[ Upload Complete ]

|================================================================

| Intel (R) IoT - NPM Install - (may take several minutes)

|================================================================

UPLOADING: Uploading project bundle to IoT device.

npm WARN package.json OnboardLEDBlink@0.0.0 No repository field.

|================================================================

| NPM INSTALL COMPLETE![ 0 ] [ 0 ]

|================================================================

[ Upload Complete ]

|================================================================

| Intel (R) IoT - NPM Install - (may take several minutes)

|================================================================

UPLOADING: Uploading project bundle to IoT device.

[ Upload Complete ]npm WARN package.json OnboardLEDBlink@0.0.0 No repository field.

|================================================================

| NPM INSTALL COMPLETE![ 0 ] [ 0 ]

|================================================================

ERROR: module.js:355 ...

Highlighted
Employee
38 Views

Hi vianney,

I suggest you to use the 2571 XDK version.

After running configure_edison --version you should have as result 159 or 159.devkit

The /etc/opkg/iotkit.conf file should have the following content:

src iotkit http://iotdk.intel.com/repos/2.0/intelgalactic http://iotdk.intel.com/repos/2.0/intelgalactic

src iotdk-all http://iotdk.intel.com/repos/2.0/iotdk/all http://iotdk.intel.com/repos/2.0/iotdk/all

src iotdk-i586 http://iotdk.intel.com/repos/2.0/iotdk/core2-32 http://iotdk.intel.com/repos/2.0/iotdk/core2-32

src iotdk-quark http://iotdk.intel.com/repos/2.0/iotdk/core2-32-intel-common http://iotdk.intel.com/repos/2.0/iotdk/core2-32-intel-common

src iotdk-x86 http://iotdk.intel.com/repos/2.0/iotdk/intel_core2_32 http://iotdk.intel.com/repos/2.0/iotdk/intel_core2_32

The /etc/opkg/base-feeds.conf file should be empty or with:

src/gz all http://repo.opkg.net/edison/repo/all http://repo.opkg.net/edison/repo/all

src/gz edison http://repo.opkg.net/edison/repo/edison http://repo.opkg.net/edison/repo/edison

src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32 http://repo.opkg.net/edison/repo/core2-32

Then run the commands:

opkg update

opkg install mraa

opkg install upm

This will install the latest version of these libraries and you should have been able to run the code with the XDK.

Try also with selecting the options:

Manage your daemon/IoT application > Sync time w/clock on target device

Manage your daemon/IoT application > Update Libraries on board

Regards,

Charlie

Highlighted
Employee
38 Views

Hi vianney,

Do you have updates on this? Have you been able to use the XDK?

Regards,

Charlie

0 Kudos
Highlighted
New Contributor I
38 Views

hey,

I'm sorry, I had not seen the previous answer ...

alor here's what I did:

Poky (Yocto Project Reference Distro) 1.7.2 vianney ttyMFD2

vianney login: root

 

Password:

 

root@vianney:~# configure_edison--version

 

-sh: configure_edison--version: command not found

 

root@vianney:~# configure_edison --version

 

159.devkit

 

root@vianney:~# /etc/opkg/iotkit.conf

 

-sh: /etc/opkg/iotkit.conf: Permission denied

 

root@vianney:~# /etc/opkg/iotkit.conf

 

-sh: /etc/opkg/iotkit.conf: Permission denied

 

root@vianney:~# /etc/opkg/base-feeds.conf

 

-sh: /etc/opkg/base-feeds.conf: Permission denied

 

root@vianney:~# sudo /etc/opkg/base-feeds.conf

 

-sh: sudo: command not found

 

root@vianney:~#

permission denied what?

 

Regards,

 

Vianney

 

0 Kudos
Highlighted
New Contributor I
38 Views

hey,

I just start eg temperature, I plug the temperature sensor on A0, and run the program:

/*jslint node:true,vars:true,bitwise:true,unparam:true */

/*jshint unused:true */

/*

 

The Local Temperature Node.js sample application distributed within Intel® XDK IoT Edition under the IoT with Node.js Projects project creation option showcases how to read analog data from a Grover Starter Kit Plus – IoT Intel® Edition Temperature Sensor, start a web server and communicate wirelessly using WebSockets.

MRAA - Low Level Skeleton Library for Communication on GNU/Linux platforms

 

Library in C/C++ to interface with Galileo & other Intel platforms, in a structured and sane API with port nanmes/numbering that match boards & with bindings to javascript & python.

Steps for installing MRAA & UPM Library on Intel IoT Platform with IoTDevKit Linux* image

 

Using a ssh client:

 

1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

 

2. opkg update

 

3. opkg upgrade

Article: https://software.intel.com/en-us/html5/articles/iot-local-temperature-nodejs-and-html5-samples https://software.intel.com/en-us/html5/articles/iot-local-temperature-nodejs-and-html5-samples

 

*/

var B = 3975;

 

var mraa = require("mraa");

//GROVE Kit A0 Connector --> Aio(0)

 

var myAnalogPin = new mraa.Aio(0);

/*

 

Function: startSensorWatch(socket)

 

Parameters: socket - client communication channel

 

Description: Read Temperature Sensor and send temperature in degrees of Fahrenheit every 4 seconds

 

*/

 

function startSensorWatch(socket) {

 

'use strict';

 

setInterval(function () {

 

var a = myAnalogPin.read();

 

console.log("Analog Pin (A0) Output: " + a);

 

//console.log("Checking....");

 

 

var resistance = (1023 - a) * 10000 / a; //get the resistance of the sensor;

 

//console.log("Resistance: "+resistance);

 

var celsius_temperature = 1 / (Math.log(resistance / 10000) / B + 1 / 298.15) - 273.15;//convert to temperature via datasheet ;

 

//console.log("Celsius Temperature "+celsius_temperature);

 

var fahrenheit_temperature = (celsius_temperature * (9 / 5)) + 32;

 

console.log("Fahrenheit Temperature: " + fahrenheit_temperature);

 

socket.emit("message", fahrenheit_temperature);

 

}, 4000);

 

}

console.log("Sample Reading Grove Kit Temperature Sensor");

//Create Socket.io server

 

var http = require('http');

 

var app = http.createServer(function (req, res) {

 

'use strict';

 

res.writeHead(200, {'Content-Type': 'text/plain'});

 

res.end('Hello world from Intel IoT platform!');

 

}).listen(1337);

 

var io = require('socket.io')(app);

//Attach a 'connection' event handler to the server

 

io.on('connection', function (socket) {

 

'use strict';

 

console.log('a user connected');

 

//Emits an event along with a message

 

socket.emit('connected', 'Welcome');

//Start watching Sensors connected to Galileo board

 

startSensorWatch(socket);

//Attach a 'disconnect' event handler to the socket

 

socket.on('disconnect', function () {

 

console.log('user disconnected');

 

});

 

});

but here is what I:

socket.io@1.4.4 ..\..\..\Users\viann\Documents\temprature\node_modules\socket.io

├── has-binary@0.1.7 (isarray@0.0.1)

├── debug@2.2.0 (ms@0.7.1)

├── socket.io-parser@2.2.6 (isarray@0.0.1, component-emitter@1.1.2, json3@3.3.2, benchmark@1.0.0)

├── engine.io@1.6.7 (base64id@0.1.0, ws@1.0.1, engine.io-parser@1.2.4, accepts@1.1.4)

├── socket.io-adapter@0.4.0 (socket.io-parser@2.2.2)

└── socket.io-client@1.4.4 (indexof@0.0.1, to-array@0.1.3, component-emitter@1.2.0, backo2@1.0.2, object-component@0.0.3, component-bind@1.0.0, parseuri@0.0.4, socket.io-parser@2.2.5, engine.io-client@1.6.7)transferri

ng C:\Users\viann\AppData\Local\Temp\xdk-588419je0s0.tar from project to board

x icon.png

x main.js

x package.json

x README....

0 Kudos
Highlighted
New Contributor I
38 Views

Now if I make a test with blink:

/*jslint node:true, vars:true, bitwise:true, unparam:true */

 

/*jshint unused:true */

/*

 

A simple node.js application intended to blink the onboard LED on the Intel based development boards such as the Intel(R) Galileo and Edison with Arduino breakout board.

MRAA - Low Level Skeleton Library for Communication on GNU/Linux platforms

 

Library in C/C++ to interface with Galileo & other Intel platforms, in a structured and sane API with port nanmes/numbering that match boards & with bindings to javascript & python.

Steps for installing MRAA & UPM Library on Intel IoT Platform with IoTDevKit Linux* image

 

Using a ssh client:

 

1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

 

2. opkg update

 

3. opkg upgrade

Article: https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates https://software.intel.com/en-us/html5/articles/intel-xdk-iot-edition-nodejs-templates

 

*/

var mraa = require('mraa'); //require mraa

 

console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the Intel XDK console

//var myOnboardLed = new mraa.Gpio(3, false, true); //LED hooked up to digital pin (or built in pin on Galileo Gen1)

 

var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13 (or built in pin on Intel Galileo Gen2 as well as Intel Edison)

 

myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output

 

var ledState = true; //Boolean to hold the state of Led

periodicActivity(); //call the periodicActivity function

function periodicActivity()

 

{

 

myOnboardLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)

 

ledState = !ledState; //invert the ledState

 

setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)

 

}

the whole is good and its progress :

 

Intel XDK - IoT App Daemon v0.0.37 - commands: run, list, debug, status

Upload on board is not from current project - uploading complete project

No NPM modules found.

transferring C:\Users\viann\AppData\Local\Temp\xdk-4848e9tttls.tar from project to board

x icon.png

x main.js

x package.json

x README.md

x xdk/project-info.json

Upload Complete

Not auto starting by request

...
0 Kudos
Highlighted
Employee
38 Views

Hi vianney,

In order to check the content of the file you have to run the commands cat /etc/opkg/base-feeds.conf and cat /etc/opkg/iotkit.conf. Remember that you don't have and don't need sudo because you are already logged as the root user.

I'm guessing you are using the Local Temperature example on the XDK, this example allows you to create a webserver and send data through WebSockets, for more information about this example check the README.md file on the project.

If you want to see the data from the sensor on the console of the XDK IDE, take out the code from the function startSensorWatch(), you can use the following code:

var B = 3975;

var mraa = require("mraa");

var myAnalogPin = new mraa.Aio(0);

var a = myAnalogPin.read();

console.log("Analog Pin (A0) Output: " + a);

var resistance = (1023 - a) * 10000 / a; //get the resistance of the sensor;

//console.log("Resistance: "+resistance);

var celsius_temperature = 1 / (Math.log(resistance / 10000) / B + 1 / 298.15) - 273.15;//convert to temperature via datasheet ;

//console.log("Celsius Temperature "+celsius_temperature);

var fahrenheit_temperature = (celsius_temperature * (9 / 5)) + 32;

console.log("Fahrenheit Temperature: " + fahrenheit_temperature);

Regards,

Charlie

0 Kudos
Highlighted
New Contributor I
38 Views

hey charlie,

Thank you for the answer, so I just did the tests, here is what happens:

vianney login: root

Password:

root@vianney:~# cat /etc/opkg/base-feeds.conf

src/gz all http://repo.opkg.net/edison/repo/all/ http://repo.opkg.net/edison/repo/all/

src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32/ http://repo.opkg.net/edison/repo/core2-32/

src/gz edison http://repo.opkg.net/edison/repo/edison/ http://repo.opkg.net/edison/repo/edison/

root@vianney:~# cat /etc/opkg/iotkit.conf

src iotkit http://iotdk.intel.com/repos/2.0/intelgalactic http://iotdk.intel.com/repos/2.0/intelgalactic

root@vianney:

I think he lacks, how to install?

 

Regards,

 

Vianney

 

0 Kudos
Highlighted
Employee
38 Views

Hi vianney,

Did the code work for you?

Regarding the content on the .conf files, you shouldn't be worry about this unless you want to install a package from that repository. You already have the 0.9.0 MRAA version so you don't need to update it.

If you want to update the conf file you can copy and paste the following content in the iotkit.conf by using vi.

src iotkit http://iotdk.intel.com/repos/2.0/intelgalactic http://iotdk.intel.com/repos/2.0/intelgalactic

src iotdk-all http://iotdk.intel.com/repos/2.0/iotdk/all http://iotdk.intel.com/repos/2.0/iotdk/all

src iotdk-i586 http://iotdk.intel.com/repos/2.0/iotdk/core2-32 http://iotdk.intel.com/repos/2.0/iotdk/core2-32

src iotdk-quark http://iotdk.intel.com/repos/2.0/iotdk/core2-32-intel-common http://iotdk.intel.com/repos/2.0/iotdk/core2-32-intel-common

src iotdk-x86 http://iotdk.intel.com/repos/2.0/iotdk/intel_core2_32 http://iotdk.intel.com/repos/2.0/iotdk/intel_core2_32

Regards,

Charlie

0 Kudos
Highlighted
New Contributor I
38 Views

hi charlie,

I just execute the code:

var B = 3975;

var mraa = require("mraa");

var myAnalogPin = new mraa.Aio(0);

var a = myAnalogPin.read();

console.log("Analog Pin (A0) Output: " + a);

var resistance = (1023 - a) * 10000 / a; //get the resistance of the sensor;

//console.log("Resistance: "+resistance);

var celsius_temperature = 1 / (Math.log(resistance / 10000) / B + 1 / 298.15) - 273.15;//convert to temperature via datasheet ;

//console.log("Celsius Temperature "+celsius_temperature);

var fahrenheit_temperature = (celsius_temperature * (9 / 5)) + 32;

console.log("Fahrenheit Temperature: " + fahrenheit_temperature);

and it works

Intel XDK - IoT App Daemon v0.0.37 - commands: run, list, debug, status

Upload on board is not from current project - uploading complete project

No NPM modules found.

transferring C:\Users\viann\AppData\Local\Temp\xdk-12652v06jkkg.tar from project to board

x icon.png

x main.js

x package.json

x README.md

x xdk/project-info.json

Upload Complete

Not auto starting by request

Analog Pin (A0) Output: 379

Fahrenheit Temperature: 56.47521534482727

Analog Pin (A0) Output: 481

Fahrenheit Temperature: 72.23642911081114

<p style="font-family: Menlo, 'De...
0 Kudos