Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 755
» Latest member: MARTINBURRUTO
» Forum threads: 284
» Forum posts: 1,270

Full Statistics

Online Users
There are currently 11 online users.
» 0 Member(s) | 11 Guest(s)

Latest Threads
Getting PS3 controller wo...
Forum: Hardware compatibility
Last Post: florence
06-26-2017, 06:26 AM
» Replies: 21
» Views: 4,587
Resolution (?) issues
Forum: Solved threads (also check FAQ and HOWTOs)
Last Post: barrymossel
06-25-2017, 02:01 PM
» Replies: 4
» Views: 77
Whats new in new armbian?
Forum: General Discussion
Last Post: alexkidd
06-21-2017, 11:15 AM
» Replies: 1
» Views: 100
Where to buy Orange pi in...
Forum: General Discussion
Last Post: alexkidd
06-21-2017, 11:09 AM
» Replies: 1
» Views: 79
HOWTO install C library f...
Forum: HOWTOs
Last Post: alexkidd
06-19-2017, 11:34 AM
» Replies: 1
» Views: 198
Kodi Not Working on Orang...
Forum: Support area
Last Post: alexkidd
06-19-2017, 10:23 AM
» Replies: 14
» Views: 943
HOW TO - install Amiga em...
Forum: HOWTOs
Last Post: alexkidd
06-18-2017, 06:47 PM
» Replies: 1
» Views: 118
Connect bluetooth speaker...
Forum: Solved threads (also check FAQ and HOWTOs)
Last Post: alexkidd
06-18-2017, 06:39 PM
» Replies: 1
» Views: 100
New PC2
Forum: Hardware compatibility
Last Post: Lamerjack
06-16-2017, 07:46 AM
» Replies: 10
» Views: 2,056
Overclock.
Forum: General Discussion
Last Post: Lamerjack
06-16-2017, 07:43 AM
» Replies: 5
» Views: 700

 
  Resolution (?) issues
Posted by: barrymossel - 06-23-2017, 01:04 PM - Forum: Solved threads (also check FAQ and HOWTOs) - Replies (4)

I am using a HDMI-VGA adapter with my new OrangePi PC and a 19"1280x1024 HP monitor. The splash screen and EmulationStation scale well. Soms (MAME) games have a black border (about 1 cm) around the screen (all sides). That's weird because a RPi in the same setting doesn't. This is annoying, but I will manage. Some other games though (like Mortal Kombat) scale very weirdly (small) and the below part is cut off even. These ROMS work on a RPi2, full screen.

I tried sudo h3disp -m 33 but that results in very ugly text in EmulationStation, so I didn't even proceed.

I tried the OrangePi PC with a HD TV (19:6) over HDMI and that does work, so I suppose it has to do with the HDMI-VGA adapter. 

Can anyone help me, as now the OPi seems pretty much useless to me, as I need it to work with that particular screen.

Print this item

  Where to buy Orange pi in Europe?
Posted by: Lamerjack - 06-21-2017, 09:35 AM - Forum: General Discussion - Replies (1)

I need to buy one orange pi zero plus 2 H3 and orange Pi Win.
But i need invoice from europe. I know that the price will be higher...
Any suggestion?

Print this item

  Whats new in new armbian?
Posted by: Lamerjack - 06-21-2017, 09:32 AM - Forum: General Discussion - Replies (1)

What are improovment of new armbian?
I was reading on the notes: 


  • ‘Out of memory’ (OOM) issues are possible due to a kernel bug
That was present also in previus release...
Then i read legacy kernel...
And i have the same issue that my wifi stick is seen twice...
No i should not expect any improovment from new release?

Print this item

  HOWTO install C library for GPIO and Example Shutdown system with a GPIO button
Posted by: Spirax - 06-19-2017, 10:16 AM - Forum: HOWTOs - Replies (1)

Hi There.
This is my second HOWTO here 
Please read it complete before try, to understand what we are doing.
I am not responsible for any damage that could be caused on your system for a bad interpretaion of this guide or any issue.
this is for help others 

On this guide we will install the C library for GPIO WiringPI, updated to support our boards OPI.
After install the library we will see how to compile the examples and then how to create our own program to manage the GPIO.
note that this guide is a step by step to be understand by any users with any level of linux (from novice to expert) with detailed information to novices than experts will see like a brick  so please understand it and skip the extra info.

so we start
to follow this guide we need:
A OPI board connected to internet, keyboard and screen to go trough console or via ssh

open the console or ssh connection to your board and login as pi
I use the Downloads folder as base so after login go to it.

Code:
cd Downloads/

to install the library we need to download sources from github.com

Code:
git clone https://github.com/zhaolei/WiringOP.git -b h3

and we will see
some messages as is cloned and is created a new folder WiringOP

Cloning into 'WiringOP'...

remote: Counting objects: 355, done.
remote: Total 355 (delta 0), reused 0 (delta 0), pack-reused 355
Receiving objects: 100% (355/355), 284.36 KiB | 396.00 KiB/s, done.
Resolving deltas: 100% (189/189), done.
Checking connectivity... done.

so we move to the new folder
Code:
cd WiringOP/

we will do full installation as we are provided with an automatic install we will use it. Rolleyes
a custom install is also available read the INSTALL file on local folder.

Code:
sudo ./build

we will see a list of messages and finally all done and a final note

All Done.


NOTE: To compile programs with wiringBP v2, you need to add:
    -lwiringPi
  to your compile line(s) To use the Gertboard, MaxDetect, etc.
  code (the devLib), you need to also add:
    -lwiringPiDev
  to your compile line(s).

so now is installed, we are ready to test it Idea
in order to read the gpio we don't need to be root, and we can read all pins with

Code:
gpio readall

and if all was ok with the installation we should obatin somethink lke this (This is on my own OPI PC)

Code:
+-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
|  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
|  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
|   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT3 | TxD3     | 15  | 13  |
|     |     |       0v |      |   |  9 || 10 | 0 | ALT3 | RxD3     | 16  | 14  |
|   1 |   0 |     RxD2 | ALT3 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
|   0 |   2 |     TxD2 | ALT3 | 1 | 13 || 14 |   |      | 0v       |     |     |
|   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
|     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
|  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
|  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
|  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
|     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
|  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
|   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
|   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1     | 26  | 200 |
|   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
|  10 |  24 |  GPIO.24 | ALT3 | 0 | 35 || 36 | 0 | ALT3 | CTS1     | 27  | 201 |
|  20 |  25 |  GPIO.25 | ALT3 | 0 | 37 || 38 | 0 | ALT3 | TxD1     | 28  | 198 |
|     |     |       0v |      |   | 39 || 40 | 0 | ALT3 | RxD1     | 29  | 199 |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

if you obatin this lisk ,
congratulations you have installed the library and we are ready to continue with the provided examples. Tongue

Code:
cd examples/

in order to compile an example we have several options.
we can compile blink with the Makefile provided just using
Code:
make blink
this will generate the new program blink

but first we will read the file blink.c to understand what it will do , cat blink.c
Code:
cat blink.c
/* I have remove some commented lines to have this short */

#include <stdio.h>
#include <wiringPi.h>

// LED Pin - wiringPi pin 0 is BCM_GPIO 17.

#define LED     0

int main (void)
{
 printf ("Raspberry Pi blink\n") ;

 wiringPiSetup () ;
 pinMode (LED, OUTPUT) ;

 for (;;)
 {
   digitalWrite (LED, HIGH) ;  // On
   delay (500) ;               // mS
   digitalWrite (LED, LOW) ;   // Off
   delay (500) ;
 }
 return 0 ;
}

just pay atention to this lines
#define LED     0

where we are defining the led to use the WiringPI pin 0

if you go back and read again the exit from gpio readall
you will see than wiringPI 0 (wPi) is same as Phisical PIN 11 take a look on the mode and V for status Idea

Code:
+-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|   1 |   0 |     RxD2 | ALT3 | 0 | 11 ||    |   |      |          |     |     |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

now we are ready to test the program but as we don't hace connected a led, we will use the gpio readall to see if the pin change the status
in order to modify the GPIO we need to be root so it we execute our 1st example
Code:
./blink

we will obtain a error Huh
pi@RetrOrangePi:~/Downloads/WiringOP/examples$ ./blink
Raspberry Pi blink
wiringPiSetup: Must be root. (Did you forget sudo?)

so we will use sudo the execute it and as we want to have it running on blackgroung to see it works we will also add & at the end of our command, then we will be provided with a process number, please remember this number as we will needed it later.
Code:
sudo ./blink &

pi@RetrOrangePi:~/Downloads/WiringOP/examples$ sudo ./blink &
[1] 1928
pi@RetrOrangePi:~/Downloads/WiringOP/examples$ Raspberry Pi blink

you can see as I have been provided with number 1928 
this is the process number asigned for the system to this process, we will use later to kill the process if needed 

now that our blink is running we will read the gpio several times to see if there any difference, note that as this is intermitent may you will need to read several times to see the changes on realtime

1st attempt
Code:
gpio readall
+-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
|  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
|  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
|   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT3 | TxD3     | 15  | 13  |
|     |     |       0v |      |   |  9 || 10 | 0 | ALT3 | RxD3     | 16  | 14  |
|   1 |   0 |     RxD2 |  OUT | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
|   0 |   2 |     TxD2 | ALT3 | 1 | 13 || 14 |   |      | 0v       |     |     |
|   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
|     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
|  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
|  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
|  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
|     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
|  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
|   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
|   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1     | 26  | 200 |
|   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
|  10 |  24 |  GPIO.24 | ALT3 | 0 | 35 || 36 | 0 | ALT3 | CTS1     | 27  | 201 |
|  20 |  25 |  GPIO.25 | ALT3 | 0 | 37 || 38 | 0 | ALT3 | TxD1     | 28  | 198 |
|     |     |       0v |      |   | 39 || 40 | 0 | ALT3 | RxD1     | 29  | 199 |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

2nd attempt

Code:
gpio readall
+-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
|  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
|  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
|   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT3 | TxD3     | 15  | 13  |
|     |     |       0v |      |   |  9 || 10 | 0 | ALT3 | RxD3     | 16  | 14  |
|   1 |   0 |     RxD2 |  OUT | 1 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
|   0 |   2 |     TxD2 | ALT3 | 1 | 13 || 14 |   |      | 0v       |     |     |
|   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
|     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
|  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
|  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
|  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
|     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
|  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
|   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
|   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1     | 26  | 200 |
|   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
|  10 |  24 |  GPIO.24 | ALT3 | 0 | 35 || 36 | 0 | ALT3 | CTS1     | 27  | 201 |
|  20 |  25 |  GPIO.25 | ALT3 | 0 | 37 || 38 | 0 | ALT3 | TxD1     | 28  | 198 |
|     |     |       0v |      |   | 39 || 40 | 0 | ALT3 | RxD1     | 29  | 199 |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

did you see the difference? Huh

1st check the mode on Phisical pin 11
you will notice the difference from initial reading as pin is now OUT and value should alternate from 0 to 1 every 500 ms as per our blink example.

SO THATS WORKS Cool 

we are ready to compile our own program
Exclamation


as we are using the console or ssh, we will use vi as editor
if you are on a Xterm you can use any other graphic editor as pluma

if you don't know how to use vi, start with
man vi

some basic keys are
i -> where on command mode change to insert mode
esc -> where on insert mode return to command mode
: -> where on command mode change to execution mode
wq -> where on execution mode write our file and quit from vi
for a more extended keys please read the manual for vi (man vi)

so we will create our own file apagado.c with vi
Code:
vi apagado.c


and we will see a new file created on the vi  like this one


Code:
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"apagado.c" [Archivo nuevo]                                                       0,0-1        Todo

my system is on spanish so on the status bar you we wil see somethink like
" [New file] " instead [archivo nuevo]" 
we click on the key i and we will see as status bar changed to insert mode
--- INSERT ---

and we are ready to c and paste from this code
Code:
/* Apagado de la consoloa con el pin 25 by Spirax
*/

#include <stdio.h>
#include <wiringPi.h>

#define button_shutdown 25

int system(const char *command);

int main (void)
{
wiringPiSetup () ;
pinMode (button_shutdown, INPUT);
pullUpDnControl (button_shutdown, PUD_UP) ;

for (;;)
{ if (digitalRead (button_shutdown) == LOW) // boton pulsado = ejecutar shutdown
system("shutdown -h now");
sleep (1);
}
return 0 ;
}

now press the ESC key to return to command mode on vi
now press : to start the execution mode on vi
now write on the status bar
wq
to write and exit

and you will have the file apagado.c created on your folder ready to be compiled.
but 1st we will take a look on the source code
Code:
#include <wiringPi.h>

we are including the wiringPi library to use its functions


Code:
#define button_shutdown 25

we are using WiringPI 25 that is Phisycal pin 37

Code:
pinMode (button_shutdown, INPUT);

we stablish the pin mode as Input

Code:
pullUpDnControl (button_shutdown, PUD_UP) ;

we are starting the pin as UP

Code:
if (digitalRead (button_shutdown) == LOW)

we are continuosly checking on a loop if the Pin Change to LOW and ejecute next command  if LOW

Code:
system("shutdown -h now");

so when the pin is LOW we are doing a shutdown -h now (power off system)

so now that we are supposed we know what it will do, we are ready to compile it

I you remember the final note when we installed the library, in order to compile we will need to use our gcc with some parameters to link to the library on this case this are -lwiringPi -lwiringPiDev

Code:
gcc -lwiringPi -lwiringPiDev -o apagado apagado.c

this will compile our apagado.c source with an outoput file named as apagado

so thats all, we have our program compiled and we are ready to test
  note save all your work as we are ready to shutdown the system  

as we want our program be run on backgground and we want to shutdown it must be run as root
Code:
sudo ./apagado &

we will be provided with a number for the process but no needed this time

we are ready to check.
1st think we can do is read the gpio to check if there any difference on pin phisycal 37
Code:
readall
+-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
|  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
|  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
|   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT3 | TxD3     | 15  | 13  |
|     |     |       0v |      |   |  9 || 10 | 0 | ALT3 | RxD3     | 16  | 14  |
|   1 |   0 |     RxD2 | ALT3 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 110 |
|   0 |   2 |     TxD2 | ALT3 | 1 | 13 || 14 |   |      | 0v       |     |     |
|   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4   | 4   | 68  |
|     |     |     3.3v |      |   | 17 || 18 | 0 | ALT3 | GPIO.5   | 5   | 71  |
|  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
|  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
|  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
|     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 21  |
|  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
|   7 |  21 |  GPIO.21 | ALT3 | 0 | 29 || 30 |   |      | 0v       |     |     |
|   8 |  22 |  GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1     | 26  | 200 |
|   9 |  23 |  GPIO.23 | ALT3 | 0 | 33 || 34 |   |      | 0v       |     |     |
|  10 |  24 |  GPIO.24 | ALT3 | 0 | 35 || 36 | 0 | ALT3 | CTS1     | 27  | 201 |
|  20 |  25 |  GPIO.25 |   IN | 1 | 37 || 38 | 0 | ALT3 | TxD1     | 28  | 198 |
|     |     |       0v |      |   | 39 || 40 | 0 | ALT3 | RxD1     | 29  | 199 |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

you will see as GPIO.25 on WiringPi (pin Phisycal 37) now is mode IN and is activated 1

this mean that when we short this pin with ground (Phisical Pin 39) it will be 0, and we will execute the command as it is LOW.

now we can join pin 37 and 39 for a second, using a wire, a button, a coin, screwdriver or something metalic
and ohh surprise !!! the system is going down and poweroff

ok our program works, but after system is powered on again we need to have our program running again on background.
to do it automaticly we need to include it on the system startup process to run it as root.

I suppose you remember where our program was saved when compiled...
if no, check
~Downloads/WiringOPI/examples

we are copying it to the system path for later use
so go do this folder and copied it to /bin
Code:
cd Downloads/WiringOPI/examples
Code:
sudo cp apagado /bin

now in order to have it executed when boot the system we will modify the file /etc/rc.local with vi
as this is a system file it need to be mofidied by root only (or with sudo)

Code:
sudo vi /etc/rc.local

now we use the cursors to go down until the before last line exit 0 and add a new file
you remember from previous?
use key i to insert and add our apagago & as a new line before exit 0 line.

then click on ESC and : wq to save and exit

so now our file /etc/rc.local bin should be like this one
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
apagado &

exit 0

and ready to restart the system to see if all changes are ok
Code:
sudo reboot

after the sytems restart we can check if our program is running on several ways.

1st we can check the process running to see if our apagado is running with ps -aux|grep apagado
Code:
ps -aux |grep apagado
root       362  0.0  0.0   1700   468 ?        S    10:44   0:00 apagado
pi         953  0.0  0.0   3684   744 pts/0    S+   10:45   0:00 grep apagado

we should see 2 lines one apagado running as root and the grep agagado running as pi

2nd we can check with the gpio readall as see status of pin 37 , it shoud be mode IN and activated to 1

and the 3rd and efective one is to push the button we should install between pin 37 and 39
this is the best one but if works as expected this will power off the system 

as I say at the begginig use this guide as your own risk.
I am not the library creator, just an user that share how to use it .
hope this help
Angel

Print this item

  Connect bluetooth speaker + Setup it in Kodi
Posted by: prixes - 06-18-2017, 09:15 AM - Forum: Solved threads (also check FAQ and HOWTOs) - Replies (1)

I tried a lot of guides to connect bluetooth speaker to my orange pi (lite) and this one worked:
http://youness.net/raspberry-pi/bluetoot...spberry-pi

Now i am trying to configure my kodi recognize the audio decoder that my bluetooth speaker using, but i don't know how ?
Could anyone help me ?

*PS. I am doing this because i experiense a lot of white noise from AUX when i am using HDMI to VGA + 3.5mm(AUX)

Print this item

  HOW TO - install Amiga emulator and run games?
Posted by: Vadim1972 - 06-18-2017, 04:35 AM - Forum: HOWTOs - Replies (1)

Help please!

Print this item

  Pacman 3D
Posted by: Lamerjack - 06-09-2017, 12:23 PM - Forum: Beta Testing - No Replies

I found a 3D version of arcade pacman (that use the original rom)
http://pacifi3d.retrogames.com/pacifi3d/index.html

here how to complie with orange:

mkdir pacifi3d
cd pacifi3d
wget http://pacifi3d.retrogames.com/pacifi3d/....3-src.tgz
tar -xvf pacifi3d0.3-src.tgz
cp makefiles/Makefile.linux makefiles/Makefile.orange
nano makefiles/Makefile.orange
at line 33 EXTLIBS = `sdl-config --libs` -lGL -lGLU 
add -lm
save it

make orange
copy in the roms folder the rom of one of these games
 *    puckman
 *    puckmana
 *    puckmanf
 *    pacman
 *    pacmanf
 *    puckmod
 *    pacmod
 *    hangly
 *    hangly2
 *    hangly3
 *    newpuckx

 rom files should be decompressed in a folder with the same name of the game

 ./pacifi3d nameoftherom

[Image: screen3.jpg]

Print this item

  HOWTO upgrade system without crash it with sudo apt-get upgrade
Posted by: Spirax - 06-08-2017, 08:23 AM - Forum: HOWTOs - Replies (1)

hello.
This is my first howto so be patien, probably I will need to edit some times with your comments Wink

Exclamation note than iif tried to upgrade the system without lock the apropiate packages the system will crash and you will need to reinstall the sd card image. Exclamation


1st please be aware that I can not have any responsability if something goes wrong on your system and it crash and you need to format it and re-image it.
please read 2 times the complete post to understand what we are doing before to attempt to do it step by step.

if you have several SD cards I will recomend you to use a new image of retrorange pi on one of them to test it if your system is a different than OPI PC or OPI PC plus than I have tested please share the names of the packages on your sytems so we can make a list of packages for system.

I don't know exactly witch package upgrade causes the crash of the system when upgrade it, but there are some suspect packages, so the idea is to lock this packages on his actual version to avoid system to upgrade them automaticly.

Every system (OPI PC, OPI PC PLUS, OPI Litle, OPi Zero etc ) has his own packages names for kernel and linux. so be aware of the system you are using and the names of the packages you need to lock.


I only have tested it on my own systems OPI PC Plus and OPI PC, so I will provide you the names for this packages on this systems.
Maybe I have lock more packages than necesary to avoid upgrade, but I am reporting the packages than  I have choose and for me are safe as I have already done on my systems.

I lock the packages initially on my first system with the sypnactics on the X enviroment, but then when return to console and try sudo apt-get upgrade the packages was sitll ready to upgrade, so I look for another way to lock the packages on the apt-get upgrade console command..
so here are the steps.

Lock This packages for an  Arrow    OPI PC plus 
1 exit from emulation station to console.

2 update the packages list with
sudo apt-get update

3 run this commands one by one on the console to lock the packages for linux, kernel sunsi, etc with this commands , one line per package.

echo 'linux-jessie-root-orangepipcplus hold' |sudo dpkg --set-selections
echo 'linux-u-boot-orangepipcplus-default hold' |sudo dpkg --set-selections
echo 'armbian-firmware-full hold' |sudo dpkg --set-selections
echo 'armbian-tools-jessie hold' |sudo dpkg --set-selections
echo 'initramfs-tools hold' |sudo dpkg --set-selections
echo 'libcedrus1 hold' |sudo dpkg --set-selections
echo 'libmali-sunxi-r3p0 hold' |sudo dpkg --set-selections
echo 'libvdpau-sunxi1 hold' |sudo dpkg --set-selections
echo 'libvdpau1 hold' |sudo dpkg --set-selections
echo 'linux-headers-sun8i hold' |sudo dpkg --set-selections
echo 'linux-image-sun8i hold' |sudo dpkg --set-selections
echo 'linux-libc-dev hold' |sudo dpkg --set-selections
echo 'mali-sunxi-utils hold' |sudo dpkg --set-selections
echo 'sunxi-tools hold' |sudo dpkg --set-selections
echo 'xserver-xorg-video-fbturbo hold' |sudo dpkg --set-selections

5 after all the relevant packages locked, run the upgrade and verify than it say than packages are locked on hold and click on yes to upgrade systems, but before click on yes check that there are 2 list, 1st list are the packages locked, 2nd list are the packages to upgrade
sudo apt-get upgrade

6 wait for several minutes until it finish and reboot system
sudo reboot

7 enjoy with the system upgraded

******

for an Arrow   OPI PC we need to replace the first two lines of the packages to lock with

echo 'linux-jessie-root-orangepipc hold' |sudo dpkg --set-selections
echo 'linux-u-boot-orangepipc-default hold' |sudo dpkg --set-selections

*******

maybe if someone try it can write his comments if works ok for him too, or if I have missed some steps on the howto.

also if someone want to try it on another system like opi litle,
in order to know the packages that need upgrade.
you can run this
sudo apt-get update
sudo apt-get upgrade  (and chose no when ask to proceed)

then on the list of packages to upgrade look for the name of the linux packages to lock it with the command
echo 'NAME OF THE PACKAGE hold' |sudo dpkg --set-selections

if anyone probe it and also works for him, please comment your experience if there are any steep than need more explain, so I can modify if needed and will be easy for the next one.

If there is an expert around maybe can provide more or less packages names to fine the upgrade.

thanks for your time reading it
I am not an exper but will try to reply any question as better I can. Huh

Note than after upgrade it, I have test my systems, with retroarch mame, adv mame and amiga only and all works ok for me, but I haven't tested all the systems and I have a minimun set of roms, maybe I have upgrade some packages than crashed an indivual retro emulation but as I don't use it I dont know it fail, please comment with your experiences.
hope all is ok and also works for you Angel

maybe if an expert on retrorange pi read it, can support us and provide us a better list of packages not recomended to be upgraded. Huh
thanks again

Print this item

  kodi 17.1 RC no sound through hdmi
Posted by: royalwulf - 06-06-2017, 09:17 AM - Forum: Support area - Replies (1)

i had soundon kodi though hdmi.  I installed pptp yesterday, not sure if this stopped the sound.  But today I have no sound in kodi through hdmi.  What can i try?

Print this item

  Scraper Update.
Posted by: Lamerjack - 05-29-2017, 10:58 AM - Forum: Support area - No Replies

There are updates of scraping engine?
For example when there are many similar names show only firsts x results and is not possible to scroll.
Sega master system doesn't find "Wonder boy" game that is present on the Game.db
When manual input is needed, for example to remove _  or () the tex is centered on the last letter so near all the left part of the name is out of screen.

There is a way to export only one game data? I mean i have a game that a friend wants, can i export the data of only my game or i have to edit manually his gamelist.xml?
Thanks
Enrico.

Print this item