Jump to content

gounthar

Members
  • Posts

    415
  • Joined

  • Last visited

Posts posted by gounthar

  1. Hi,

     

    would anyone have a recommendation for an I2C temperature sensor working with OrangePi Zero?
    I thought of I2C because it should be pretty straightforward, but if you ever have another setup that works flawlessly, I'm all ears.

  2. Well, there are several different names for the same pins, like PB21 / PA12 or PI3 / PA06 for example.
    On some pins, it gets even more complicated with several functions possible like PI14 SPI0_CS1 / SIM_DET/PA_EINT10 / PA10 / GPIO10.
    I'd like to know what is SIM_DET for example, and what is PA_EINT10, and how to switch functions.
    That's very basic I guess, but I'd like to learn what's under the hood (because it looks like Armbian and/or libraries are taking care of everything).

  3. The second I2C bus worked for the screen.
    Strangely, I had to remove CIR thanks to armbian-config to get the first I2C bus to work again.

    Anyway, I'm still looking for good general documentation about GPIO and the meaning of all these acronyms, if you ever have some.
    Thanks.

  4. Lately, I started writing a few articles on the OrangePi Zero, as I am trying to use it as part of a conference recording tool and to reference what I know about this board on the OrangePi Community docs website.


    Of course, I have to show my command lines, and their results.
     

    I used to post my commands on gist, then use Carbon to generate an image with the commands and their outputs… But that’s quite a lot of boring work…
     

    I then discovered asciinema and the recording that can be transformed into a GIF file thanks to asciicast2gif.
     

    It worked pretty well under Ubuntu for my previous projects, but it was not really practical to launch it, issue an ssh command, and then exit twice before having the recording… and modifying it to get rid of the SSH command.

    Furthermore, GIF are not usable for visually impaired people, so using something like SVG where they could copy and paste would be better in my opinion…
     

    Unfortunately, SVG is not handled by medium, so it will have to be used on other media, like my Ghost instance (not available yet).


    Enters termtosvg. That’s a wonderful tool aimed at producing animated SVG after recording terminal sessions.

    It compiled like a breeze (well, a strong, smelly and cold breeze) on the Zero, so I used it quite intensively (before discovering it could not be used on Medium).

    I then searched for tools able to transform an animated SVG to GIF, so that I would not have to redo all my terminal recordings… and was not able to do so.
     

    There is one library called librsvg that could be used by ffmpeg, but I have not been able to compile it on the Zero, and it’s just an hypothesis, there is no guarantee at all that it could be used to produce GIF files from animated SVG files.

    termtosvg can produce files than can be used by asciinema and then asciicast2gif to produce gif files, but the process is cumbersome and does not work on the Zero. I had to use a X86 Linux machine to do it.
     

    Anyway, with this post, you won’t be able to produce GIF images starting from a terminal recording if you’re using exclusively a Zero, but beautiful animated SVG that you will be able to use on your blog, or anywhere else where animated SVG is supported.
     

    If you’re brave enough to also use an X86 machine, go to the end of this post, and take time to get old before getting your first GIF file.
     

    TermToSVG installation

    TL;DR

    git config --global http.proxy http://proxy-machine:proxy-port
    sudo fallocate -l 1G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo nano /etc/fstab
    git clone https://github.com/nbedos/termtosvg.git
    sudo apt-get install python3-setuptools libxml2-dev libxslt-dev python3-dev python3-pip
    cd termtosvg
    echo "Let's modify the Makefile so that we use python3 and pip3 as I can't get rid of Python2.7.x on this machine..."
    echo "See at https://gist.github.com/gounthar/b1870915710a0437b4e4eb8690e93553#file-makefile-patch"
    make build
    pip3 install dist/termtosvg-0.9.0-py3-none-any.whl

    The real installation process

    Let’s try to install termtosvg on the Zero. First of all, let’s configure the proxy if needed and then get the source code:

    poddingue@orangepizero:~$ git clone https://github.com/nbedos/termtosvg.git
    Cloning into 'termtosvg'...
    remote: Enumerating objects: 99, done.
    remote: Counting objects: 100% (99/99), done.
    remote: Compressing objects: 100% (59/59), done.
    remote: Total 1592 (delta 59), reused 68 (delta 40), pack-reused 1493
    Receiving objects: 100% (1592/1592), 1.37 MiB | 2.08 MiB/s, done.
    Resolving deltas: 100% (930/930), done.
    poddingue@orangepizero:~$ cd termtosvg/
    poddingue@orangepizero:~/termtosvg$ make build
    rm -rf dist && \
    python setup.py sdist bdist_wheel
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
    
    error: invalid command 'bdist_wheel'
    make: *** [Makefile:31: build] Error 1

    Of course, the setuptools module can’t be found. I have not installed/configured Python2 setup tools. But as I had already done if for Python3, I modified the Makefile so that python is now python3, and pip is now pip3:

    PIP=pip3
    PYTHON=python3

    If I had not done it yet, it would have looked that way:

    poddingue@orangepizero:~/termtosvg$ sudo apt-get install python3-setuptools
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Suggested packages:
    	python-setuptools-doc
    The following NEW packages will be installed:
    	python3-setuptools
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 306 kB of archives.
    After this operation, 1,353 kB of additional disk space will be used.
    Get:1 http://httpredir.debian.org/debian buster/main armhf python3-setuptools all 40.8.0-1 [306 kB] Fetched 306 kB in 0s (1,225 kB/s)
    Selecting previously unselected package python3-setuptools.
    (Reading database ... 66711 files and directories currently installed.)
    Preparing to unpack .../python3-setuptools_40.8.0-1_all.deb ...
    Unpacking python3-setuptools (40.8.0-1) ...
    Setting up python3-setuptools (40.8.0-1) ...

    Now that Python setup tools are installed, let’s try it again:

    poddingue@orangepizero:~/termtosvg$ make build
    rm -rf dist && \
    python3 setup.py sdist bdist_wheel
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
    	or: setup.py --help [cmd1 cmd2 ...]
    	or: setup.py --help-commands
    	or: setup.py cmd --help
    
    error: invalid command 'bdist_wheel'
    make: *** [Makefile:31: build] Error 1

    Ok, fair enough, I’ll install wheel thanks to pip.

    pip3 install wheel
    Collecting wheel
    	Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
    Installing collected packages: wheel
    	The script wheel is installed in '/home/poddingue/.local/bin' which is not on PATH.
    	Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed wheel-0.33.6

    And then, as gently suggested by pip3:

    export PATH=/home/poddingue/.local/bin:$PATH

    Ok, let’s try it again:

    poddingue@orangepizero:~/termtosvg$ make build
    rm -rf dist && \
    python3 setup.py sdist bdist_wheel
    running sdist
    running egg_info
    creating termtosvg.egg-info
    writing termtosvg.egg-info/PKG-INFO
    writing dependency_links to termtosvg.egg-info/dependency_links.txt
    writing requirements to termtosvg.egg-info/requires.txt
    writing top-level names to termtosvg.egg-info/top_level.txt
    writing manifest file 'termtosvg.egg-info/SOURCES.txt'
    reading manifest file 'termtosvg.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '__pycache__' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching 'man/*.man.?' writing manifest file 'termtosvg.egg-info/SOURCES.txt'
    running check
    [...]
    Creating tar archive
    removing 'termtosvg-1.0.0' (and everything under it)
    [...]
    running build_scripts
    [...]
    installing to build/bdist.linux-armv7l/wheel
    running install
    running install_lib
    [...]
    Copying termtosvg.egg-info to build/bdist.linux-armv7l/wheel/termtosvg-1.0.0-py3.7.egg-info
    [...]
    adding 'termtosvg-1.0.0.dist-info/RECORD'
    removing build/bdist.linux-armv7l/wheel

    Happy? Not really…

    poddingue@orangepizero:~/termtosvg$ pip3 install dist/termtosvg-1.0.0-py3-none-any.whl
    Processing ./dist/termtosvg-1.0.0-py3-none-any.whl
    Collecting pyte (from termtosvg==1.0.0)
    	Downloading https://files.pythonhosted.org/packages/66/37/6fed89b484c8012a0343117f085c92df8447a18af4966d25599861cd5aa0/pyte-0.8.0.tar.gz (50kB) 100% |████████████████████████████████| 51kB 768kB/s
    Collecting lxml (from termtosvg==1.0.0)
    	Downloading https://files.pythonhosted.org/packages/e4/19/8dfeef50623892577dc05245093e090bb2bab4c8aed5cad5b03208959563/lxml-4.4.2.tar.gz (2.6MB) 100% |████████████████████████████████| 2.6MB 74kB/s
    Collecting wcwidth (from termtosvg==1.0.0)
    	Downloading https://files.pythonhosted.org/packages/58/b4/4850a0ccc6f567cc0ebe7060d20ffd4258b8210efadc259da62dc6ed9c65/wcwidth-0.1.8-py2.py3-none-any.whl
    Building wheels for collected packages: pyte, lxml
    	Running setup.py bdist_wheel for pyte ... done
    	Stored in directory: /home/poddingue/.cache/pip/wheels/c0/dd/4a/d0ec26b9d07a3b48e25ba3456dc9bcab875686af6da9e23fcd
    	Running setup.py bdist_wheel for lxml ... error
    	Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-4whala87/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-w27wrikj --python-tag cp37:
    	Building lxml version 4.4.2.
    	Building without Cython. ERROR: b'/bin/sh: 1: xslt-config: not found\n'
    	** make sure the development packages of libxml2 and libxslt are installed **
    
    	Using build configuration of libxslt
    	running bdist_wheel
    	running build
    	running build_py
    	[...]
    	arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/include/python3.7m -c src/lxml/etree.c -o build/temp.linux-armv7l-3.7/src/lxml/etree.o -w
    	In file included from src/lxml/etree.c:692:
    	src/lxml/includes/etree_defs.h:14:10: fatal error: libxml/xmlversion.h: No such file or directory
    		#include "libxml/xmlversion.h" ^~~~~~~~~~~~~~~~~~~~~
    	compilation terminated.
    	Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    	creating tmp
    	cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitp1a2wq_x.c -o tmp/xmlXPathInitp1a2wq_x.o /tmp/xmlXPathInitp1a2wq_x.c:1:10: 
    	fatal error: libxml/xpath.h: No such file or directory #include "libxml/xpath.h" ^~~~~~~~~~~~~~~~ compilation terminated. *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? *********************************************************************************
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    [...]
    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-4whala87/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-5dypr5tk/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-4whala87/lxml/

    Damn!

    poddingue@orangepizero:~/termtosvg$ sudo apt install libxml2-dev libxslt-dev python3-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
    python3-dev is already the newest version (3.7.3-1).
    The following additional packages will be installed:
    	icu-devtools libicu-dev libxslt1.1
    Suggested packages:
    	icu-doc
    The following NEW packages will be installed:
    	icu-devtools libicu-dev libxml2-dev libxslt1-dev libxslt1.1
    0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
    Need to get 10.5 MB of archives.
    After this operation, 44.6 MB of additional disk space will be used.
    Do you want to continue? [Y/n]
    Get:1 http://httpredir.debian.org/debian buster/main armhf icu-devtools armhf 63.1-6 [168 kB]
    Get:2 http://httpredir.debian.org/debian buster/main armhf libicu-dev armhf 63.1-6 [8,934 kB]
    Get:3 http://httpredir.debian.org/debian buster/main armhf libxml2-dev armhf 2.9.4+dfsg1-7+b3 [718 kB]
    Get:4 http://httpredir.debian.org/debian buster/main armhf libxslt1.1 armhf 1.1.32-2.2~deb10u1 [217 kB]
    Get:5 http://httpredir.debian.org/debian buster/main armhf libxslt1-dev armhf 1.1.32-2.2~deb10u1 [507 kB]
    Fetched 10.5 MB in 5s (2,318 kB/s)
    Selecting previously unselected package icu-devtools.
    (Reading database ... 66802 files and directories currently installed.)
    Preparing to unpack .../icu-devtools_63.1-6_armhf.deb ...
    Unpacking icu-devtools (63.1-6) ...
    Selecting previously unselected package libicu-dev:armhf.
    Preparing to unpack .../libicu-dev_63.1-6_armhf.deb ...
    Unpacking libicu-dev:armhf (63.1-6) ...
    Selecting previously unselected package libxml2-dev:armhf.
    Preparing to unpack .../libxml2-dev_2.9.4+dfsg1-7+b3_armhf.deb ...
    Unpacking libxml2-dev:armhf (2.9.4+dfsg1-7+b3) ...
    Selecting previously unselected package libxslt1.1:armhf.
    Preparing to unpack .../libxslt1.1_1.1.32-2.2~deb10u1_armhf.deb ...
    Unpacking libxslt1.1:armhf (1.1.32-2.2~deb10u1) ...
    Selecting previously unselected package libxslt1-dev:armhf.
    Preparing to unpack .../libxslt1-dev_1.1.32-2.2~deb10u1_armhf.deb ...
    Unpacking libxslt1-dev:armhf (1.1.32-2.2~deb10u1) ...
    Setting up icu-devtools (63.1-6) ...
    Setting up libxslt1.1:armhf (1.1.32-2.2~deb10u1) ...
    Setting up libicu-dev:armhf (63.1-6) ...
    Setting up libxml2-dev:armhf (2.9.4+dfsg1-7+b3) ...
    Setting up libxslt1-dev:armhf (1.1.32-2.2~deb10u1) ...
    Processing triggers for man-db (2.8.5-2) ...
    Processing triggers for libc-bin (2.28-10) ...

    All set? Not so sure…

    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9lgddbtt/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ghyj96g8/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-9lgddbtt/lxml/

    The error may have happened because of low memory. Let’s this machine breathe a little better by giving it more swap:

    sudo fallocate -l 1G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo nano /etc/fstab

    Now, let’s add this line in /etc/fstab.

    /swapfile swap swap defaults 0 0

    Let’s try to install it once again. Go and have a coffee, or go for a walk… You could maybe even take time to marry and start a family before the build finishes. Anyway, after some time, you’ll have your beautiful termtosvg package ready to rock!

    pip3 install dist/termtosvg-1.0.0-py3-none-any.whl
    Processing ./dist/termtosvg-1.0.0-py3-none-any.whl
    Collecting lxml (from termtosvg==1.0.0)
    	Using cached https://files.pythonhosted.org/packages/e4/19/8dfeef50623892577dc05245093e090bb2bab4c8aed5cad5b03208959563/lxml 
    Requirement already satisfied: pyte in /home/poddingue/.local/lib/python3.7/site-packages (from termtosvg==1.0.0) (0.8.0) 
    Requirement already satisfied: wcwidth in /home/poddingue/.local/lib/python3.7/site-packages (from termtosvg==1.0.0) (0.1.8) 
    Building wheels for collected packages: lxml
    	Running setup.py bdist_wheel for lxml ... -
    done
    	Stored in directory: /home/poddingue/.cache/pip/wheels/73/52/7c/5cd696851d3e5e31a05023dd402b04659a6ec695ecc566c9d3
    Successfully built lxml
    Installing collected packages: lxml, termtosvg
    Successfully installed lxml-4.4.2 termtosvg-1.0.0

    This time, it looks like our installation has been successful. Let’s try it for real now.

    Testing

    Just enter termtosvg, do your stuff, and then do exit. You will have a message that will tell you where your newly created file lies.

    That’s cool, but can we do any better? The man page tells us we can record a terminal session with a specific screen geometry:

    termtosvg -g 80x24 animation.svg
    Recording started, enter "exit" command or Control-D to
    end poddingue@orangepizero:~$ echo "Hello, World!"
    Hello, World!
    poddingue@orangepizero:~$ exit
    Rendering ended, SVG animation is animation.svg

    Pretty handy!

    I am recording my casts with a 200x60 geometry, exporting them in the SVG format. The first step is to record them:

    termtosvg record -g 200x60 whatever-name-I-choose.cast

    I then ask termtosvg to render the cast as SVG, so that I can use them in websites that can handle them:

    termtosvg render whatever-name-I-choose.cast whatever-name-I-choose.svg
    Rendering started
    Rendering ended, SVG animation is whatever-name-I-choose.svg

    Want more? You’re GIF hungry? Ok I resign myself to give you my process, which is not pretty, and requires an X86 machine. As we have seen before, we can record a terminal session in asciicast v2 format. The cast file we have produced during the previous step to generate SVG, can then be used by asciinema (using phantomjs in the background) to produce a GIF file.

    docker pull asciinema/asciicast2gif
    alias asciicast2gif='docker run --rm -v $PWD:/data asciinema/asciicast2gif'
    asciicast2gif -s 2 -t solarized-dark whatever-name-I-choose.cast demo.gif

    And here is the final result (see attachment or here).

     

    And in GIF for the CMS that can’t display properly SVG.

    whatever-name-I-choose.cast.gif

    whatever-name-I-choose[1].svg

  5. Hi there,

     

    I'm looking for a USB power supply that would be mounted into a rack, so that I can power up quite a few boards at the same time.
    These boards would also be in the same rack.
    I found a big rackable USB hub, but that's not what I am looking for, and 2.4A max per slot may be too weak for some of the boards.
    I could hosts several smaller USB hubs too, but that does not sound really enticing.
    My other option is to make it by myself with salvaged server power supplies, a patch panel, bits and bobs, but it will take longer...

    Would you have any recommendation?

    Thanks.

  6. I rebuilt the image today, and I am still stuck at Starting kernel ...

    Spoiler
    
    Hit any key to stop autoboot:  0
    => setenv devnum 1
    => run mmc_boot
    switch to partitions #0, OK
    mmc1 is current device
    Scanning mmc 1:1...
    Found U-Boot script /boot/boot.scr
    2940 bytes read in 43 ms (66.4 KiB/s)
    ## Executing script at 00500000
    Boot script loaded from mmc 1
    139 bytes read in 35 ms (2.9 KiB/s)
    7106982 bytes read in 515 ms (13.2 MiB/s)
    20654592 bytes read in 1378 ms (14.3 MiB/s)
    73823 bytes read in 110 ms (655.3 KiB/s)
    2698 bytes read in 63 ms (41 KiB/s)
    Applying kernel provided DT fixup script (rockchip-fixup.scr)
    ## Executing script at 39000000
    ## Loading init Ramdisk from Legacy Image at 04000000 ...
       Image Name:   uInitrd
       Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
       Data Size:    7106918 Bytes = 6.8 MiB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 01f00000
       Booting using the fdt blob at 0x1f00000
       Loading Ramdisk to 7d839000, end 7df00166 ... OK
       reserving fdt memory region: addr=1f00000 size=78000
       Loading Device Tree to 000000007d7be000, end 000000007d838fff ... OK
    
    Starting kernel ...
    

     

    I guess my board may be faulty.

  7. Hi there,

     

    I'm trying to better understand GPIO (in general) and to use what's available on the OrangePi Zero with Armbian.
    For the time being, I managed to get an I2C screen to work.
    Now, I'm about to try InfraRed (before using SPI). I already have the OrangePi extension hat (somewhere in the office), but it won't be really handy, as the IR receiver could be a feet away from the board, so I thought of using a general purpose IR receiver.

    I know there is a module pack listed on OrangePi store, but I'd like to get just the IR part...
    Is there a schema somewhere that lists the kind of circuit and part I should get? I was not able for the time being to find one (as it is easier to just put the hat on).
    The board can just receive, and not send IR, did I get it right?

    Thanks in advance.

  8. I finally found what I was looking for: https://www.reichelt.de/2-x-13-pin-header-angled-pitch-2-54-sl-2x13w-2-54-p19491.html?&trstct=pol_10.
    I attached the screen, and got everything working a few minutes later.
    I still have questions though. When I search for the Zero's GPIO, I find different versions of the schema (OrangePi documentation, OSHLAB.com, ...). i2c is well detected:

    sudo i2cdetect -y 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    I can find several i2c ports available:

    poddingue@orangepizero:~$ ls /dev/i2c*
    /dev/i2c-0  /dev/i2c-1  /dev/i2c-2

    But I can't find any other i2c chip on the other ports:

     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: -- -- -- -- -- -- -- --
    poddingue@orangepizero:~$ sudo i2cdetect -y 2
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

     

    The gpio utility gives me some information, but it looks like other i2c are available on ports (27, 28) that are not available on the board (as we only have 26, and not 40). Did I get it right? On the OSHLAB.COM schema, there are also i2c on the 16th and 18th pins...
    Or is there a way to reconfigure some of the available pins so that they are i2c?

    gpio -1 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 | 0 | 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 | ALT3 | 0 | 19 || 20 |   |      | 0v       |     |     |
     |  65 |  13 |     MISO | ALT3 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
     |  66 |  14 |     SCLK | ALT3 | 0 | 23 || 24 | 0 | ALT3 | 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 |  OUT | 1 | 37 || 38 | 0 | ALT5 | TxD1     | 28  | 198 |
     |     |     |       0v |      |   | 39 || 40 | 0 | ALT5 | RxD1     | 29  | 199 |
     +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
     | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
     +-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+

    If you know a place where there is a definitive documentation about those pins, and the meaning of all these acronyms, I'm all ears.

    Thanks.

  9. Hi,

     

    I've been using a lot redsocks with iptables to be able to stream to YouTube since last June on an X86 Ubuntu machine.
    I have a set of iptables rules that work for me on this machine.

    I imported them on my OrangePi One running Armbian Linux orangepione 5.4.2-sunxi #19.11.4.352 SMP Wed Dec 18 00:58:18 CET 2019 armv7l GNU/Linux.

    Unfortunately, it did not work, maybe because of the news nftables. So I chose to use the legacy iptables

    Spoiler
    
    update-alternatives --set iptables /usr/sbin/iptables-legacy
    update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
    update-alternatives --set arptables /usr/sbin/arptables-legacy
    update-alternatives --set ebtables /usr/sbin/ebtables-legacy

     

    But it did not work any better. I then reverted the legacy use:

    Spoiler
    
    update-alternatives --set iptables /usr/sbin/iptables-nft
    update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
    update-alternatives: using /usr/sbin/ip6tables-nft to provide /usr/sbin/ip6tables (ip6tables) in manual mode
    update-alternatives --set arptables /usr/sbin/arptables-nft
    update-alternatives --set ebtables /usr/sbin/ebtables-nft

     

    But alas...
    So I exported my current rules, and imported them into nftables:

    Spoiler
    
    iptables-save > save.txt
    iptables-restore-translate -f save.txt > ruleset.nft
    nft -f ruleset.nft

     

    It still does not work. Any idea?

    Thanks.

  10. So I tried this image found on this thread (Single Armbian image for RK + AML + AW), and it goes farther:

    Spoiler
    
       21.071024] rockchip-dmc dmc: Cannot get the regulator "center"
    [   21.075233] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
    [   21.082156] dwmmc_rockchip fe310000.dwmmc: IDMAC supports 32-bit address mode.
    [   21.085584] dwmmc_rockchip fe310000.dwmmc: Using internal DMA controller.
    [   21.088899] dwmmc_rockchip fe310000.dwmmc: Version ID is 270a
    [   21.092092] dwmmc_rockchip fe310000.dwmmc: DW MMC controller at irq 25,32 bit host data width,256 deep fifo
    [   21.095717] dwmmc_rockchip fe310000.dwmmc: No vmmc regulator found
    [   21.098905] dwmmc_rockchip fe310000.dwmmc: No vqmmc regulator found
    [   21.103073] dwmmc_rockchip fe320000.dwmmc: IDMAC supports 32-bit address mode.
    [   21.106413] dwmmc_rockchip fe320000.dwmmc: Using internal DMA controller.
    [   21.109609] dwmmc_rockchip fe320000.dwmmc: Version ID is 270a
    [   21.112675] dwmmc_rockchip fe320000.dwmmc: DW MMC controller at irq 26,32 bit host data width,256 deep fifo
    [   21.116734] rockchip-dmc dmc: Cannot get the regulator "center"
    [   21.120188] console [netcon0] enabled
    [   21.123168] netconsole: network logging started
    [   21.126934] input: gpio-keys as /devices/platform/gpio-keys/input/input1
    

     

    And later today, I always have the infamous "mmc_init: -5, time 4" error when I try the run mmc_boot.
    Go figure. I'm fed up with this card, nothing is stable. When it looks broken (EL3 errors, or kernel panic, or whatever) I can boot on the SDCard, but there isn't any image that boots until the end. When it gets back to life for whatever reason, I can't boot on the SDCard anymore.
    I would just like to install Armbian, or push another version of the existing kernel so that I can at last use the camera.:wacko:

  11. Today's build went farther on the OrangePi RK3399:

    Spoiler
    
    Hit any key to stop autoboot:  0
    => setenv devnum 1
    => run mmc_boot
    switch to partitions #0, OK
    mmc1 is current device
    Scanning mmc 1:1...
    Found U-Boot script /boot/boot.scr
    2940 bytes read in 21 ms (136.7 KiB/s)
    ## Executing script at 00500000
    Boot script loaded from mmc 1
    139 bytes read in 18 ms (6.8 KiB/s)
    6975843 bytes read in 477 ms (13.9 MiB/s)
    20587008 bytes read in 1346 ms (14.6 MiB/s)
    73823 bytes read in 58 ms (1.2 MiB/s)
    2698 bytes read in 32 ms (82 KiB/s)
    Applying kernel provided DT fixup script (rockchip-fixup.scr)
    ## Executing script at 39000000
    ## Loading init Ramdisk from Legacy Image at 04000000 ...
       Image Name:   uInitrd
       Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
       Data Size:    6975779 Bytes = 6.7 MiB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 01f00000
       Booting using the fdt blob at 0x1f00000
       Loading Ramdisk to 7d859000, end 7df00123 ... OK
       reserving fdt memory region: addr=1f00000 size=78000
       Loading Device Tree to 000000007d7de000, end 000000007d858fff ... OK
    
    Starting kernel ...

     

    It is now stuck, but it never got that far previously for me.

  12. I also have a XU4, but my kids love it so much that it is hard to get it back to work on it. :P

    So with the MC1 without any graphic output, I should be able to keep it just for me.

    I got five for about $65 with shipping.
    Not bad!

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines