Jump to content

olivluca

Members
  • Posts

    125
  • Joined

  • Last visited

Everything posted by olivluca

  1. Well, I didn't implement it, I just took what was already available. Maybe what doesn't work for me works for somebody else or vice-versa, I don't know. In theory the version supplied with armbian should be better (it should auto select the parameters at device opening time instead of determining them at module load time), in practice it doesn't work.
  2. In case it is useful for somebody else, I put the source and the module here: https://drive.google.com/open?id=1KM3AFoSJCpJ0RpafeKRmH8iZWr3waQlH There you'll find the binary module (I compiled for my current kernel which is 3.4.113-sun8i #68) and the tar.gz with the source I used to compile it. It's just the files from github (in the "device" directory), I added a Makefile and the files from the drivers/media/video/sunxi-vfe in the original kernel source (taken from the linux-source-default-sun8i_5.60_all.deb package...well, actually I don't remember where I took those files, but I have compared them to the one provided in the deb and they are the same). To compile it just cd to the device directory and issue a make (provided you have the linux-headers package installed for the current kernel, but IIRC that's installed by default in armbian). I don't understand why armbian supplies a worse implementation of the gc2035 module but since I can use the good (or at least not so bad) one I don't care.
  3. For me the version on github works better than the version included with armbian:
  4. To compile it as an out of tree module I had to borrow some files from the full kernel source (I don't remember the details though, it's been a while). However if by latest armbian you mean the one based on the 4.x kernel, I don't think it has the required csi driver.
  5. I use sunxi-pio (with the legacy kernel), from the sunxi-tools package #!/bin/bash #PA20, input, pull-up sunxi-pio -m 'PA20<0><1><0><0>'
  6. It's been discussed before: mainline kernel has no support for the CSI interface that the camera uses. If you want to use the camera you have to use legacy kernel.
  7. I don't know if the CSI connector on the pi zero plus 2 is the same as the pi pc, it seems so but one never knows. OTOH the gc2035 driver in armbian has several issues (search the forum for gc2035). I'm using an older version of the driver (which has a different set of issues but it works better here).
  8. FWIW I had the same kind of error after my RCCB tripped 5 times in a row in a few minutes. The strange thing is, the error didn't happen until the next day when I restarted a daemon, and cutting power again has apparently fixed it
  9. Try this instead: SUBSYSTEM=="gpio", ACTION=="add", RUN="/bin/sh -c '\ chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ chown -R root:gpio /sys$DEVPATH && chmod -R 770 /sys$DEVPATH\ '"
  10. I compiled the module from here https://github.com/avafinger/gc2035 (gc2035.c, without trying to apply the patch in the same repository) and it works much better than the one included in armbian (though it has other quirks, see below). I tried many of the advertised resolutions and they all work: 640 x 480 (flipped horizontally) 800x600 (ok) 1280x720 (slightly washed up) 1600x1200 (too much for motion) Let's see if it lasts or if it causes more problems, but if nobody is going to fix the current driver I propose to revert to the older one.
  11. FWIW this is my 99-gpio.rules, I use RUN instead of PROGRAM because, according to this document I'm using it on an OPi PC with legacy kernel, you can omit the echo line, it's there just for debugging purposes SUBSYSTEM=="gpio", ACTION=="add", RUN="/bin/sh -c '\ echo $DEVPATH >> /tmp/pippo;\ chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ chown -R root:gpio /sys$DEVPATH && chmod -R 770 /sys$DEVPATH\ '" As I mentioned elsewhere,I had to patch the python library I use because the change of ownership is asynchronous.
  12. AFAIK drive level refers to the current that a gpio configured as output can supply, unfortunately I don't remember where I read it and cannot find the documentation right now.
  13. You can buy from aliexpress, shipments to Spain lately are reasonably fast (2/3 weeks)
  14. It turns out that after a few hours of running motion the captured image have a green tint (not like the above sample at 1600x1200, just a normal image with almost no red-blue components). Since I'm using the beta repository I though it was a problem of the kernel of the day, in fact updating and rebooting solved the issue. It turns out that's enough to stop and start motion to get a normally coloured image. Do you think it's an hardware or driver issue?
  15. You could resize the partition with gparted, but I don't know if is there an equivalent that runs under windows.
  16. I made my previous tests using an headphone, now, connected to an amplifier and speakers, the effect is much less pronounced. One channel still bleeds into the other but I think it is usable for my purpose.
  17. Strangely enough the IOCTL interface works (strange because, looking at the source of sunxi_wdt in theory either writing to the device or using the ioctl should trigger the same function watchdog_kick) import time import fcntl f=open('/dev/watchdog','w') try: while True: time.sleep(1) print '.' fcntl.ioctl(f,0x80045705) #WDIOC_KEEPALIVE except KeyboardInterrupt: print 'end' f.write('V') f.close()
  18. I have a different problem: I'm trying to ping /dev/watchdog directly, without using the watchdog package. The problem is that the watchdog resets the board (opi pc, legacy kernel) even if I keep writing to /dev/watchdog. If I write the magic char 'V' to /dev/watchdog before the timeout expires then it doesn't reset (and that's ok). This is the test python script I'm using, I'm using chr(0) because that's what the sample program does, but anything (except 'V' for obvious reasons) should work: import time f=open('/dev/watchdog','w') try: while True: time.sleep(1) print '.' f.write(chr(0)) except KeyboardInterrupt: print 'end' f.write('V') f.close()
  19. Today I tried mainline kernel but there's no gc2035 module there. Is it so or did I miss something?
  20. This patch solves it for me (Edit but I think there should be a better way) diff --git a/OPi/GPIO.py b/OPi/GPIO.py index 775134e..aa8e77b 100644 --- a/OPi/GPIO.py +++ b/OPi/GPIO.py @@ -239,6 +239,7 @@ Methods """ import warnings +import time from OPi.constants import IN, OUT from OPi.constants import LOW, HIGH # noqa: F401 @@ -358,6 +359,7 @@ def setup(channel, direction, initial=None, pull_up_down=None): else: raise e + time.sleep(0.1) sysfs.direction(pin, direction) _exports[channel] = direction if direction == OUT and initial is not None:
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines