Zápisník experimentátora
Hierarchy: Orange Pi
In this article, we'll install the Node.js on Orange Pi Zero. This program allows you to create server applications using Javascript. That's exactly what we want to do with Orange Pi Zero. Create a simple server to which we connect using Arduino or ESP8266.
We will need the following components:
Node.js can be found on this homepage. From the site, you can install the development environment directly to your computer, and there are a few tutorials to help you get into the issue. Javascript syntax is very similar to C++, therefore, for you to understand the examples should not be harder than writing the programs for Arduino.
Armbian is an operating system derived from Debian distribution. Therefore, we will use the description in the installation manual of the Node.js. Connect via SSH to your Orange Pi Zero and type the following two lines in the console. This will install Node.js version 6.X.
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
You can also install the most up-to-date version of 8.X.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
The current version of your installed Node.js and npm
package, you'll find using commands.
node -v
npm -v
It is a tradition that every language has its Hello world
. You can also use my examples.
git clone https://github.com/roboulbricht/node.js-tests
ls
cd Node.js-tests
cd 01-hello-world-http
npm install
node hello.js
Then connect with your browser to http://192.168.0.73:3000/
(replace your IP address with your Orange Pi Zero address) and see the result. Armbian, by default, allows access to any port, so you will immediately see the result.
24.09.2017