The Orange Pi is an economical alternative to Raspberry Pi to build a Jeedom based 100% DIY home automation server. If you do not intend to use the GPIO to drive home automation accessories, Orange Pi is a very good solution. In the previous tutorial, we saw how to install Domoticz on the Armbian distribution. In this new tutorial, we will install Jeedom on an Orange Pi Lite. The Orange Pi Lite (presented in this article) is a mini computer card equipped with 512MB Ram. Less powerful than the Raspberry Pi 3, it also costs a lot cheaper (about €15 with postage). If you do not have many scenarios or if you start in home automation, this is an excellent choice (also for your wallet). If you need more power, you can opt for the Orange Pi+ 2e (presented in this article) equipped with 2GB of RAM and especially 16GB of memory eMMC, more reliable (and faster) than an SD card.
- 1 What Linux distribution to choose to install Jeedom on an Orange Pi?
- 2 Orange Pi Home Based Server Configuration
- 3 Install Jeedom on Orange Pi + 2e eMMC memory
- 4 Install Jeedom from the script
- 5 Access denied for user ‘root’ @ ‘localhost’ (using password: NO): the error of death!
- 6 Everything should end normally.
What Linux distribution to choose to install Jeedom on an Orange Pi?
The best way is to get as close as possible to the official distribution of the Raspberry Pi on which the Jeedom installation script is based (available on GitHub here). The distribution closest to Raspbian is Armbian. Attention, it is absolutely necessary to start from the server version which is based on Debian Jessie, the same as Raspbian. If you opt for the Desktop version, you will encounter major installation problems. The Desktop version is based on Ubuntu Xenial (16.04 LTS) for which libraries compiled for the ARMv7 processor that equips the OrangePi (Allwinner H3) are missing.
Note. Armbian is managed by the installation script in the same way as Docker and RPI (here).
If you want to use a graphical interface to use the Orange Pi for other activities, follow this tutorial which explains step by step how to install the XFCE4 desktop (the same one that is installed on the Desktop version).
Download the server distribution that corresponds to your Orange Pi and follow this tutorial to prepare the SD card, set up the Wi-Fi and keyboard in your language. After completing these operations, you will be able to continue installing Jeedom.
Orange Pi Home Based Server Configuration
Here are two configurations based on Orange Pi. The first solution based on Orange Pi Lite is the most economical solution. It is located between the Raspberry Pi 2 and the Raspberry Pi 3 in terms of gross power. Count less than 33 € to equip you. The second configuration built around the Orange Pi + 2nd is a little more expensive (about 47,80 €) but allows a power superior to the RPI3 and 16GB of memory eMMC. You will just need an 8GB or 16GB SD card to install Armbian on the eMMC flash memory. Given the difference in price (15 €), the Orange Pi + 2nd is an excellent choice.
|Orange Pi Lite||Orange Pi+ 2e|
|Power supply 5V – 3A
Ou un cable USB, environ 2,50€
|Power supply 5V – 3A
Ou un cable USB, environ 2,50€
|Carte SD 8Go classe 10||Carte SD 8Go classe 10 (Optionnel)
Juste le temps d’installer Armbian sur la mémoire eMMC
|Total (without case)||about €32,90||about €47,80|
Install Jeedom on Orange Pi + 2e eMMC memory
If you opt for the Orange Pi + 2e, before installing Jeedom, it is best to install the system on the eMMC flash memory. You can do this at any time. Start the system on the SD card. Identify yourself and run the following command
The images are taken from the presentation article of the Orange Pi + 2e, the questions will be identical. Accept
Select the file system
The formatting operation is very fast
The copy operation takes just over 30 minutes.
Installation is complete. Turn off the Orange and remove the SD card from the player. Turn on the Orange Pi + 2e. The system now starts on the eMMC memory.
Install Jeedom from the script
Now that everything is ready, we can launch the installation of Jeedom. There is virtually nothing to do because it’s the script that will take care of everything. The procedure is detailed in the official documentation (point 6 – other). Let’s take a few moments to analyze what the script will do. It is available on GitHub here.
The operation will take place in 11 steps:
- Step_1_upgrade: system update. This is the longest operation because Jeedom does an update and a dist-upgrade
- Step_2_mainpackage: installation of libraries
- Step_3_database: mysql installation and configuration. During this step, the password to the database will be displayed in the Terminal. It is a series of numbers and letters generated at random. Write it down. In case of a crash during the installation, it will allow you to easily resume it
- Step_4_apache: installing the apache web server
- Step_5_php: php installation
- Step_6_jeedom_download: downloads resources from Jeedom and decompresses the zip into /var/www/html
- Step_7_jeedom_customization: building the system
- Step_8_jeedom_configuration: Jeedom configuration. If the script has crashed before, the script will no longer be able to connect to the database because a new password will have been generated. The solution is given later in the article
- Step_9_jeedom_installation: run the php script install.php
- Step_10_jeedom_post: setting the cron table (scheduled executions)
- Step_11_jeedom_check: last check
Run these three commands to install Jeedom on your Orange Pi. The first command allows you to retrieve the installation script. We then render this script executable (chmod + x) before launching it.
wget https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh chmod +x install.sh ./install.sh
The installation time will greatly depend on the speed of your internet connection and the state of your system. If it is already up to date, the first step (which is the longest) will be very fast.
Access denied for user ‘root’ @ ‘localhost’ (using password: NO): the error of death!
If you encounter this message, it is probably because the script crashed during the installation. Even when re-running the script, it will not be able to skip step 8 (jeedom_configuration). Indeed, nothing is provided in the script to temporarily store the generated password and re-use it in the event of a crash. Do not panic, there is always a solution 🙂
It is possible to pass parameters to the install.sh script:
- -s (STEP): execute only the indicated step (from 1 to 11)
- -v (VERSION): install a particular version of Jeedom
- -w (WEBSERVER_HOME): change the default directory /var/www/html
- -z (INSTALL_ZWAVE_DEP): Install the dependencies for the ZWAVE. By default they are installed. Set to 0 if you do not want to install them
- -h (HTML_OUTPUT):
- -m (MYSQL_ROOT_PASSWD): MySQL password
You know the MySQL password
If you noted the password given in step 3, this is the ideal case. Restart the script with the -m PASSWORD parameter
./install.sh -m PASSWORD
Everything should end normally. To save some time, you can only perform the remaining steps by adding the -s parameter. It will be necessary to manually execute all the remaining steps successively so that the process of installation of Jeedom is completed completely.
You do not know the MySQL password
In this case you will have to put your hands in MySQL!
Edit the my.cnf configuration file. Normally, it is located in the /etc/mysql/ folder
Add the command skip-grant-tables (the position is not very important) which allows to start MySQL in safe mode and without password. Save with CTRL + X.
service mysql restart
Start MySQL Shell
mysql -u root
Select mysql database
mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql>
Just out of curiosity, let’s look at the list of users. The password field contains the password imprint.
mysql> select host,user,password from user; +--------------+------------------+-------------------------------------------+ | host | user | password | +--------------+------------------+-------------------------------------------+ | localhost | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | orangepilite | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | 127.0.0.1 | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | ::1 | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | localhost | debian-sys-maint | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | +--------------+------------------+-------------------------------------------+ 5 rows in set (0.00 sec) mysql>
Replace the YOUR_PASS key in the next update command.
mysql> update user set password=PASSWORD("YOUR_PASS") where User='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql>
You save the privileges
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql>
Exit MySQL Shell
mysql> quit; Bye root@orangepilite:~#
Go back to the MySQL configuration file and comment or delete the skip-grant-tables key. Save with CTRL + X and restart MySQL
service mysql restart
Restart the script with the -m PASSWORD parameter
./install.sh -m PASSWORD
Everything should end normally.
Using Jeedom on Orange Pi
Once the installation is complete, you can start using Jeedom as on a Raspberry Pi 3 (or other mini-PC). Here the list of installed packages from System Administration.
- Weather station with ePaper display (Dashboard) for Jeedom on Raspberry Pi (via the JSON RPC API)
- Install Jeedom v3 from the installation script on Raspberry Pi 3 (or Linux Debian 8 PC)
- Driving the ESP8266 GPIO (Web Server) from Jeedom to TCP / IP Wireless – Part 2
- ESP8266 (Web Client): Sending Data to Jeedom in TCP / IP Wireless (JSON API) – Part 1
- Install Jeedom on an Orange Pi Lite (or Orange Pi+ 2e) running under Armbian Jessie
- Jeedom + MQTT: associate a connected object DIY with the Dashboard