Search the Community

Showing results for tags 'tutorial'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Announcements & first aid
    • Announcements
    • Board doesn't start
  • Community forums
    • Common issues
    • Peer to peer technical support
    • Feature Requests
    • TV boxes
    • General chit chat
  • Bug tracker
    • Allwinner A20
    • Allwinner H2 & H3
    • Allwinner H5 & A64
    • Allwinner H6
    • Armada A388, A3700
    • Amlogic S905(x)
    • NXP (Freescale)
    • Rockchip 3288 & 3328
    • Other supported boards
  • Development
    • Rockchip 3399
    • Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 73 results

  1. Orange Pi Zero NTP Stratum 1 PPS GPS Server with Armbian OS. Link to the Tutorial - This tutorial uses a 3.3V capable GPS module with PPS output - TOPGNSS GN-701 (u-blox 7) but other similar modules should work. This tutorial is for the Orange Pi Zero, but will probably work for other boards. I couldn't easily do a comprehensive hardware and software tutorial on this forum, so I've published it on my web server and linked from here and attached a PDF. Link to the Tutorial - Tutorial PDF ntp-stratum1.pdf If you spot any typo's or errors please let me know.
  2. For those of you who're interested in running a CMS on Armbian I've a small tutorial how to get django CMS working. If you're not interested in the 'story' just want a step by step installation guide, scroll to the end of this post, there you find it. Story: Following their installation guide it fails during creation of a django project with 'djangocms -f -p . mysite'. The error looks something like: After a brief google search I found that other also had similar problems. It seemed that pillow is the problem while the whole installation failed. Unfortunately pip pillow also failed, and this one helped me to install pillow. After installation of libpq-dev python-dev libjpeg8-dev, pillow could be installed without any issues and 'djangocms -f -p . mysite' too. Starting the CMS with 'python runserver' worked too but unfortunately wasn't accessible over local network (since all of my armbian devices are running headless, I need access over network to the CMS). Inspired by a next google result, I found out that I should run the CMS on the SBCs network IP not on localhost by using 'python runserver'. Which led in a next error. ... DisallowedHost: Invalid HTTP_HOST header: '192.168.x.xx:8000'. You may need to add u'192.168.x.xx' to ALLOWED_HOSTS. Some housekeeping in the and restart of the CMS led than to a working system. # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['192.168.x:xx'] Lessons learned: Even if you're not a dev and your background is limited, it is possible to get something like this CMS to work if you're able to use google. By reading through google results and have a look on the output errors during installation you learn much more about your project/SBC than just following the step by step procedure I'll show at the end of this post. The 'tarzan approach' - Tarzan/me swings from tree/error to tree/error holding on to elastic lianas/error logs works but it makes sense to repeat this installation after get a straight forward approach for the next time you'll use it. Step by step procedure: Installing package dependencies sudo apt-get install libpq-dev python-dev virtualenv libjpeg8-dev Make your virtualenv folder for all your CMS projects (since django cms is capable to run multiple cms at once it might make sense to have a 'parent folder' where all of them are placed): mkdir CMS --> cd CMS Create and activate a virtual env: virtualenv env --> source env/bin/activate Update pip: pip install --upgrade pip Use the django CMS installer: pip install djangocms-installer Create a new directory to work in: mkdir tutorial-project --> cd tutorial-project Run it to create a new Django project: djangocms -f -p . mysite Setup for access via LAN: nano mysite/ --> ALLOWED_HOSTS = ['192.168.x:xx'] (IP of yor SBC) Start up the runserver: python runserver 192.168.x.xx:8000 Your CMS will be accessible via browser on your SBCs IP port 8000. Tested on: OPi 0: ARMBIAN 5.31 stable Ubuntu 16.04.2 LTS 3.4.113-sun8i Odroid HC1: ARMBIAN 5.33 user-built Debian GNU/Linux 8 (jessie) 4.9.46-odroidxu4
  3. I like it to anounce some messages/informations via TTS ( T(text)T(o)(S)peech) . Normally I use espeak with a litte better sounding mbrola-voice (No. 6 german). But on Android you could buy - for cheap againt the PC-version - some better voices. Like my favourite german Voice "Julia" from Acapela. So I always wanted to use this voice for the informations. I did found a "server"-app for android which takes a UDP/HTTP-request to play a given string via the default TTS on the android-device (or a .MP3 stored in the memory of the android-device). Its named Home24-MediaPlayer - and can be found at (isnt anymore in the Google PlayStore for me - only the Home24-App for Smartphone or Tablet): You could give the android-device the request via HTTP or UDP from your armbian-commandline or shell-script: # HTTP samples curl'This is a Test' 1>/dev/null 2>/dev/null wget'This is a Test' 1>/dev/null 2>/dev/null wget 1>/dev/null 2>/dev/null # UDP samples echo 'tts=This is a Test'|nc -w 0 -u 50002 echo 'track=MySong.mp3'|nc -w 0 -u 50002 The Message could combine many commands in one line (also in HTTP/UDP): track=Alarm.mp3|tts=Alarm|sms=0150123456&message=Alarm see also the Wiki for the Home24-MediaPlayer: On my Smartphone it also does work, but when the screen and the device goes to sleep it wouldnt work anymore. So I did think about a device without a battery and did try a Orange Pi PC (H3) with H3Droid, but this was too slow for me - because the OPi PC always did work on the SD-Card (dont know if my card was too slow). I was hoping getting a better performance with the OPi PC because of the 1GB of Ram. [EDIT] ========================================================================= It was the card After the Minix NEO X5 - which did work without problems. I did gave the OPi PC a second chance with a brandnew 32GB Sandisk EVO. With this new card the access is now MUCH snappier I installed Acaplea's Julia and the Home24-MediaPlayer and its sounds - for me - a little bit better than the Minix NEO 5. PS: old card seems to be a Fake-SONY Class 10 card (or very old and used) ========================================================================= Now I will try a "old" Android-TVBox: Mini NEO X5 ( Dual Core RK3066 Cortex A9 1.6GHz , 1GB Ram / 16GB Flash). Does any one know another Android-App with a function like this?
  4. I stopped tinkering for a while but perked my interest and been grinning at such a simple project and generally think its really great. I think they have made some odd options as the server and electron browser have been lumped together which is a really strange choice for absolutely no advantage. The server does need restarts and would seem far more often than you would expect and the use of electron means armv7l only which is a shame for the 0/1 owners. You can install using chromium and you certainly don't need the load of a desktop?! Dunno been wondering. I wanted to use a zero as love that tiny footprint and price and there are loads tutorials out there that seem to have much more than necessary and electron is chromium in a java wrapper with reduced architecture offerings so why no support? But hey. Not that bothered about that but why the have made the server and browser monolithic as a server restart now causes a cool device to display a desktop and even why desktop on a mirror has me scratching my head. if anything it will present a different take on the install as for some reason they depart from vanilla and I actually think it works better. Shame there isn't a Banana pi zero image or is there as loving that form factor. I do know it gets hot as hell but just tinkering by a tiny mind with tiny boards. PS if there is something near working give us a shout with Armbian and BPIZ
  5. Not much of a tutorial, but it is something that often needs some googling and head scratching. This is how I got my particular modem working, your mileage may vary. Step 1) Get a modem that will work. I got a Huawei E397u LTE/UMTS/GSM modem. It's Cricket branded, but I'm on Google Fi, it will work with my data SIM. Step 2) Plug it in and see that it doesn't work. Step 3a) apt update Step 3b) apt upgrade Step 4) Install usb-modeswitcher Step 4, optional part 2) install modem-manager, modem-manager-gui (for general playing around) Step 5) unplug/replug the USB modem, see that it should magically have a different VID:PID when you type lsusb. You should also have some ttyUSB's, and you can check out modem details in the modem-manager-gui Step 6) set up network connection via the network dropdown at the top right of the desktop. You will need APN information for your carrier. I put in modem-manager so I could debug. It will cause issues if you do certain things with it while connected. My modem was $15, Ebay has them. So does amazon.
  6. tkaiser has built a new Kernel with i2s Modules. With this Kernel and some cheap DAC e.g. ( it is possible to get good quality sound out of the Orange Pis. After installing the Kernel Two Things have to be changed in the fex File: Change Directory to boot: cd /boot Turn the script.bin to a fex-File and open it in an Editor sudo bin2fex script.bin script.fex sudo nano script.fex Now change the following Entries: [twi1] twi_used = 1 to [twi1] twi_used = 0 and [pcm0] daudio_used = 0 to [pcm0] daudio_used = 1 Save your changes and do : sudo fex2bin script.fex script.bin After a reboot your done. I do not know for what the Section [twi1] is good for, i hope nothing serious.. This connections have to be made: 5V > Pin 2 Gnd > Pin6 BCK > Pin 27 LRCK > Pin 28 Data > Pin37 (according to the Picture "giachi" has posted on the diyaudio Forum see below) The second Picture is only for orientation on an Orangepi PC, the red Wire is 5V ! Be aware that the Header is rotated by 180°on the One! That´s all . Regards
  7. Orange Pi One PCB is designed to easy add almost all removed features from Orange Pi PC. Currently only RAM expansion is unprofitable. To add 2 removed USB ports just solder wires to solder points as shown below on the photo: Data lines for USB #3: points 1,2 Data lines for USB #2: points 3,4 Power can be taken directly from GPIO header or DC socket. OPiOne has no separate voltage regulators for USB ports like previous boards used to have. This way I want to solder mini WiFi dongle (after removing the case and USB port) directly to the PCB.
  8. UPDATE 11-FEB-2017: Version 2.2.0 is released: now including video recording in stead of only images and also a privacy option to black out areas that may not be filmed. UPDATE 09-FEB-2017: Version 2.2.1 is released: memory leak(s) fixed and in some cases video stopped recording. This should be fixed now. Download via this page. (link) is a relative new video surveillance program focusing mainly on the Raspberry Pi. In collaboration with the owner of the github project I managed to get it working on my Orange Pi Plus and PCDuino3 nano using Armbian (Debian Jessie) and a Logitech UVC compatible USB webcam. It consists of 2 modules: the Machinery module and Web module. The machinery module was very Raspberry Pi specific, but is now updated and can also run with very little extra effort on Armbian. The Web module runs without any modification. Follow the instructions below and you should be able to install or compile it. is very fast and has a modern interface. Furthermore it is (IMHO) a very nice alternative for zoneminder and motion.It also provides a videostream on a webpage. Follow the instructions below and share your comments, ideas etc. Method 1 (easy) - Install on Armbian Debian Jessie. Follow the instructions on the dedicated Armbian page (link). Here you will find an Armbian precompiled .deb armhf package. Further installation / configuration options can be found on the webpages. Method 2 (advanced) - Compiling the machinery and web module on Armbian Debian Jessie. Install the following packages: sudo apt-get install pkg-config libavcodec-dev libavformat-dev libswscale-dev Follow the instructions on this page (link). Further installation / configuration options can be found on the webpages. In all cases: please note that you must alter the camera configuration: default it comes with the Raspberry Pi camera that you probably won't have!
  9. Hi there, this very short tutorial is a solution when you need to backup/clone/save as small *.img file as possible of your whole fully bootable system (e.g. you have 8GB card but you want to make smaller system image for 2GB card). And another reason why I created this tutorial - I need to burn the same image to many microsd cards. I am using Windows (yup, hate me know) and Debian in these steps: Put your microsd card to Windows machine and make image of card with Win32diskimager. If your card is e.g. 8GB, you get *.img file with the same size (my name backup.img). Now in linux maxine (in my case Debian virtual machine) we are going to work with backup.img file. Run these commands in terminal (if you are not root use sudo at the start of each line) modprobe loop losetup -f losetup /dev/loop0 backup.img partprobe /dev/loop0 Run gparted with this command and move slider of main partition to the left to make partition smaller (leave some space, e.g. I left 400MB free space) gparted /dev/loop0 Click on Apply once you are happy with it. We can unload loopback device now losetup -d /dev/loop0 With fdisk find out end of last block fdisk -l backup.img In my case last block is 3571711 so I run command truncate --size=$[(3571711+1)*512] backup.img Done! Size of your backup.img file should be now about 1.5GB. You can burn this new backup.img file to another (or the same) card/s now. In my case I dramatically reduced time needed for burning data to many many cards (it saves hours/days when you need to burn a lot of microsd cards). Enjoy! P.S. this can be done also with just Debian, so no need for Windows, in this case you just need to make first step with backup.img with linux command (e.g. dd). And of course you can set up a script on your newly burned card to expand system partition to the whole microsd size during first boot, if needed.
  10. We included in Armbian a small utility called h3disp. If called without arguments it displays just a usage information: tk@orangepipc:~$ sudo h3disp [sudo] password for tk: Usage: h3disp [-h/-H] -m [video mode] [-d] [-c [0-2]] ############################################################################ This is a tool to set the display resolution of your Orange Pi by patching script.bin. In case you use an HDMI-to-DVI converter please use the -d switch. The resolution can be set using the -m switch. The following resolutions are currently supported: 480i use "-m 480i" or "-m 0" 576i use "-m 576i" or "-m 1" 480p use "-m 480p" or "-m 2" 576p use "-m 576p" or "-m 3" 720p50 use "-m 720p50" or "-m 4" 720p60 use "-m 720p60" or "-m 5" 1080i50 use "-m 1080i50" or "-m 6" 1080i60 use "-m 1080i60" or "-m 7" 1080p24 use "-m 1080p24" or "-m 8" 1080p50 use "-m 1080p50" or "-m 9" 1080p60 use "-m 1080p60" or "-m 10" Two examples: 'h3disp -m 1080p60 -d' (1920x1080@60Hz DVI) 'h3disp -m 720i' (1280x720@30Hz HDMI) You can also specify the colour-range for your HDMI-display with the -c switch. The following values for -c are currently supported: 0 -- RGB range 16-255 (Default, use "-c 0") 1 -- RGB range 0-255 (Full range, use "-c 1") 2 -- RGB range 16-235 (Limited video, "-c 2") ############################################################################ This tool tries to patch script.bin (adjusts the display settings there) and requires a reboot afterwards. While it is not useable with vanilla kernel (script.bin doesn't play any role there and a display driver is also still not ready) it might be also useful for H3 users that rely on other OS images (Debian/Ubuntu based from Xunlong or from loboris). Our h3disp tries also to patch script.bin there with your settings so it should be useful for non Armbian users too BTW: It could also be used with Debian based Linux OS images for A83T/H8 (Cubietruck Plus, pcDuino8 Uno or Banana Pi M3) but unfortunately these vendors fail to provide OS images that use a patched u-boot version that could deal with script.bin. At least 'Team BPi' got it finally after being told since months where/how to copy&paste this stuff but since they only update their sources and provide no updates for their OS images, Banana Pi M3 customers are still lost In case you're an Android user you'll have to go the extra mile since the Android OS image for H3 Orange Pi's doesn't support script.bin. You could apply the changes h3disp offers to one of our provided fex files but have then to overwrite a few sectors on your SD card to get this stuff working (by choosing our fex files you could also 'patch' the Android image to run better on the Orange Pi One or get all USB ports and Ethernet on the other models and improve realiability and decrease SoC temperature)
  11. For those of you who are interested in using a OPI zero as a small IoT-Server. I have some hints to get it working. It's more or less a lmgtfy How To plus some arduino code to test if it works. Hardware: OrangePi 0 with Armbian 5.25 connected over lan to my router DHT11 Module on a Wemos D1 mini (a small cheap wlan MCU for ~3$ which can be programmed via the Arduino IDE) Installation: First of all we install node-red on the OPI. Instead of rewrite how to do that again I just give you the link who to do that: Node-Red on armbian Second we install Mosquitto as a mqtt broker. If I have it right in mind I followed this instructable (I'm not shure, it's more than 2 weeks ago and I didn't save the link then): Mosquitto To represent the data of our DHT sensor-node graphically we install the node red dashboard module in: /usr/lib/node_modules/ with npm i node-red-dashboard If everything goes right you should have access to node-red via browser on port 1880: 192.168.1.xx:1880 and to the UI of dashboard: 192.168.1.xx:1880/ui/ Setting up everything: Now we're setting up the Wemos D1 mini. DHT11 wiring (DHT-->Wemos): VCC -->3.3V Signal --> D4 GND -->GND Some of the Wemos pins are capable for 5V (A0 definitly not!) but the DHT readings gets noisier when the device is powered through 5V (don't ask me why, I'm not en electronic engineer...) For the testprogramm we need two libraries which can be installed via the arduino IDE lib manager (+ ESP8266WiFi.h which comes when adding the generic ESP8266 board via Boardmanager): PubSubClient.h (PubSubClient by Nick O'Leary) DHT.h (DHT sensor library by Adafruit) And here comes the simplyfied code publishing to the mqtt broker: The code is more or less a combination of the examples which comes with the PubSubClient & DHT libraries + throw away all the stuff that we don't need (I had also a version of code where the Wemos D1 mini subscribe to the mqtt broker and gets a timestamp injected from node-red which was then added to the published sensor data). Humidity data is stored in the "hum" topic, temperature in "temp". Keep in mind that if you plan use more than one senor-node, you should name the topics properly (see: MQTT topics best practices for more information about proper topic nameing) We can now generate our test-flow on the node-red webpage (See printscreen). Subscribe to the mqtt topics and publish it on the chart and gauge (more information about Dashboard can be found on: Node-Red & Dashboard). Powering the Wemos and deploy the created flow shoud show us the graphs on 192.168.1.xx:1880/ui/ (see picture) To call me an IoT expert is like someone calling tkaiser a fan of micro USB powered SBCs. According to the MIT licence this HowTo is provided "as is", without warranty etc.
  12. Hello everyone, today I would like to show you how to compile CoovaChilli and Freeradius for a Wifi Hotspot with captive portal on an Orange Pi PC (or PC Plus). I'm writing this because I couldn't find anything related to this topic on the internet, so I wrote this not very detailed guide. wget chmod +x ./ Russian version
  13. Hi All, I recently bought a cheap 16 character, 2 row LCD display from for use with my Orange Pi PC. I got it to work without too much pain, but I thought I would document it here for the benefit of others. Some good instructions are already available on the internet, but there are some tweaks required for the Orange PI. Armbian I believe already has the I2C module compiled into the kernel directly. So no Linux Kernal insmod work required, unlike what many Raspberry PI guides seem to imply. Step 1) Buy the things you will need. 1. You obviously need a 1602 LCD module which also comes with the the I2C converter. You can buy a 1602 LCD and wire it directly to the 16 GPIO pins required if you want, but that isn't the point of this guide. 2. You will need a level shifter. The LCD display works on +5volts. The OrangePI/H3 GPIO pins are 3.3 volts. I have seen guides stating that you don't need a level shifter, but I'm sure you're slowly frying some transistors in your OrangePI over time. 3. You will need a bunch of jumper cables etc. Like these, female to female only required really. Step 2) Wire things up accordingly. Thanks to this fantastic guide, the instructions on wiring the Orange PI to the Level Shifter LV ('low voltage') pins, and then the Level Shifter HV ('high voltage') pins to the 1602 I2C module is pretty clear: Level Shifter OrangePI 1602 I2C Backpack LV 3.3V (pin 1) – LV1 SDA (pin 3) – LV2 SCL (pin 5) – GND GND (pin 6) GND HV 5V (pin 2) VCC HV1 SDA HV2 SCL Note, you connect the 1602 I2C module/backpack directly to the 5Volt Pin on the PI (Pin 2 or 4) and Ground (Pin 6) respectively. Note: For some strange reason the level shifter works if you don't connect the ground pins to either side of it (i.e. Use the LV, LV1, LV2, HV, HV1 and HV2 pins only). No idea why - electrical engineering degree required I think. If all works well, you should see the LCD module light-up with the top row being a bunch of white bars (you might need to check the contrast setting of the module as well). White bars = uninitialised LCD screen. Step 3) Install the required packages int Armbian Reference: sudo apt-get install -y python-smbus i2c-tools Step 4) Check to see what the address of the LCD Screen is: Reference: user@orangepipc:~/Downloads/i2c$ sudo i2cdetect -y 0 [sudo] password for userpi: 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f 40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- user@orangepipc:~/Downloads/i2c$ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- Looks like it's 0x3f as the address on I2C bus 0 (which is apparently right according to the aliexpress buyer feedback comments) Step 5) Download Example Script Reference: The example script will allow you to send text to the screen via I2C. It is very similar to my scripts for the normal 16×2 screen. To download the script directly to your Pi you can use : wget Step 6) Adjust the Sample Script I need to adjust the script to reference a 1602 LCD device with address 0x3f, on Orange Pi PC I2C Bus, 0. The script as it is references a device of 0x27 on Bus 1 - it won't work. You might have a LCD device of address 0x27 (you'll know from the previous step), but it seems many of the cheap LCD modules from aliexpress are 0x3f for some reason. Adjusted script below: #!/usr/bin/python #-------------------------------------- # ___ ___ _ ____ # / _ \/ _ \(_) __/__ __ __ # / , _/ ___/ /\ \/ _ \/ // / # /_/|_/_/ /_/___/ .__/\_, / # /_/ /___/ # # # LCD test script using I2C backpack. # Supports 16x2 and 20x4 screens. # # Author : Matt Hawkins # Date : 20/09/2015 # # # # Copyright 2015 Matt Hawkins # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <>. # #-------------------------------------- import smbus import time # Define some device parameters I2C_ADDR = 0x3f # I2C device address LCD_WIDTH = 16 # Maximum characters per line # Define some device constants LCD_CHR = 1 # Mode - Sending data LCD_CMD = 0 # Mode - Sending command LCD_LINE_1 = 0x80 # LCD RAM address for the 1st line LCD_LINE_2 = 0xC0 # LCD RAM address for the 2nd line LCD_LINE_3 = 0x94 # LCD RAM address for the 3rd line LCD_LINE_4 = 0xD4 # LCD RAM address for the 4th line LCD_BACKLIGHT = 0x08 # On #LCD_BACKLIGHT = 0x00 # Off ENABLE = 0b00000100 # Enable bit # Timing constants E_PULSE = 0.0005 E_DELAY = 0.0005 #Open I2C interface bus = smbus.SMBus(0) # Rev 1 Pi uses 0 (and Orange PI PC, for pins 3 and 5) #bus = smbus.SMBus(1) # Rev 2 Pi uses 1 def lcd_init(): # Initialise display lcd_byte(0x33,LCD_CMD) # 110011 Initialise lcd_byte(0x32,LCD_CMD) # 110010 Initialise lcd_byte(0x06,LCD_CMD) # 000110 Cursor move direction lcd_byte(0x0C,LCD_CMD) # 001100 Display On,Cursor Off, Blink Off lcd_byte(0x28,LCD_CMD) # 101000 Data length, number of lines, font size lcd_byte(0x01,LCD_CMD) # 000001 Clear display time.sleep(E_DELAY) def lcd_byte(bits, mode): # Send byte to data pins # bits = the data # mode = 1 for data # 0 for command bits_high = mode | (bits & 0xF0) | LCD_BACKLIGHT bits_low = mode | ((bits<<4) & 0xF0) | LCD_BACKLIGHT # High bits bus.write_byte(I2C_ADDR, bits_high) lcd_toggle_enable(bits_high) # Low bits bus.write_byte(I2C_ADDR, bits_low) lcd_toggle_enable(bits_low) def lcd_toggle_enable(bits): # Toggle enable time.sleep(E_DELAY) bus.write_byte(I2C_ADDR, (bits | ENABLE)) time.sleep(E_PULSE) bus.write_byte(I2C_ADDR,(bits & ~ENABLE)) time.sleep(E_DELAY) def lcd_string(message,line): # Send string to display message = message.ljust(LCD_WIDTH," ") lcd_byte(line, LCD_CMD) for i in range(LCD_WIDTH): lcd_byte(ord(message[i]),LCD_CHR) def main(): # Main program block # Initialise display lcd_init() while True: # Send some test lcd_string("RPiSpy <",LCD_LINE_1) lcd_string("I2C LCD <",LCD_LINE_2) time.sleep(3) # Send some more text lcd_string("> RPiSpy",LCD_LINE_1) lcd_string("> I2C LCD",LCD_LINE_2) time.sleep(3) if __name__ == '__main__': try: main() except KeyboardInterrupt: pass finally: lcd_byte(0x01, LCD_CMD) Step 7) ADD YOUR USER ACCOUNT TO 'i2c' GROUP This is a really useful thing to do, otherwise you'll need to run the python script as ROOT (via. sudo etc.) every time. No good if you want to write a python script that runs using your normal user account and sends messages over I2C to the LCD. Reference: sudo adduser <YOUR_USER_ID> i2c eg: sudo adduser johnsmith i2c Step 8) Run your script! python Amazing! Please note: You can probably use a more advanced library to output data to the LCD, but for now, it probably isn't required: (you will need to adjust the code in '' to refer to port=0, not port=1 to get this to work. Also change the address of the LCD device if required) What a level shifter looks like:
  14. If you follow you will get a lot of error-messages. Here is guide to install it on your Orange Pi Pc (Debian Jessie), sudo apt-get install build-essential git autotools-dev autoconf libtool gettext gawk gperf \ antlr3 libantlr3c-dev libconfuse-dev libunistring-dev libsqlite3-dev \ libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev \ libasound2-dev libmxml-dev libgcrypt11-dev libavahi-client-dev zlib1g-dev \ libevent-dev for Armbian you need some little extras installed sudo apt-get install libcurl4-gnutls-dev sudo apt-get install libjson0 libjson0-dev sudo apt-get install avahi-daemon avahi-discover libnss-mdns then you run git clone cd forked-daapd autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var make sudo make install create the new user sudo adduser daapd adjust the settings for your music-path in /etc/forked-daapd.conf on my Orange Pi, the file /etc/init.d/forked-daapd was missing. If yours is missing, too, just add it: sudo nano /etc/init.d/forked-daapd and copy this text inside: #! /bin/sh ### BEGIN INIT INFO # Provides: forked-daapd # Required-Start: $local_fs $remote_fs $network $time avahi # Required-Stop: $local_fs $remote_fs $network $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: media server with support for RSP, DAAP, DACP and AirTunes # Description: forked-daapd is an iTunes-compatible media server for # sharing your music library over the local network with RSP # clients like the SoundBridge from Roku and DAAP clients like # iTunes. It can also stream music to AirTunes devices. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/forked-daapd NAME=forked-daapd DESC="RSP and DAAP media server" test -x $DAEMON || exit 0 PIDFILE=/var/run/$ set -e running_pid() { # Check if a given process pid's cmdline matches a given name pid=$1 name=$2 [ -z "$pid" ] && return 1 [ ! -d /proc/$pid ] && return 1 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` # Is this the expected child? [ "$cmd" != "$name" ] && return 1 return 0 } running() { # Check if the process is running looking at /proc # (works for all users) # No pidfile, probably no daemon present [ ! -f "$PIDFILE" ] && return 1 # Obtain the pid and check it against the binary name pid=`cat $PIDFILE` running_pid $pid $DAEMON || return 1 return 0 } force_stop() { # Forcefully kill the process [ ! -f "$PIDFILE" ] && return if running ; then kill -15 $pid # Is it really dead? if running ; then kill -9 $pid if running ; then echo "Cannot kill $NAME (pid=$pid)!" exit 1 fi fi fi rm -f $PIDFILE return 0 } case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- $DAEMON_OPTS if running ; then echo "$NAME." else echo " ERROR." fi ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ --exec $DAEMON echo "$NAME." ;; force-reload) start-stop-daemon --stop --test --quiet --pidfile \ /var/run/$ --exec $DAEMON \ && $0 restart \ || exit 0 ;; restart) PID=$(cat $PIDFILE 2> /dev/null || true) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --oknodo --pidfile \ /var/run/$ --exec $DAEMON if [ -n "$PID" ]; then while running_pid $PID $DAEMON; do echo -n "."; sleep 1; done fi start-stop-daemon --start --quiet --pidfile \ /var/run/$ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; status) echo -n "$NAME is " if running ; then echo "running" else echo " not running." exit 1 fi ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0 Save it. Now we need to allow the service access to it´s own database: sudo chown -R daapd /var/cache/forked-daapd Start the service: sudo /etc/init.d/forked-daapd restart tail -f /var/log/forked-daapd.log you should see some activity on the log-file. After the scanning is complete, you can see your Orange Pi music-server in iTunes. Automatic updates for the music-server (e.g. at 4am in the morning, necessary if you use a network-share for the data): sudo crontab -e and add the line 0 4 * * * touch /{path to your music}/trigger.init-rescan
  15. Relax - Wireless is solved for OPI ONE There seems to be a lot of confusion and missing information on how to access the dirt cheap OPI ONE wirelessly and the steps necessary to successfully use cheap Realtek USB dongles ( 8188cus, 8188eu ) with Armbian_5.10. This is a short summary of the needed materials and steps to turn your OPI ONE into a wireless client or wireless AP. There are NO custom kernels, custom modules or anything else needed, we are using stock Armbian_5.10 with stock kernel, stock modules and stock software to configure wireless access for select tested and working Realtek wifi dongles. Follow the steps without variation. Once you get wifi working you may adapt setup/configuration to your specific needs Prerequisites - OPI ONE with quality power supply 5V/2A - MicroSD ( 4G or higher ) with stock Armbian_5.10 installed per official instructions - Supported wifi USB dongle - LAN connection to host computer ( preferrably notebook running Linux ) for needed setup/configuration - WLAN-router accessible from host computer to test wireless connections. General procedure to set up wireless on OPI ONE - Set up your OPI ONE with basic Armbian_5.10 and configure a static IP LAN-address - Access OPI ONE via ssh from your host computer - Plug in wireless dongle and load correct driver module - check capabilities of wifi dongle (iw list) - configure wpa_supplicant for client mode - configure hostapd for AP mode >>> all configurations will be minimal without added automagic complexities ( bridges, DHCP etc...) OPI ONE wireless client Module 8192cu works with Realtek 8188CUS dongles and provides a wireless interface wlan0 ready to be configured in managed mode with wpa_supplicant. nano /etc/modules-load.d/modules.conf ===================================== #8189es 8192cu nano /etc/network/interfaces (adapt to your network setup) ========================================================== auto lo iface lo inet loopback #----- lan interface ( standard maintenance connection via ssh ) allow-hotplug eth0 iface eth0 inet static address netmask network #----- Realtek 8192cu wlan interface client ( access defined in /etc/wpa_supplicant/wpa_supplicant.conf ) allow-hotplug wlan0 iface wlan0 inet static address netmask network broadcast gateway dns-nameservers dns-nameservers wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf nano /etc/wpa_supplicant/wpa_supplicant.conf ============================================ ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="<your_ssid>" psk="<your_password>" key_mgmt=WPA-PSK priority=99 } After restarting OPI ONE it should be connected to your configured wireless router and accessible under the static IP. Wireless connection is working now and the rest is up to your hopefully wild imagination and creativity. Tested working dongles RTL8188CUS cheap no-name dongle from Aliexpress ( < $2 ) Bus 002 Device 003: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter RTL8188CUS Edimax EW-7811Un high quality dongle ( $10 ) Bus 001 Device 008: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] Wifi performance is not stellar, but definitely adequate. Under ideal conditions ( same room as router, little interference ) speeds of 80mbps ( measured with iperf ) can be expected. Crossing two walls at 20m distance from router the signal was still usable yielding 20mbps. OPI ONE access point + wireless client Surprise : You were asking for AP mode and now you are getting AP deluxe with an extra client interface for free. Module 8188eu works with Realtek 8188EU dongle and provides TWO wireless interfaces : wlan0 is ready to be configured in AP mode with hostapd and wlan1 in managed mode with wpa_supplicant. When the dongle is plugged in and the driver correctly loaded, iw list will enumerate the drivers parameters for the two new interfaces. iwconfig will show wlan0 and wlan1. nano /etc/modules-load.d/modules.conf ===================================== #8189es 8188eu nano /etc/default/hostapd ========================= DAEMON_CONF="/etc/hostapd.conf" nano /etc/network/interfaces ============================ auto lo iface lo inet loopback #----- lan interface ( standard maintenance connection via ssh ) allow-hotplug eth0 iface eth0 inet static address netmask network #----- Realtek 8188eu wlan interface AP ( access defined in /etc/hostapd.conf ) allow-hotplug wlan0 iface wlan0 inet static address netmask network #----- Realtek 8188eu wlan interface client ( access defined in /etc/wpa_supplicant/wpa_supplicant.conf ) allow-hotplug wlan1 iface wlan1 inet static address netmask network broadcast gateway dns-nameservers dns-nameservers wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf nano /etc/hostapd.conf ====================== ssid=<your-OPI-ONE-ssid> interface=wlan0 hw_mode=g channel=5 driver=nl80211 logger_syslog=0 logger_syslog_level=0 wmm_enabled=1 ieee80211n=1 wpa=3 preamble=1 #wpa_psk=66eb31d2b48d19ba216f2e50c6831ee11be98e2fa3a8075e30b866f4a5ccda27 wpa_passphrase='12345678' wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP auth_algs=1 macaddr_acl=0 noscan=1 #ht_capab=[HT40-][sHORT-GI-40][sHORT-GI-40][DSSS_CCK-40] country_code=<your country code> #ieee80211d=1 nano /etc/wpa_supplicant/wpa_supplicant.conf ============================================ ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="<your-router-ssid>" psk="<your-router-password>" key_mgmt=WPA-PSK priority=99 } After restarting OPI ONE it should be connected to your configured wireless router and accessible under the static IP. On your notebook the newly created OPI ONE access point should be visible when scanning. Specify a static IP for the link and connect using the chosen password ( e.g. '12345678' ) . Feel like a hero, empty a sixpack and order more pizza.... Wireless connection is working now and the rest is up to your hopefully wild imagination and creativity. Tested working dongle for AP mode : RTL8188EU cheap no-name dongle from Aliexpress ( $2.20 ) Bus 001 Device 009: ID 0bda:0179 Realtek Semiconductor Corp. ( noname identified as 8188EU ) Wifi performance with both interfaces active is surprisingly good. Under ideal conditions ( same room as router, little interference ) speeds of 60 (client) / 30 (AP) mbps can be expected. Crossing two walls at 20m distance from router signals were still usable yielding 20 (client) / 5 (AP) mbps. Troubleshooting Most of the problems encountered while setting up WIFI are caused by inadequate or overly complicated testing setups, procedures and rampant wild guesses. Keep it simple and solve one problem at a time. As a stable datum you should realize that the procedures outlined above DO WORK and have been adequately TESTED and RETESTED.. Solution No. 1 : Follow the steps outlined Solution No. 2 : Find out where you did not follow the steps outlined Solution No. 3 : Find out what you added to the steps outlined Solution No. 4 : Reiterate Good luck with your wireless OPI ONE, enjoy and flood the forum with working solutions.
  16. Hallo, this Mini-Howto describes how to change the behavior of the onboard LEDs during booting. There are many ways to do that. Two ways are shown here, a SysV style using /etc/rc.local and a systemd style using a configuration file in /etc/tmpfiles.d/. The systemd file is earlier interpreted than rc.local. It is tested on Banana Pi M1*/M2/R1 with Debian jessie next (5.0x, 4.4.x). * partly Which LEDs could be accessed? root@bananapim2:~# ls -1 /sys/class/leds/ bpi-m2:blue:usr bpi-m2:green:usr bpi-m2:red:usr * The Banana Pi M1 lists the blue LED but it couldn't be set via /etc/tmpfiles.d/ or /etc/rc.local. Which behaviors are possible? root@bananapim2:~# cat /sys/class/leds/bpi-m2\:green\:usr/trigger none rc-feedback kbd-scrollock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock usb-gadget usb-host [mmc0] heartbeat cpu0 cpu1 cpu2 cpu3 default-on mmc1 rfkill0 Edit /etc/rc.local to set the behavior of the onboard LEDs root@bananapim2:~# cat /etc/rc.local #!/bin/sh -e echo "default-on" > /sys/class/leds/bpi-m2\:red\:usr/trigger echo "mmc0" > /sys/class/leds/bpi-m2\:green\:usr/trigger echo "heartbeat" > /sys/class/leds/bpi-m2\:blue\:usr/trigger exit 0 or edit /etc/tmpfiles.d/leds.conf. root@bananapim2:~# cat /etc/tmpfiles.d/leds.conf w /sys/class/leds/bpi-m2:red:usr/trigger - - - - default-on w /sys/class/leds/bpi-m2:green:usr/trigger - - - - mmc0 w /sys/class/leds/bpi-m2:blue:usr/trigger - - - - heartbeat /etc/rc.local can be executed on the console, /etc/tmpfiles.d/leds.conf needs a reboot. A third way may be to create systemd rules. But it doesn't work for me. root@bananapim2:~# udevadm info -a -p /sys/class/leds/bpi-m2\:red\:usr [snip] looking at device '/devices/platform/leds/leds/bpi-m2:red:usr': KERNEL=="bpi-m2:red:usr" SUBSYSTEM=="leds" DRIVER=="" ATTR{brightness}=="255" ATTR{max_brightness}=="255" ATTR{trigger}=="none rc-feedback kbd-scrollock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock usb-gadget usb-host mmc0 heartbeat cpu0 cpu1 cpu2 cpu3 [default-on] mmc1 rfkill0 " [snip] root@bananapim2:~#nano /etc/udev/rules.d/10-leds.rules For setting the LEDs via dts files, have a look at this discussion: Regards, Steve
  17. What shall moderators do on our forum. Basics: - job should be invisible - spam control and clean up (rare) - approve posts from new users (daily) - Warning: editing topic tittle change it's URL - move topic to appropriate forum (rare) (tick "Leave a link to the new location" - it deletes auto in 30 days) recognise and tag tutorials & researches. Move them into "Research Guides & Tutorials" - merge, pin and lock topics (rare, with caution) - cut and move posts to new topics (rare, with caution) Intermediate: - Warn User for: spamming, inappropriate language, signature violation, abusive behaviour, topic bumping. Stop being a moderator: - when you don't want - on multiple complains To study and add more:
  18. Here is a short instruction how to enable S/PDIF digital audio output on NanoPI M1 board running Debian Jessie with legacy kernel. This instruction can be applied to other H3 based boards but connect S/PDIF output hardware to GPIOA17 can be tricky (soldering miniature camera connector pins). Operations can be done over serial console or ssh. Login as root Get a .fex file and open it in editor: bin2fex /boot/script.bin /tmp/script.fex nano /tmp/script.fex Search a csi0 (camera) section an disable it: [csi0] vip_used = 0 Search a S/PDIF section and enable it: [spdif0] spdif_used = 1 Get the name of the file pointed by the /boot/script.bin link and convert modified .fex to it: ls -la /boot/script.bin ----- /boot/script.bin -> bin/nanopim1.bin fex2bin /tmp/script.fex /boot/bin/nanopim1.bin Open /etc/modules to instruct Jessie to load S/PDIF modules at boot: nano /etc/modules Add module names near the end of file: sunxi_spdif sunxi_spdma sndspdif sunxi_sndspdif Reboot system: sync reboot After reboot login as root again Get the list of ALSA devices available: aplay -l **** List of PLAYBACK Hardware Devices **** card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: sndspdif [sndspdif], device 0: SUNXI-SPDIF sndspdif-0 [] Subdevices: 0/1 Subdevice #0: subdevice #0 To connect board S/PDIF output to my favorite DAC i use an optical S/PDIF module soldered out from dead DVD player: There are 3 wires connected to board 40-pin connector: GND (pin 6), VDD_5V (pin 2) and SPDIF-OUT/GPIOA17 (pin 26) Module pinout can be found in datasheet,t).pdf Modules come in 2 types: 6-MBit (up to 24 bit / 96KHz) and 15-MBit (up to 24 bit / 192KHz). Most likely from DVD or SAT receiver You get the 6-MBit module. 15-MBit modules can be purchased at Digikey, etc. When listening to music, I faced with spontaneous fadings. This is due to some problem of the CPU speed switching. To this do not happen, I banned the clock frequency of 240 MHz in the /etc/default/cpufrequtils: MIN_SPEED=480000
  19. Questions and answers about powering the Orange Pi Zero using the "Power over Ethernet" option. The aim is to answer community questions about Power Over Ethernet options (both official 802.3af/at and unofficial "PoE" solutions) and to improve the wiki page with these answers: Helpful links: Examples of standards-compliant PoE hardware: 802.3af switch: 100MBit 802.3af to 5V power supply (10W max): Gigabit 802.3af to 12/9/5V power supply (12W max): Examples of non-standards-compliant PoE hardware: 8 port "PoE" injector (you pick the input voltage): "PoE" splitter: (Zero soldering option!) Solder to pads on Orange Pi Zero and use a DC-DC step down converter to get 5V: Q&A: 1. The Orange Pi Zero says it supports "PoE" how is this implemented? The Ethernet port on the Orange Pi Zero exposes pins 4/5 and 7/8 via pads on the bottom of the board. Photo here. Note that this is 802.3af mode B, which is not fully standards compliant (802.3af/at specifies mode A and mode B, it is not allowed to have a device which only accepts one mode). Out of the box, there is NO way to power the board from Ethernet, either with an 802.3af/at switch or with passive "PoE" injectors. More effort is needed. 2. What are the options to power the Orange Pi with "PoE" ? Option 1: Solder 0 Ohm resistors across the pads and use a PoE injector with 5V. Pro: + No additional power supply needed Con: - 5V cannot travel long distances without voltage sag. You can put in a higher voltage (e.g. 7V DC) but then all the cables would need to be the same length and you risk destroying the Orange Pi if the voltage spikes. Option 2: Solder a step-down converter and use a PoE injector with a higher voltage (e.g. 24V). Pro: + 24V will travel much farther than 5V in a CAT5/6 cable. Cons: - You will need to purchase and solder an additional voltage regulator to take the input voltage and drop it down to 5V. Option 3: Buy/use a PoE switch implementing 802.3af/at. Pro: + Standards compliant + 802.3af/at operate at ~48V, which can power devices up to 100m away from the switch + Plugging in a non-PoE device will not result in fireworks + Cable faults will not result in short circuits because the switch will shut down the port Con: - Power electronics to turn 48V into 5V may consume more power than the Orange Pi itself - More expensive
  20. Requirements Fresh enough nighly or manually built image Latest kernel and dtb packages (26.03.2017 or newer) Limitations As stated in other PWM related threads, hardware PWM output is supported only on pin PA5 which is also UART0 ("debug" serial console) RX pin, so enabling PWM will disable this console. Activation Add "pwm" to "overlays" line in /boot/armbianEnv.txt Example: overlays=pwm Reboot is required to apply the changes Armbian overlays documentation: PWM sysfs interface Official documentation: Please note that this ABI is considered "testing" so it may change in the future. Sysfs interface example # activate the PWM. On H3 only 1 PWM is supported, so exporting PWM 0 echo 0 > /sys/class/pwm/pwmchip0/export # set period to 10ms echo 10000000 > /sys/class/pwm/pwmchip0/pwm0/period # set normal polarity. needs to be reset explicitly. Bug? echo "inversed" > /sys/class/pwm/pwmchip0/pwm0/polarity echo "normal" > /sys/class/pwm/pwmchip0/pwm0/polarity # enable the PWM echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable # set duty cycle to 1ms echo 1000000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle Result: # set duty cycle to 2ms echo 2000000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle Result: # set duty cycle to 1us, period to 2us echo 1000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle echo 2000 > /sys/class/pwm/pwmchip0/pwm0/period Result: Please note that some settings needs to be changed in a correct sequence, i.e. you can't set duty cycle higher than period root@orangepiplus2e:~# echo 1000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle root@orangepiplus2e:~# echo 500 > /sys/class/pwm/pwmchip0/pwm0/period -bash: echo: write error: Invalid argument root@orangepiplus2e:~#
  21. Is not important, and is a topic related to desktop environment and I know that armbian is more a server OS than a dektop replacement ... but I'm stuck trying to have all the environment in my mother language, Spanish. I change locale in root user and in the additionally created desktop user, I use dpkg-reconfigure locales locales and also export LANGUAGE=es_ES.UTF-8 but after reboot is again in English. And also when I update and upgrade the system I can see Translation-en logs but never a Translation-es. Is there any chance to do a better localization of the Desktop Environment? Thanks.