Jump to content

jps

Members
  • Posts

    26
  • Joined

  • Last visited

Posts posted by jps

  1. Or this one:

    https://www.raspberrypi-spy.co.uk/2018/11/raspberry-pi-7-segment-led-display-module-using-python/

     

    orangepi@orangepiplus2e:~/Adafruit_Python_LED_Backpack$ sudo python3 7segment_counter.py
    Traceback (most recent call last):
      File "7segment_counter.py", line 32, in <module>
        display.begin()
      File "/home/orangepi/Adafruit_Python_LED_Backpack/Adafruit_LED_Backpack/HT16K33.py", line 53, in begin
        self._device.writeList(HT16K33_SYSTEM_SETUP | HT16K33_OSCILLATOR, [])
      File "/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.4-py3.6.egg/Adafruit_GPIO/I2C.py", line 129, in writeList
      File "/home/orangepi/.local/lib/python3.6/site-packages/Adafruit_PureIO/smbus.py", line 364, in write_i2c_block_data
        self._device.write(data)
    OSError: [Errno 6] No such device or address

     

     

    And this one based on SMBus that i installed previously:

    https://github.com/emcconville/HT16K33

     

    sudo python3 clo.py
    
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        ! Unable to load SMBus            !
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        ! Switching to terminal emulation !
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
    Traceback (most recent call last):
      File "clock.py", line 9, in <module>
        from _HT16K33 import FourDigit
    ImportError: cannot import name 'FourDigit'

     

    But does not work either.

  2. I tried this one based on micropython but when i install trought pip returns many errors:

    sudo -H pip3 install adafruit-circuitpython-ht16k33
    ...
     error: invalid command 'bdist_wheel'
    
      ----------------------------------------
      Failed building wheel for Adafruit-Blinka
      Running setup.py clean for Adafruit-Blinka
      Running setup.py bdist_wheel for adafruit-circuitpython-busdevice ... error
    
    ...
    error: invalid command 'bdist_wheel'
    
      ----------------------------------------
      Failed building wheel for adafruit-circuitpython-busdevice
    ...
    
    

     

    And many more. Also it needs busio and board but can't find it. Also i installed adafruit-blinka alone (https://pypi.org/project/Adafruit-Blinka/) what have busio and board drivers, but it doesn't work either. The instalations is success, but after that the code can't find busio or board:

     

    sudo -H pip3 install adafruit-blinka
    Requirement already satisfied: adafruit-blinka in /usr/local/lib/python3.6/dist-packages
    Requirement already satisfied: Adafruit-PlatformDetect>=2.11.1 in /usr/local/lib/python3.6/dist-packages (from adafruit-blinka)
    Requirement already satisfied: Adafruit-PureIO>=1.1.5 in /usr/local/lib/python3.6/dist-packages (from adafruit-blinka)
    Requirement already satisfied: pyftdi>=0.40.0 in /usr/local/lib/python3.6/dist-packages (from adafruit-blinka)
    Requirement already satisfied: sysv_ipc in /usr/local/lib/python3.6/dist-packages (from adafruit-blinka)
    Requirement already satisfied: pyusb>=1.0.0 in /usr/local/lib/python3.6/dist-packages (from pyftdi>=0.40.0->adafruit-blinka)
    Requirement already satisfied: pyserial>=3.0 in /usr/local/lib/python3.6/dist-packages (from pyftdi>=0.40.0->adafruit-blinka)
    
    orangepi@orangepiplus2e:~$python3 -m pip install -U --user pip gpiod
    Collecting pip
      Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
        100% |████████████████████████████████| 1.5MB 185kB/s
    Collecting gpiod
      Downloading https://files.pythonhosted.org/packages/8e/9c/3818182fa32fd5db2a42be9c340d3d6accf8c256befc741c0a59d61d582c/gpiod-1.2.5.tar.gz
    Building wheels for collected packages: gpiod
      Running setup.py bdist_wheel for gpiod ... error
      Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kdvfombf/gpiod/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/tmpkfkkyv80pip-wheel- --python-tag cp36:
      usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: -c --help [cmd1 cmd2 ...]
         or: -c --help-commands
         or: -c cmd --help
    
      error: invalid command 'bdist_wheel'
    
      ----------------------------------------
      Failed building wheel for gpiod
      Running setup.py clean for gpiod
    Failed to build gpiod
    Installing collected packages: pip, gpiod
      Running setup.py install for gpiod ... done
    Successfully installed gpiod-1.2.5 pip-20.1.1
    orangepi@orangepiplus2e:~$ sudo python3 ddd.py
    Traceback (most recent call last):
      File "ddd.py", line 9, in <module>
        import board
      File "/home/orangepi/.local/lib/python3.6/site-packages/board.py", line 93, in <module>
        from adafruit_blinka.board.orangepi.orangepipc import *
      File "/home/orangepi/.local/lib/python3.6/site-packages/adafruit_blinka/board/orangepi/orangepipc.py", line 3, in <module>
        from adafruit_blinka.microcontroller.allwinner.h3 import pin
      File "/home/orangepi/.local/lib/python3.6/site-packages/adafruit_blinka/microcontroller/allwinner/h3/pin.py", line 4, in <module>
        PA0 = Pin(0)
      File "/home/orangepi/.local/lib/python3.6/site-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 34, in __init__
        self._chip = gpiod.Chip("gpiochip0", gpiod.Chip.OPEN_BY_NAME)
    AttributeError: module 'gpiod' has no attribute 'Chip'
    
    

    I think i tried everithing... I don't know where to go....

    Thank you for your response.

     

  3. Is it even possible to run the 7-segment HT16K33 module with Armbian and Orange Pi?

     

    I'm trying with I2C and SMBus2 but can not make it work. I can see the module, but it is imposible to communicate with it:

     

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

    Any help will be apreciated. Thank you in advance.

  4. 16 hours ago, martinayotte said:

    You should not place any W1 driver in /etc/modules-load.d/modules.conf ...

    You should rely on DT overlays : https://docs.armbian.com/User-Guide_Allwinner_overlays/

    ... and more specially to H3 W1-Bus overlay parameters : https://github.com/armbian/sunxi-DT-overlays/blob/master/sun8i-h3/README.sun8i-h3-overlays#L231,L250

     

    Yes. Thank you martinayotte. If sombody needs that, i just have to add this lines to '/boot/armbianEnv.txt'

    overlays=w1-gpio
    param_w1_pin=PA20
    param_w1_pin_int_pullup=1

    and works like a charm! Thank you very much.

  5. Hi. Recently i upgraded to Armbian_5.65_Orangepilite_Debian_stretch_next_4.14.78 and i have two problems. I can not read the thermal zones properly with neither of those:

    cat /sys/class/thermal/thermal_zone0/temp
    cat /sys/devices/virtual/thermal/thermal_zone0/temp
    cat /etc/armbianmonitor/datasources/soctemp

    because i have results like "30371". But when the system starts the correct temperature is displayed:

    Welcome to ARMBIAN 5.73 stable Debian GNU/Linux 9 (stretch) 4.19.20-sunxi
    System load:   0.07 0.15 0.10   Up time:       10 min
    Memory usage:  29 % of 493MB    IP:            192.168.1.46
    CPU temp:      33°C
    Usage of /:    10% of 15G

    and with armbianmonitor too:

     

    Time        CPU    load %cpu %sys %usr %nice %io %irq   CPU  C.St.
    
    17:39:34: 1200MHz  0.06   3%   1%   1%   0%   0%   0% 34.6°C  0/15
    17:39:39:  480MHz  0.06   1%   0%   0%   0%   0%   0% 31.5°C  0/15
    17:39:45:  480MHz  0.13   4%   3%   0%   0%   0%   0% 31.8°C  0/15

    My second problem is that my DS18B20 sonda does not work anymore. In /etc/modules-load.d/modules.conf i have:

    w1-sunxi
    w1-gpio
    w1-therm

    but there is nothing in /sys/bus/w1/devices/
     

    is there any changes in this new version? I check the forum but i does not found anything. Any iddeas?

     

    Thanks in advance.

     

  6. On 9/9/2018 at 3:22 PM, Ucino said:

    Cool if it works.

     

    Sorry I didn't remember about the content of gc2035 on github . If it's works fine for you, maybe you have nothing to do ?  Why do you think you have to care about it, maybe  you have some other problems with the video ?

    But... I still have the doubt that what to do with the content of https://github.com/avafinger/gc2035...........

     

    I mean ... i don't know how to build a module. Anyway, all it's working, so thanks.

  7. On 9/6/2018 at 1:40 PM, Ucino said:

    Thanks for your feedback. As olivluca suggest, I think the first step you can try to do is using the 3.X kernel : https://www.armbian.com/orange-pi-lite/ at the end of the page : https://dl.armbian.com/orangepilite/Ubuntu_xenial_default_desktop.7z

    Yes, 3.X kernel have the drivers. Works fine. Thank you.

     

    But... but I still have the doubt that what to do with the content of https://github.com/avafinger/gc2035.

    Thank again.

  8. Hi. I am triyng to make Live Streaming for youtube with a HP Webcam, a Orange Pi Plus2e ethernet connected and Armbian but I can not make it work.

    I tried with FFMPEG and Aconv and I can see that the video is called, seems to work and I can see the statistics, but the stream does not arrive to youtube servers....

     

    OBS Studio does not work.

    Any iddeas suggestions?
    Thank you in advance

  9. By the way, in my rc.local i have other scripts that runs normally:

     

    #!/bin/sh -e
    
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    /etc/init.d/entrehoras.sh
    # CÁMARA HP
    /etc/init.d/runmjpg.sh
    # Cámara GEMBIRD
    #/etc/init.d/runmjpgGEMBIRD.sh
    nohup python /home/orangepi/scripts/botones.py > /tmp/botones.log 2>&1
    #/etc/init.d/botones.sh
    exit 0

     

  10. Well, now the consume of CPU lower to 0,1%... thank you very much.

     

    BUT... still dying. The file is in /etc/init.d/ and have +x permission. The file starts but after a while dies.... The Python file is called "botones.py". In syslog:

     

    Nov  7 16:31:03 localhost systemd[1]: botones.py.service start operation timed out. Terminating.
    Nov  7 16:31:03 localhost rsyslogd-2007: action 'action 17' suspended, next retry is Tue Nov  7 16:31:33 2017 [try http://www.rsyslog.com/e/2007 ]
    Nov  7 16:31:03 localhost systemd[1]: Failed to start (null).
    Nov  7 16:31:03 localhost systemd[1]: Unit botones.py.service entered failed state.

    If i run from the monitor, never dies....

  11. Hi. I have made a system with O Pi Lite and Armbian to automate an aquarium from where to control the light, the bubbles and with a webcam I can see the system through the web, everything automated from Cron. From a web page I can turn on and off the lights and bubbles from web buttons. Everything is fine.

    The problem arises when I want to put some phisical buttons for 3 things: turn off the system, change the state of light and bubbles. I have used a code in Python and the PYA20 library. This is the code. It works very well, but when I start it with the system, the program stop working soon and the buttons stop to work.

     

    #!/usr/bin/env python
    from pyA20.gpio import gpio
    from pyA20.gpio import port
    import subprocess
    import time
    import os
    
    # PIN 29 - IN Light (luz)
    onoff = port.PA7
    # PIN 7  - IN Bubbles (burbujas)
    luzboton = port.PA6
    # PIN 8  - IN Shutdown
    burbujasboton = port.PA13
    # OUT Pins
    luzvivo = port.PA8
    burbujasvivo = port.PA9
    
    gpio.init()
    #Button ON-OFF
    gpio.setcfg(onoff, gpio.INPUT)
    gpio.pullup(onoff, gpio.PULLUP)
    #Button light
    gpio.setcfg(luzboton, gpio.INPUT)
    gpio.pullup(luzboton, gpio.PULLUP)
    #Button bubbles
    gpio.setcfg(burbujasboton, gpio.INPUT)
    gpio.pullup(burbujasboton, gpio.PULLUP)
    # OUT
    gpio.setcfg(luzvivo, gpio.OUTPUT)
    gpio.setcfg(burbujasvivo, gpio.OUTPUT)
    
    while True:
        # PROCESS ON-OFF need 5 seconds to avoid mistaken shutdowns
        if gpio.input(onoff) == 0:
            #start counting pressed time
            print ("pulsado")
            time.sleep(5)
            if gpio.input(onoff) == 0 :
                os.system("shutdown now -h")
    
        # PROCESS LIGHT
        if gpio.input(luzboton) == 0:
            print ("pulsado luz")
            estadoluz = gpio.input(luzvivo)
            gpio.output(luzvivo, not estadoluz)
            time.sleep(1)
    
        # PROCESS bubbles
        if gpio.input(burbujasboton) == 0:
            print ("pulsado bubbles")
            estadoburbujas = gpio.input(burbujasvivo)
            gpio.output(burbujasvivo, not estadoburbujas)
            # To avoid bounce
            time.sleep(1)

    If i check the procces, i can see it, but i can also see that consumes a lot of CPU:

     

    ps aux | grep botones
    root       652 95.1  0.6   8552  3412 ?        Rs   10:53   2:36 python /etc/init.d/botones.py start

    What i am doing wrong?

     

    Thank you in advance.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines