Jump to content

skematic

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by skematic

  1. 1 hour ago, martinayotte said:

    Change permissions of /dev/mem ...

    I have changed the permission for group and others to rw (so same permissions as user root)

    @orangepilite:~$ ls -l /dev/mem
    crw-rw-rw- 1 root kmem 1, 1 Nov  8 14:01 /dev/mem

    However I'm stil getting No access to /dev/mem. Also, by opening access to /dev/mem, could there be any safety issues?

  2. I want to use my GPIO pins on my OPi lite. After much research and testing, I have done the following

    - Add user pi to group gpio

    -  Changed /etc/udev/rules.d/99-gpio.rules to

    SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
        chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
        chown -R root:gpio /sys/devices/platform/soc/1c20800.pinctrl/gpiochip0/gpio && chmod -R 770 /sys/devices/platform/soc/1c20800.pinctrl/gpiochip0/gpio;?\
        '"????

    Now, accessing GPIO pins is working fine via bash:

    (env) pi@orangepilite:~$ echo 65 > /sys/class/gpio/export
    (env) pi@orangepilite:~$ echo out > /sys/class/gpio/gpio65/direction
    (env) pi@orangepilite:~$ echo 1 > /sys/class/gpio/gpio65/value

    The LED connected to the corresponding pin lights up nicely.

     

    The problem is using Python to control the pin. I'm using the python module OrangePi.GPIO

    (env) pi@orangepilite:~$ python
    >>> import OPi.GPIO as GPIO
    >>> GPIO.setboard (GPIO.PCPCPLUS)
    >>> GPIO.setmode (GPIO.BOARD)
    >>> GPIO.setup (21, GPIO.OUT)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    RuntimeError: No access to /dev/mem.  Try running as root!

    This error is only there when trying to run the script from user pi. On root it's working fine.

     

    How do I access gpio pins on a non root user in python?

     

  3. 16 minutes ago, martinayotte said:

    Ok ! I'm currently building fresh image for my OPiLite ...

    In the mean time, I think what is missing is, in the phy@1c19400 node, the "usb0_vbus-supply = <phandle>;", where phandle should be the one of your reg_usb0_vbus, which is 0x76 from above post ...

    If that still doesn't work, I will provide DTS from my build later.

    I appreciate your help! I am looking forward to your follow-up.

  4. 17 minutes ago, martinayotte said:

    Right ! But ... I see in the DTS you've provided that it still have 'dr_mode = "otg"; ' instead of 'dr_mode = "host"; ' , it is maybe the reason ...

    Forgot to change it back after I was testing it with different settings! It's now using dr_mode = "host"

     

    root@orangepilite:~$ lsusb
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    root@orangepilite:~$ dmesg |grep musb
    [    4.096047] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [    4.096058] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 9
    [    4.096386] usb usb9: Manufacturer: Linux 4.14.78-sunxi musb-hcd
    [    4.096391] usb usb9: SerialNumber: musb-hdrc.1.auto
    root@orangepilite:~$ dmesg |grep usb0
    [    4.256204] usb0-vbus: disabling

    It still doesn't recognize my usb camera, also no power on the camera leds.

     

    PS: I'm not sure if it matters, but during compiling I get these warnings everytime

    root@orangepilite:/boot/dtb# sudo dtc -I dts -O dtb -o sun8i-h3-orangepi-lite.dtb sun8i-h3-orangepi-lite.dts
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/mmc0@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/mmc0_cd_pin@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/mmc1@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/spdif@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/uart0@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01c20800/led_pins@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01f02c00/ir@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01f02c00/led_pins@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /soc/pinctrl@01f02c00/key_pins@0 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@240000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@480000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@648000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@816000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@912000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@960000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@1008000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@1104000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@1200000000 has a unit name, but no reg property
    Warning (unit_address_vs_reg): Node /opp_table/opp@1296000000 has a unit name, but no reg property

     

  5. 16 minutes ago, martinayotte said:

    It's seems not pointing to PL2 here ...

    First, cCheck the phandle of r_pio that is really 0x16, if not change it to actual value.

    Second, the 0x1 is wrong, it should be 0x0 like I've mentioned, then also the 0x9 which should be 0x2.

     

    BTW, the current values found in "usb0-vbus" seems to be default values for some other Allwinner boards, I don't know which one ...

     

     

    I've looked for r_pio

    r_pio = "/soc/pinctrl@01f02c00";
    pinctrl@01f02c00 {
    			compatible = "allwinner,sun8i-h3-r-pinctrl";
    			reg = <0x1f02c00 0x400>;
    			interrupts = <0x0 0x2d 0x4>;
    			clocks = <0x26 0x3 0x19 0x1a>;
    			clock-names = "apb", "hosc", "losc";
    			gpio-controller;
    			#gpio-cells = <0x3>;
    			interrupt-controller;
    			#interrupt-cells = <0x3>;
    			linux,phandle = <0x35>;
    			phandle = <0x35>;
    
    			ir@0 {
    				pins = "PL11";
    				function = "s_cir_rx";
    				linux,phandle = <0x27>;
    				phandle = <0x27>;
    			};
    
    			r-i2c {
    				pins = "PL0", "PL1";
    				function = "s_i2c";
    				linux,phandle = <0x28>;
    				phandle = <0x28>;
    			};
    
    			led_pins@0 {
    				pins = "PL10";
    				function = "gpio_out";
    				linux,phandle = <0x34>;
    				phandle = <0x34>;
    			};
    
    			key_pins@0 {
    				pins = "PL3";
    				function = "gpio_in";
    				linux,phandle = <0x36>;
    				phandle = <0x36>;
    			};
    		};

    So this means I need the phandle 0x35?
     

    Like you advised, I went back to usb0-vbus and changed its gpio settings to

    gpio = <0x35 0x0 0x2 0x0>;

    After a reboot, I checked dmesg

    @orangepilite:~$ dmesg |grep usb0
    [    4.256055] usb0-vbus: disabling

    I think we made some progress, but unfortunately still not working.

     

    I have attached my current dts file for reference.

    sun8i-h3-orangepi-lite.dts

  6. 1 hour ago, martinayotte said:

    USB0 power is controlled by regulator which need to be turned on using PL2 gpio.

    Do you have any reference to PL2 in the DTS such as the following ?

     

     

    I have found nothing in terms of PL2. But I have usb0-vbus:

    usb0-vbus {
    		compatible = "regulator-fixed";
    		regulator-name = "usb0-vbus";
    		regulator-min-microvolt = <0x4c4b40>;
    		regulator-max-microvolt = <0x4c4b40>;
    		enable-active-high;
    		gpio = <0x16 0x1 0x9 0x0>;
    		status = "disabled";
    		linux,phandle = <0x76>;
    		phandle = <0x76>;
    	};

    I have changed status to "okay", however still no power coming from the micro-usb port.

     

    Dmesg gives

    root@orangepilite:~$ dmesg | grep usb0
    [    4.241321] usb0-vbus: Failed to request enable GPIO41: -517
    [    4.241337] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [    4.243768] usb0-vbus: Failed to request enable GPIO41: -517
    [    4.243776] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [    8.521125] usb0-vbus: Failed to request enable GPIO41: -517
    [    8.521140] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.025385] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.025409] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.246952] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.246968] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.275751] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.275768] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.354033] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.354050] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.409584] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.409604] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.463098] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.463118] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.465650] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.465666] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.719307] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.719317] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.897078] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.897100] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   10.913556] usb0-vbus: Failed to request enable GPIO41: -517
    [   10.913577] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   11.571752] usb0-vbus: Failed to request enable GPIO41: -517
    [   11.571765] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   11.585255] usb0-vbus: Failed to request enable GPIO41: -517
    [   11.585273] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517
    [   11.591695] usb0-vbus: Failed to request enable GPIO41: -517
    [   11.591711] reg-fixed-voltage usb0-vbus: Failed to register regulator: -517

     

  7. The problem

    I have an USB endoscope camera that works fine with my Orange Pi lite's normal USB port.  However I need both USB port for other devices, so I want to connect this same USB camera,  which was orginally marketed as USB otg camera for android phones, using Opi lite's micro usb otg connector.

     

    What have I tried

    - In armbian-config menu, I have enabled usbhost0. I believe this overlay is for the usb otg port, but just to be sure I also enabled usbhost1, usbhost2 and usbhost3.

    - Using dtc I decompiled sun8i-h3-orangepi-lite.dtb into sun8i-h3-orangepi-lite.dtc.

    - In this dtc file, I looked up musb, and changed status = "disabled" to "okay", and added dr_mode = "host", like this

    usb@01c19000 {
    			compatible = "allwinner,sun8i-h3-musb";
    			reg = <0x1c19000 0x400>;
    			clocks = <0x6 0x20>;
    			resets = <0x6 0x11>;
    			interrupts = <0x0 0x47 0x4>;
    			interrupt-names = "mc";
    			phys = <0x18 0x0>;
    			phy-names = "usb";
    			extcon = <0x18 0x0>;
    			status = "okay";
    			linux,phandle = <0x47>;
    			phandle = <0x47>;
    			dr_mode = "host"
    		};

    - Again with dtc, I compiled the dts to dtb file which replaced the old one (I've made backup).

    - After reboot, this seemed to have done something

    root@orangepilite:~$ dmesg |grep musb
    [    4.086014] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [    4.086025] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 9
    [    4.086290] usb usb9: Manufacturer: Linux 4.14.78-sunxi musb-hcd
    [    4.086295] usb usb9: SerialNumber: musb-hdrc.1.auto

    However, when I connect the camera to the usb otg port, it doesn't work. The LED's on the camera doesn't turn on (so there is probably no power coming from the port, also there are no video devices on /dev/.

     

    How do I connect my camera to the micro usb port on Orange pi lite?

  8. I'm trying to connect to my Orange Pi Lite with TightVNC. I installed tightvncserver on my orange pi lite and ran vncserver :1. On my laptop I installed TightVNC viewer and connected, but it gives me following error "Unable to contact settings server" (see attachment for full error). When I press 'Close', the dialog closes but nothing happens. Help please.

     

     

     

    Screenshot (21).png

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines