Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,813 Views

Using Johnny Five with Galileo

Hi,

I have been trying to run my hello-worlds.js file on my intel Galileo (shown below):

var five = require("johnny-five");

var Galileo = require("galileo-io");

var board = new five.Board({

io: new Galileo()

});

board.on("ready", function() {

var led = new five.Led(13);

led.blink(500);

});

I have installed Node.js, I also used npm install galileo-io johnny-five and downloaded files to my file directory of folder my-robotics-project.

When i execute using node hello-worlds.js, I get the following error:

This OS image is no longer supported.

Please upgrade to any OS image that supports libmraa0.

--------------------------------

/Users/anna/Desktop/Bucky/node_modules/galileo-io/lib/index.js:48

var platformType = Pin.IO.getPlatformType();

^

TypeError: Cannot read property 'getPlatformType' of undefined

at Object. (/Users/anna/Desktop/Bucky/node_modules/galileo-io/lib/index.js:48:26)

at Module._compile (module.js:570:32)

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

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

at tryModuleLoad (module.js:446:12)

at Function.Module._load (module.js:438:3)

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

at require (internal/module.js:20:19)

at Object. (/Users/anna/Desktop/Bucky/index.js:2:15)

at Module._compile (module.js:570:32)

0 Kudos
21 Replies
idata
Community Manager
64 Views

Hi Anna,

 

 

Thanks for your interest in the Intel® Galileo Platform.

 

 

I have installed Johnny-five and Galileo-io, then I ran the example you have shared and I didn't get any error message, so I'd like to share you this link: https://github.com/rwaldron/johnny-five/issues/678 https://github.com/rwaldron/johnny-five/issues/678, there you will find a discussion about an issue similar to the one you are getting, please take a look at the discussion and try the suggestions.

 

 

Also, I would like to know the output of this commands:
  • uname –a
  • npm list --depth=0

 

Hope this information helps and I'll be waiting for your reply.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
64 Views

Thanks, but unfortunately my laptop was broken, wo I'll try to do it after several days.

Also, please, provide me a link with the most actual Yocto image.

Is it okey to use 4GB SD card for Galileo?

idata
Community Manager
64 Views

Hi Anna,

 

 

We're sorry to hear that.

In order to update your Galileo to the latest Linux image, we'd recommend you to follow the https://software.intel.com/en-us/get-started-galileo-windows Getting Started with the Intel® Galileo Board on Windows* (Method 2: Manual Process), there you will find instructions to update the image and make a bootable micro SD card. However, you can find the latest image here: https://software.intel.com/en-us/iot/hardware/galileo/downloads MicroSD* Card Image for Linux* Operating System, also, your 4GB SD card will work.

 

 

Hope this information helps, also, please let us know when you test it, we'll be waiting for your reply.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
64 Views

Hi, Yermi

 

 

May be I didn't understand the instruction from https://github.com/rwaldron/johnny-five/issues/678 https://github.com/rwaldron/johnny-five/issues/678 , but I have the same issue.

The output of this commands:

  • uname –a
  • npm list --depth=0

Cherenshchikovas-MacBook-Pro:~ anna$ uname -a

Darwin Cherenshchikovas-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0: Mon Aug 29 21:14:16 PDT 2016; root:xnu-2782.50.6~1/RELEASE_X86_64 x86_64

Cherenshchikovas-MacBook-Pro:~ anna$ npm list --depth=0

/Users/anna

├── galileo-io@0.10.0

└── johnny-five@0.10.6

Regards,

Anna

idata
Community Manager
64 Views

Hi Anna,

 

 

We would like to know if you were able to update your Galileo's image to the latest, since you have a Mac* OS X, these instructions might help you: https://software.intel.com/en-us/get-started-galileo-mac-step1 Getting Started with the Intel Galileo Board on Mac* OS X. Additionally, we would like to know the output from this command in the Galileo terminal after updating the image: uname –a, we are requesting it again because the output you posted is from your Mac and we need it from the Galileo.

 

 

We'll be waiting for your reply, also, if you have any other question, don't hesitate to ask.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
64 Views

Hi, Yermi

root@galileo:~# uname -a

Linux galileo 3.8.7-yocto-standard # 1 Thu May 12 08:17:14 PDT 2016 i586 GNU/Linux

Regards,

 

Anna

idata
Community Manager
64 Views

Hi Anna,

 

 

Thanks for the information provided. I'm using the same Linux image you are using, and I'm running your example without any issue. It is strange that you get that error.

 

 

I have followed these steps to install Johnny Five:
  1. Flashed the Galileo Board with the latest Linux Image

2. Installed nodejs and nodejs-nmp

  1. Added this repository with this command: echo "src npm http://iotdk.intel.com/repos/3.5/iotdk/galileo/i586/ http://iotdk.intel.com/repos/3.5/iotdk/galileo/i586/" > /etc/opkg/iotdk.conf
  2. opkg update
  3. opkg install nodejs
  4. opkg install nodejs-npm

3. Ran npm install galileo-io johnny-five

4. Then, I created a file named: johnny.js with the example you are trying to run

5. Ran the example: node johnny.js

 

 

It runs successfully, I'd recommend you to follow the previous steps in order to know if it can help to solve your issue. Please let me know if you have any questions.

 

 

Regards,

 

-Yermi A.
idata
Community Manager
64 Views

Hi Yermi,

Thanks for the instruction.

However, I had this error

Regards,

 

Anna
idata
Community Manager
64 Views

Hi Anna,

 

 

That is strange, I would like to know if your Galileo is connected to the internet correctly, to verify this, you can use the command ping, for example: ping google.com, in case your board is not connected, you could follow these steps: https://software.intel.com/en-us/get-started-galileo-windows-step4 Connect over Wi-Fi*.

 

 

Please check your internet connection, and let us know if that is the issue.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
64 Views

Hi Yermi,

I connected the board with computer via USB to 6-pin FTDI serial cable and Ethernet cable and tried to follow instruction https://software.intel.com/en-us/node/519952 IoT - Ethernet connectivity | Intel® Software .

 

Unfortunately, it was unsuccessful. Please, see below.

 

What did I do wrong?

Regards,

 

Anna
idata
Community Manager
64 Views

Hi Anna,

 

 

According to the link you shared if the Galileo is connected to a network or even to another computer that has Internet access, the system is capable of assigning an IP address automatically. On other occasions, when you need to have always the same IP address, you have to assign a static IP, for example, with these commands: $ systemctl stop connman and $ ip addr add 169.254.8.17/24 dev enp0s20f6 you are assigning a static IP address: 169.254.8.17/24.

 

 

Moreover, in our case we'd recommend to run this command systemctl start connman and then follow these instructions: http://download.intel.com/support/galileo/sb/intelgalileogettingstartedethernet.pdf Intel® Galileo: Getting Started – Ethernet. You could check the Internet connection using the ping command, check the image below that shows a successful connection:

 

 

Additionally, we would like to know more details about how you are connecting your Galileo to Internet through Ethernet.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
64 Views

Hi Anna,

 

 

We would like to if you have any updates.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
64 Views

Hi Yermi,

Sorry for the delay and thank you for you reply.

I followed all instruction and had successful setup network access to your Intel® Galileo Board and obtain an IP address.

 

Unfortunately, I couldn't ping google.com. After that I tried to ping ip board (successful), ping mail.ru (unsuccessful), ping ip google ( 4 packets transmitted, 0 packets received, 100% packet loss).

 

Please, see more detail from the terminal screen.

During ping I powered on your Galileo and plug in the Ethernet cable and used a 6 pin Serial to Type A USB cable (FTDI cable # TTL-232R-) to connect with a terminal program to your Galileo board.

Thanks,

 

Anna
idata
Community Manager
64 Views

Hi Anna,

Thanks for all the information provided. Please, run the following commands and let us know if it helps.

ifconfig enp0s20f6 down

 

ip link set enp0s20f6 name eth0

 

ifconfig eth0 up

Regards,

 

-Yermi A.
idata
Community Manager
64 Views

Hi Yermi,

Thanks for reply.

Unfortunately, it doesn't work too, please look at the print screen.

Regards,

 

Anna
idata
Community Manager
64 Views

Hi Anna,

It is very strange. The commands I provided previously are for changing the network interface name. This is what I did, my output from the command ifconfig:

root@galileo:~# ifconfig

 

enp0s20f6 Link encap:Ethernet HWaddr 98:4F:EE:05:4E:CA

 

inet addr:192.168.10.99 Bcast:192.168.10.255 Mask:255.255.255.0

 

inet6 addr: fe80::9a4f:eeff:fe05:4eca/64 Scope:Link

 

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

 

RX packets:318 errors:0 dropped:4 overruns:0 frame:0

 

TX packets:65 errors:0 dropped:0 overruns:0 carrier:0

 

collisions:0 txqueuelen:1000

 

RX bytes:40987 (40.0 KiB) TX bytes:11648 (11.3 KiB)

 

Interrupt:49 Base address:0x8000

 

 

lo Link encap:Local Loopback

 

inet addr:127.0.0.1 Mask:255.0.0.0

 

inet6 addr: ::1/128 Scope:Host

 

UP LOOPBACK RUNNING MTU:65536 Metric:1

 

RX packets:362 errors:0 dropped:0 overruns:0 frame:0

 

TX packets:362 errors:0 dropped:0 overruns:0 carrier:0

 

collisions:0 txqueuelen:0

 

RX bytes:29192 (28.5 KiB) TX bytes:29192 (28.5 KiB)

Also, I was getting the same issue as you:

root@galileo:~# ping -c 4 google.com

 

ping: bad address 'google.com'

So, I ran the previous commands and changed the interface name from enp0s20f6 to eth0:

root@galileo:~# ifconfig enp0s20f6 down

 

root@galileo:~# [ 983.444926] IPv6: ADDRCONF(NETDEV_UP): enp0s20f6: link is not ready

 

root@galileo:~# ip link set enp0s20f6 name eth0

 

root@galileo:~# ifconfig eth0 up

 

[ 1010.938186] eth0: device MAC address 98:4f:ee:05:4e:ca

 

[ 1010.971630] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

 

root@galileo:~# [ 1012.940231] libphy: stmmac-1:01 - Link is Up - 100/Full

 

[ 1012.945770] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

After that, I had access to internet:

root@galileo:~# ping google.com

 

PING google.com (173.194.214.113): 56 data bytes

 

64 bytes from 173.194.214.113: seq=0 ttl=46 time=71.829 ms

 

64 bytes from 173.194.214.113: seq=1 ttl=46 time=84.450 ms

 

64 bytes from 173.194.214.113: seq=2 ttl=46 time=98.263 ms

 

64 bytes from 173.194.214.113: seq=3 ttl=46 time=75.847 ms

Since the interface eth0 already appears on you Galileo, we'd suggest you to turn this interface down and then up:

ifconfig eth0 down

 

ifconfig eth0 up

Additionally, I'd recommend you to try using a different Ethernet cable and checking your internet connection.

Regards,

 

-Yermi A.
idata
Community Manager
64 Views

Hi Yermi,

Thanks a lot, finally I connected Galileo with the Internet and downloaded all and launched the code later.

root@galileo:~# npm list --depth=0

/home/root

├── galileo-io@0.10.0

└── johnny-five@0.10.6

I had troubles when I connected the board with computer, but when I connected it with a router, it worked.

Here is screenshot of network preferences when Galileo connected with laptop via Ethernet cable.

What can I do to fix it?

The Blink is an easiest example, but how can I develop and debug more complicated Johnny Five projects on Linux machine on Galileo?

Regards,

 

Anna

idata
Community Manager
64 Views

Hi Anna,

 

 

I'm glad to know that you were able to connect your Galileo to internet and use Johnny Five. Now, regarding your question about connecting the Galileo to internet using your laptop, you can take a look at https://support.apple.com/kb/PH18704?locale=en_US Share your Internet connection, and try those suggestions. Additionally, in this link: https://github.com/rwaldron/johnny-five https://github.com/rwaldron/johnny-five, you can find a lot of documentation and examples to Johnny-five.

 

 

Hope this information helps.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
64 Views

Hi Yermi,

Many thanks for the answer. I followed all steps from here https://support.apple.com/kb/PH18704?locale=en_US&viewlocale=en_US OS X Yosemite: Share your Internet connection, but it didn't help.

Also I need to change name of ethernet connection from enp0s20f6 to eth0 when I use the board every time. How can I set it up for every future session?

Regards,

 

Anna
idata
Community Manager
28 Views

Hi Anna,

 

 

Which IP address is assigned to your Galileo when it is connected to the router and which, when it is connected to your PC? Please provide a screenshot of the output of this command in both cases: ifconfig, also, we would like to know which IP address have your PC.

 

 

Regarding the your last question, you can create a script and then a system service that will run every time you turn on your Galileo, please take a look at the instruction here: /thread/112451 https://communities.intel.com/thread/112451 (those steps apply for the Galileo using the latest Linux image).

 

 

Regards,

 

-Yermi A.

 

Reply