Kwan Xian

Members
  • Content Count

    11
  • Joined

About Kwan Xian

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. SOLVED: Because PC2 GPIO pins is different. change SPI0 to SPI1 edit /boot/armbianEvn.txt "param_spidev_spi_bus=0" --> "param_spidev_spi_bus=1" save!
  2. HI, guys! I tried to enable spi connect RC522 on OPi_PC(H3). It works! my topic: but now, I make the same way to enable spi with RC522 on OPi_PC2(H5). I can found spi on "/dev/spidev0.0" But when I run "Read.py" script as root. It can't detect & read the cards. How can i use it on OPi_PC2?
  3. Requirements: https://github.com/lthiery/SPI-Py https://github.com/mxgxw/MFRC522-python (for Raspberry Pi) https://github.com/kwanxian/OrangePiPC/tree/master/SPI/RC522 (for Orange Pi PC) sudo armbian-config System --> Hardware --> select "spi-spidev" --> Confirm --> reboot when reboot finish: sudo vim /boot/armbianEnv.txt under "overlays=spi-spidev",add this: "param_spidev_spi_bus=0" save & reboot again. then you can see spi enable in "/dev/spidev0.0". cd ./SPI_Python sudo python3 setup.py install cd ../RC522 sudo python3 Read.py you can test IC card like this: Welcome to the MFRC522 data read example Press Ctrl-C to stop. Card detected Card read UID: 53,101,232,169 Size: 8 Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Card detected Card read UID: 53,101,232,169 Size: 8 Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  4. Kwan Xian

    Kwan Xian

  5. Yes,You'r right. cp /usr/bin/python3 to /usr/bin/my-python and chmod 4775 /usr/bin/my-python. config "my-python {script-path}" for startup command. Now,my py script can run when device reboot. Thank You!
  6. Hi,guys! when I build a pthon3 script with gui and GPIO contorl.I can run it when I use terminal with sudo command. But when I used "settings->session and startup" to config this script,It can't run when my device reboot (Orange Pi PC). I try to config command like: "echo 'password'|sudo -S python3 /home/kwan/OPi_PC/u_main.py" still the same. And then I tried to edit "/etc/rc.local" file and add: "echo 'password'|sudo -S python3 /home/kwan/OPi_PC/u_main.py &" still the same. The problem is when I run the other script without GPIO config and sudo command. It can run when device reboot. So,It's there anybody can tell me why & how to make it run with sudo. I really have no idea about it. Thx! tried: @reboot sudo python3 /home/kwan/OPI_PCPLUS/Linux_gate.py > /home/kwan/log.log Error: no display name and no $DISPLAY environment variable
  7. solved. with python3 tkinter. Tk().config(cursor='none')
  8. Hi, I have an orange_pi_pc installed Armbian(Debian) and enable desktop. But I want to hide mouse cursor when it start. I find "Mouse and Touchpad" setting,but I can't set mouse Default Theme. Is there someone know how to hide mouse cursor on it?
  9. Hello guys! I'm beginner of Armbian. The problem is: Install Armbian Stretch mainline kernel 4.14.y on my device(Orange_Pi_PC),But I don't know how to enable UART1 . I tried to select UART1 & UART2 & UART3 on armbian-config,now i can see 'overlays=uart1 uart2 uart3' in /boot/armbianEnv.txt Connect serial device with P40(RX) P39(GND) P38(TX) . when i check serial device on ssh, i can see this info: uname -a Linux orangepipc 4.14.84-sunxi #3 SMP Sat Dec 1 07:18:41 CET 2018 armv7l GNU/Linux ls -l /dev/ttyS* crw--w---- 1 root tty 4, 64 Dec 4 20:24 /dev/ttyS0 crw-rw---- 1 root dialout 4, 65 Dec 4 20:36 /dev/ttyS1 crw-rw---- 1 root dialout 4, 66 Dec 4 21:08 /dev/ttyS2 crw-rw---- 1 root dialout 4, 67 Dec 4 20:33 /dev/ttyS3 crw-rw---- 1 root dialout 4, 68 Dec 4 20:24 /dev/ttyS4 crw-rw---- 1 root dialout 4, 69 Dec 4 20:24 /dev/ttyS5 crw-rw---- 1 root dialout 4, 70 Dec 4 20:24 /dev/ttyS6 crw-rw---- 1 root dialout 4, 71 Dec 4 20:24 /dev/ttyS7 dmesg | grep tty [ 0.000000] Kernel command line: root=UUID=3d863bb3-b616-4229-94e7-8c92ac95501a rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=c0dd9a77-01 ubootsource=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1 [ 0.000198] console [tty1] enabled [ 1.796248] console [ttyS0] disabled [ 1.816398] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 42, base_baud = 1500000) is a U6_16550A [ 1.816450] console [ttyS0] enabled [ 1.839525] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 43, base_baud = 1500000) is a U6_16550A [ 1.862474] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 44, base_baud = 1500000) is a U6_16550A [ 1.885408] 1c28c00.serial: ttyS3 at MMIO 0x1c28c00 (irq = 45, base_baud = 1500000) is a U6_16550A [ 4.746240] systemd[1]: Created slice system-getty.slice. setserial -g /dev/ttyS* /dev/ttyS0: Permission denied /dev/ttyS1, UART: undefined, Port: 0x0000, IRQ: 43 /dev/ttyS2, UART: undefined, Port: 0x0000, IRQ: 44 /dev/ttyS3, UART: undefined, Port: 0x0000, IRQ: 45 /dev/ttyS4, UART: unknown, Port: 0x0000, IRQ: 0 /dev/ttyS5, UART: unknown, Port: 0x0000, IRQ: 0 /dev/ttyS6, UART: unknown, Port: 0x0000, IRQ: 0 /dev/ttyS7, UART: unknown, Port: 0x0000, IRQ: 0 When I saw this doc: https://docs.armbian.com/Hardware_Allwinner/ but there is no bin file in /boot: ls /boot armbianEnv.txt boot.scr initrd.img-4.14.84-sunxi vmlinuz-4.14.84-sunxi armbian_first_run.txt.template config-4.14.84-sunxi overlay-user zImage boot.bmp dtb System.map-4.14.84-sunxi boot.cmd dtb-4.14.84-sunxi uInitrd boot-desktop.png dtb.old uInitrd-4.14.84-sunxi I tried to use UART1 with Python3: #!/usr/bin/python #-*-coding:utf-8-*- import serial my_printer = serial.Serial('/dev/ttyS1',9600,timeout=1) if my_printer.isOpen(): pass else: my_printer.open() my_printer.write(b'\x1b\x40\x12\x54') but it doesn't work. BTW: serial device can work on Windows.