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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 29,576
» Latest member: andrewloiun
» Forum threads: 16,212
» Forum posts: 116,988

Full Statistics

Latest Threads
Experimental Mobian kerne...
Forum: PinePhone Pro Software
Last Post: benpocalypse
Today, 06:18 AM
» Replies: 12
» Views: 5,760
Thoughts after a year wit...
Forum: General Discussion on Pinebook Pro
Last Post: anoduck
Yesterday, 03:14 PM
» Replies: 5
» Views: 8,774
bookworm vs trixie discus...
Forum: Mobian on PinePhone
Last Post: biketool
09-21-2025, 02:03 PM
» Replies: 71
» Views: 32,788
Special keys stopped work...
Forum: General Discussion on PineNote
Last Post: j_s
09-19-2025, 04:04 PM
» Replies: 3
» Views: 10,404
Wifi 5Ghz Issue
Forum: PineNote Software
Last Post: nicolaos
09-17-2025, 06:36 PM
» Replies: 0
» Views: 3,899
the self built bl602_boot...
Forum: Getting Started
Last Post: pinecheng
09-16-2025, 02:15 PM
» Replies: 2
» Views: 4,969
Why projects like PinePho...
Forum: General Discussion on PinePhone
Last Post: Gary2003
09-16-2025, 01:13 PM
» Replies: 13
» Views: 14,086
Cannot flash the modem fi...
Forum: Mobian on PinePhone
Last Post: anonymous
09-16-2025, 12:18 PM
» Replies: 7
» Views: 6,238
Star64 Irradium (based on...
Forum: Getting Started
Last Post: mara
09-16-2025, 11:18 AM
» Replies: 8
» Views: 9,014
Mobian MMS/SMS text probl...
Forum: Mobian on PinePhone
Last Post: georgegohl888
09-15-2025, 02:42 AM
» Replies: 16
» Views: 25,075

 
  WiFi PineA64 Pineapple
Posted by: Ghelorn - 09-19-2016, 07:48 AM - Forum: Linux on Pine A64(+) - Replies (2)

im building a pineapple with one of my pines. well why not. i figured i would post my instructions. this is adapted from an install script i wrote for reaver a few months back.

remember that any of these tools must be used on networks that you own or have permission to use.
some of these tools on here can interfere with computers/devices on a network.
i will not be held responsible for killing your router, causing nuclear winter, you going to prison or your neighbour bashing the shit out of you for using all of his internet and costing him a small fortune.
i will also not answer questions on how to use the software included. everything has a "--help" or man page for usage. if you still dont know what your are doing then this is not the guide for you.

THIS IS ONLY FOR THOSE WHO KNOW WHAT THEY ARE DOING



my setup.
pine a64+ 2GB board + 64GB SD card. metasploit alone takes up 10gigs.
pine64 wifi module. used for connecting to personal wireless hotspot provided by my mobile device. dont plug this in just yet. we dont want this called wlan0 or wlan1
2 x external wireless network cards with reasonable antennas. most of the wireless tools out there only really attack the 2.4GHz band so the cards should be single band.




first download the latest debian longsleep base image.

burn SD card and boot your pine.



start by changing the default password

Code:
passwd


update system
coz im a baddie for security.
Code:
sudo -s

use all our avaliable storage space
Code:
resize_rootfs.sh

lets make sure kernel and uboot is updated
Code:
pine64_update_kernel.sh
pine64_update_uboot.sh
reboot

lets su and run more updates
Code:
sudo -s
apt-get update
apt-get upgrade -y && apt-get dist-upgrade -y
reboot #it never hurts to do a reboot on a fresh system after updating.


setup wireless hardware
now plug in the first of your wireless adapters
check it shows up.
Code:
iwconfig

if nothing shows apart from wlan0 and wlan1 (presuming your using the built in wifi as well), you may need to load the wireless firmware.
i usually do this by running the following
Code:
lsusb

Quote:root@pine64:/home/debian# lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

here i can see my card has an atheros chipset. so now i can run.
Code:
apt-cache search atheros|grep firmware

and i get the following output
Quote:firmware-atheros - Binary firmware for Atheros wireless cards

so i run
Code:
apt-get install firmware-atheros

now unplug and replug your wifi card. 
check again for your wireless card
Code:
iwconfig

Quote:wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

you will need to do this for each of your wireless cards your using.

at the end i ended up with the following output from iwconfig and lsusb
Quote:root@pine64:/home/debian# iwconfig
eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

dummy0    no wireless extensions.

sit0      no wireless extensions.

lo        no wireless extensions.

wlan1     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:on

root@pine64:/home/debian# lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

shutdown the pine and plug in our built in wifi.

just to double check everything is good
Quote:debian@pine64:~$ lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
debian@pine64:~$ sudo iwconfig
eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

dummy0    no wireless extensions.

rename7   IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:on

wlan2     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

lo        no wireless extensions.

wlan1     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

hmmm something funny going on here. the wifi module has called itself wlan1 and wlan2 while my second external adapter is called rename7

i had to play around with the udev rules making a rule for the second interface on the wifi module.
file to look at is /etc/udev/rules.d/70-persistent-net.rules

after a reboot i get the following output from iwconfig. this is what i was expecting.
Quote:debian@pine64:~$ sudo iwconfig
wlan3     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

dummy0    no wireless extensions.

wlan2     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

lo        no wireless extensions.

wlan1     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:on


setup remote ssh wireless connection
we want to setup connection to our wireless hotspot so we can run our pentests from a tablet or even on mobile device via ssh.
edit the file /etc/network/interfaces and add the following to the end.
Quote:auto wlan2
iface wlan2 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

now edit the file /etc/wpa_supplicant/wpa_supplicant.conf and add the following
Quote:network={
ssid="YOUR_NETWORK_NAME"
psk="YOUR_NETWORK_PASSWORD"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}


wifi software
thats our hardware and remote side of things done and setup. time to install some wifi cracking software.

make us a nice working directory.
Code:
cd ~
mkdir working
cd working

install macchanger. because you should be changing your mac address on your wifi cards before doing any attack.
Code:
sudo apt-get install macchanger


install aircrack-ng from source.
Code:
sudo apt-get install libnl-3-dev libnl-genl-3-dev libssl-dev libsqlite3-dev
svn co http://svn.aircrack-ng.org/trunk/ aircrack-ng
cd aircrack-ng
make sqlite=true experimental=true ext_scripts=true
sudo make sqlite=true experimental=true ext_scripts=true install
sudo airodump-ng-oui-update

now lets test packet injection on our cards
Code:
sudo ifconfig wlan0 down && sudo macchanger wlan0 -r && sudo iwconfig wlan0 mode monitor && sudo ifconfig wlan0 up
sudo aireplay-ng --test wlan0

sudo ifconfig wlan1 down && sudo macchanger wlan1 -r && sudo iwconfig wlan1 mode monitor && sudo ifconfig wlan1 up
sudo aireplay-ng --test wlan1

install pixiewps
Code:
cd ~/working
git clone https://github.com/wiire/pixiewps.git
cd pixiewps
cd src
make
sudo make install

install wifite
Code:
cd ~/working
wget https://raw.github.com/derv82/wifite/master/wifite.py
chmod +x wifite.py
sudo cp wifite.py /usr/local/bin/

install reaver with pixie dust source files. reaver-wps-fork-t6x.
reaver doesnt like the newer versions of libpcap so we will download the older ones.
Code:
cd ~/working
mkdir libpcap
cd libpcap
wget https://launchpad.net/ubuntu/+archive/primary/+files/libpcap-dev_1.4.0-2_all.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/libpcap0.8-dev_1.4.0-2_arm64.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/libpcap0.8-dbg_1.4.0-2_arm64.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/libpcap0.8_1.4.0-2_arm64.deb
sudo dpkg --install *.deb
sudo apt-mark hold libpcap-dev libpcap0.8 libpcap0.8-dbg libpcap0.8-dev

install reaver now.
Code:
cd ~/working
git clone https://github.com/t6x/reaver-wps-fork-t6x.git
cd reaver-wps-fork-t6x*/
cd src/
./configure
make
sudo make install

now on to Bully
Code:
cd ~/working
git clone https://github.com/aanarchyy/bully
cd bully
cd src
make
sudo make install

now to make things easy with this code a lovely guy made. thanks SilentGhost for making HT-wps breaker.
Code:
mkdir ~/code
cd ~/code
git clone https://github.com/SilentGhostX/HT-WPS-Breaker.git
sudo ln HT-WPS-Breaker/HT-WB.sh /sbin/HT-WB.sh

my next step is installing this in an old wireless router with a battery.

more is to come. i will be adding some exploits like metasploit and some MITM attacks like sslstrip and such. this is just the base setup. i remember there was a web interface for this. just dont remember what it was called.

edit: i added macchanger to the wifi tools. cant believe i forgot it.


  The sunxi transform module is very slow, how to do video rotation?
Posted by: jacklau - 09-19-2016, 12:24 AM - Forum: Linux on Pine A64(+) - No Replies

I want to rotate the video, I used the sunxi transform module. But I found that the sunxi transform module is very slow, I rotate a 640x360 yuv420 video buffer, the performance is 10fps! It's too slow to do any thing. What the sunxi transform use for? If I need to rotate 4k video @ 30fps, how can I do that?


  Unusual streaming slowdown
Posted by: Khat0varBrewMoth - 09-18-2016, 11:29 PM - Forum: Getting Started - Replies (5)

Hi there,

I am running 2GB version on Android. This was initially working at great speed.

Now I'm experiencing problems streaming online content (using catch up TV apps) as well as things from NAS on local network using Kodi. Streaming videos buffer really slow over wifi and wired ethernet connection. Seems to be a problem with the Pine64 rather than network issue.

Can anyone point me to a way to get some logs for more specific help here?

Cheers


  Enocean on Android
Posted by: ltorsini - 09-18-2016, 09:55 PM - Forum: Android on Pine A64(+) - No Replies

All-

Looking to integrate the Enocean USB 300U radio on Android to use their IoT kit.  Before we start working I wanted to check that no one else is/has already successfully integrated the FTDI drivers on the Android image?

Thanks!


  Nexdock with Pine64 running RemixOS
Posted by: bartvvr - 09-18-2016, 02:33 PM - Forum: Accessories - Replies (4)

I received a Nexdock which is basically a display and a bluetooth keybord. The idea is that with Nexdock you can turn your Pine64 into a laptop.
https://www.indiegogo.com/projects/nexdo.../2028259#/

I'm running RemixOS 2.0 on my Pine64 2GB but I can't change the output resolution of the Pine64 to 1366x768.
1366x718 is the native resolution of the Nexdock.
Nexdock works together with Pine64, but all text is hard to read because of the wrong display setting.

Any solution or Remix OS update to fix this issue?

Thanks, Bart


  Tutorial: How to create DD images with appropriate size
Posted by: tkaiser - 09-18-2016, 09:55 AM - Forum: Android on Pine A64(+) - Replies (5)

This mini tutorial is meant for those people providing Android or RemixOS 'DD images'. The DD images currently provided have been created wrong (too large for many SD cards out there). Fortunately it's easy to do it better. Since we're talking here about SBC why not stop wasting time on both creator's and user's side, using an SBC in USB gadget mode, create images with appropriate size and speed up things?

The whole process would work with any Pine64/Pine64+ too but since AFAIK no OS image is around that uses a correctly configured kernel enabling the necessary g_mass_storage module and since a small patch might be necessary to get this working with BSP kernel (can't test right now since ran out of Pine64) we discuss this with H3 devices instead (H3 is A64's little sibling). Ingredients:

  • Any H3 device from this list: http://www.armbian.com/download/
  • A short USB-to-Micro-USB cable (or type A to type A when choosing the Beelink X2 or Pine64 later)
  • An Armbian image for the device in question using legacy kernel since we need USB OTG support
  • A 120 GB disk to store the images with 7.8, 15.8, 31.8 and 63.8 GB size (or a 250 disk when both Android and RemixOS images should be stored on the same disk)
I would choose the cheapest device possible: Orange Pi One powered through the barrel plug and establishing the USB OTG connection through the Micro USB port.

1) Prepare the disk

Connect the USB device to OPi One, the H3 board to your Windows machine, then do on the Linux box:
Code:
modprobe g_mass_storage file=/dev/sda
echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role

This will hand the whole device as an USB disk to your Windows PC. Since I don't own such thing (only virtualized Windows servers) in the following I will show how it looks like when the SBC is connected to a Mac. You can now use disk utility (no idea how that's called in Windows) to partition the disk that is physically connected to the SBC in reality. I created the necessary partitions in OS X that are all small enough to fit on any SD card later. Now in OS X it looks like this:
Code:
macbookpro-tk:~ tk$ diskutil list
...
/dev/disk2
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:      GUID_partition_scheme                        *128.0 GB   disk2
  1:                        EFI EFI                     209.7 MB   disk2s1
  2:                  Apple_HFS Ohne Titel 1            7.8 GB     disk2s2
  3:                  Apple_HFS Ohne Titel 2            15.8 GB    disk2s3
  4:                  Apple_HFS Ohne Titel 3            31.8 GB    disk2s4
  5:                  Apple_HFS Ohne Titel 4            63.8 GB    disk2s5
  6:                  Apple_HFS Ohne Titel 5            8.9 GB     disk2s6

And on the SBC itself in Linux it looks like this:
Code:
root@orangepiplus2e:~# cat /proc/partitions
major minor  #blocks  name

179        0   15267840 mmcblk0
179        1   15114128 mmcblk0p1
179       32       4096 mmcblk0boot1
179       16       4096 mmcblk0boot0
  8        0  125034840 sda
  8        1     204800 sda1
  8        2    7617188 sda2
  8        3   15253392 sda3
  8        4   30957032 sda4
  8        5   61658076 sda5
  8        6    8688952 sda6

So we created 4 partitions that we will then feed to PhoenixCard in the next steps. Time to eject/unmount the partitions from Windows (or OS X in my case) and then remove the device back in Linux (we switch first to USB host mode which is the equivalent of disconnecting a real USB disk physically and will then unload the driver since we will use it in the next step not with /dev/sda but the individual partitions instead):
Code:
echo 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
rmmod g_mass_storage

2) Provide the partitions as devices starting with 7.8 GB in size

In Linux /dev/sda2 is 7.8 GB in size so now we hand only this partition out to Windows (or in my case OS X):
Code:
modprobe g_mass_storage file=/dev/sda2
echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role

And instantly on the connected PC a new USB device appears that's just 7.8 GB in size:
Code:
macbookpro-tk:~ tk$ diskutil list
...
/dev/disk2
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:                            Ohne Titel 1           *7.8 GB     disk2

3) Let PhoenixCard do the work

Now start PhoenixCard and point it to this virtualized 'USB thumb drive'. PhoenixCard will create a bunch of new Android/Linux partitions on /dev/disk2 (/dev/sda2 on Linux) and use the maximum disk space available (7.8 GB in our case). That's the whole trick: Creating a partition small enough to fit on any SD card later, let PhoenixCard use this partition as device and create its own partitions on this. Smile

4) Create the DD image on Linux

Eject/unmount the virtual USB thumb drive in Windows, mount the next one to create the 16GB version and while PhoenixCard does its job in Windows create a new device image on the SBC that will be way smaller than the images Pine64 folks provide now. The most important thing here is that we create a device image by using a partition. Now /dev/sda2 on Linux contains a bunch of partitions and therefore we use
Code:
dd if=/dev/sda2 bs=10M | 7zr a -bd -t7z -m0=lzma -mx=3 -mfb=64 -md=32m -ms=on -si Android-8GB.img.7z

For the 16GB variant it would look like this (and so on):
Code:
dd if=/dev/sda3 bs=10M | 7zr a -bd -t7z -m0=lzma -mx=3 -mfb=64 -md=32m -ms=on -si Android-16GB.img.7z

(I think Armbian doesn't ship with 7-zip so an 'sudo apt-get install p7zip' would be required before). This way you get pretty small DD images while PhoenixCard is already preparing the next image on the Windows host.

5) Tell your users to use appropriate tools and what's important.

When you put the compressed images online then provide GOOD documentation how to burn images correctly. Don't recommend tools that suck, it's 2016 and burning tools that verify the burning process do exist, for Android and RemixOS images it's VERY IMPORTANT that users choose SD cards that show high random IO performance. Everything is outlined here: http://docs.armbian.com/User-Guide_Getti...-a-sd-card


  Cannot DD on 16 GB SD
Posted by: Sethlans - 09-18-2016, 07:34 AM - Forum: Android on Pine A64(+) - Replies (3)

Hello everybody.
I have kingston 16GB claa 10 SD card. I have downloaded the 16 GB android image but when i try to DD the image on the SD I havn't enough space on the SD.
I have also tryed with Win32Imager but I have the same problem.

How can i solve?


Photo Ubuntu not working for me
Posted by: Macs1337 - 09-18-2016, 06:03 AM - Forum: Ubuntu - Replies (8)

[Image: QDyQiQp.jpg]
This is the last thing my pine write before shut down and turn off.
Can someone help me what is the problem? ):


  Power LED Heartbeat script
Posted by: pfeerick - 09-18-2016, 05:16 AM - Forum: Pi2, Euler and Exp GPIO Ports - Replies (3)

Just thought I'd post the current version of the shell script I am using on my Pine64 to make the user controllable System LED (the one that you can attach near the headphones jack, or via the EXP header). I added it to /etc/rc.local (make sure you put an " & " at the end, so it doesn't block rc.local continuing / exiting), so now every time the pine64 starts up, I get a little heartbeat indicator going so I know it's running ok. Since it's a gist, you can also download it via wget or curl... just copy the URL you get from the 'raw' button up the top right. 

Next step will be working out how to intercept the power button... perhaps via udev, since that already responds to the power button interrupt, but doesn't know what to do with it out of the box. 

https://gist.github.com/pfeerick/00b04df...b4e1f7c168


  Fixing GPIO user permission errors
Posted by: pfeerick - 09-18-2016, 04:54 AM - Forum: Pi2, Euler and Exp GPIO Ports - No Replies

A known issue from Raspberry Pi land that also effects the Pine64 is the need to use sudo in order to manipulate GPIO bits... which gets annoying pretty quickly... and tempts you to stay logged in as the root user, which is a bad idea.

There are some workarounds... i.e. using python GPIO, wiringPi (when available). But there is also a relatively simple fix you can apply in order to fix it up, which is to basically add two startup scripts that automatically fix the permissions. I've just run through this myself, and had to backtrack and check what I'd done, so please let me know if there are any mistakes or corrections needed. So... here we go!

Create a gpio group first:

Code:
groupadd gpio

Then add your username to that group:
Code:
usermod -a -G gpio username

To check that everything is good so far, you can run the below command, and you should see a line that looks a bit like "gpio:x:1001:pfeerick" (last bit should be your user name).
Code:
grep gpio /etc/group

Now, before that change to groups takes effect, you will need to log out of your current session. If you really, really don't want to, you may be able to run "newgrp gpio"... but YMMV.

Now, the final bit is to fix up the permissions of the sysfs GPIO file system. There are two bits that needs to be fixed - the export and unexport 'files' and the actual GPIO 'folders'

For the first bit, it is probably simplest to just add the two following lines to the bottom of
Code:
/etc/rc.local
(before the exit 0 line), although it may be better to put it in a separate script for neatness. They needed to be run at every startup as /sys is a virtual file system, and is created every time the pine64 is booted, so doesn't remember the permission changes.

Code:
chown -R root:gpio /sys/class/gpio
chmod -R ug+rw /sys/class/gpio

At this point, when you restart your pine64, you will be able to export and unexport GPIO pins without needing sudo. And if you don't want to restart, you can just run those commands now at the command prompt. But that is only half the story... we also need to fix the GPIO 'folders' , which have the direction and value 'files''. So, next, run the below command and create following udev rule:

Code:
sudo nano /etc/udev/rules.d/80-gpio-noroot.rules

Code:
# /etc/udev/rules.d/80-gpio-noroot.rules
# Corrects sys GPIO permissions on the Pine64 so non-root users in the gpio group can manipulate bits
#
# Change group to gpio
SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c '/bin/chown -R root:gpio /sys/devices/soc.0/*pinctrl/gpio'"
# Change user permissions to ensure user and group have read/write permissions
SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c '/bin/chmod -R ug+rw /sys/devices/soc.0/*pinctrl/gpio'"

This monitors the GPIO file system and makes the permission changes as needed.

To avoid needing to reboot to run this new file, just run:

Code:
sudo udevadm trigger --subsystem-match=gpio

Everything should work great now!

Concept based on https://www.raspberrypi.org/forums/viewt...6&t=118879