lordofduct

  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

897 profile views

lordofduct's Achievements

  1. yeah, if I modprobe matrix-pwm, after enabling it in the fex file, I get /dev/pwm. But the source code still doesn't work. When it attempts to set the pwm using ioctl (from libc), it fails. Which is what led me to try sunxi-pwm.
  2. So yeah, I got the fex to enable pwm1 on pin 6 (not sure where on the board pwm0 is, but it's not on the gpio header). Still didn't work though, in the code when 'ioctl' is called to actually set the frequency, it fails. Anyways... off to other things. ... I was able to get something in /sys/class for pwm. By adding the module 'pwm-sunxi', while having pwm configured in the fex: modprobe pwm-sunxi I am able to find a grouping /sys/class/sunxi_pwm, but unfortunately the structure of this doesn't match anything like what I expect... heck, the name alone isn't what I expected. I expect something like this from what I've read on the internet: - /sys/class/pwm-sunxi | +----pwmX | +---duty +---duty_percent +---period +---polarity +---pulse +---pin +---run but instead get something like: - /sys/class/sunxi_pwm | +----sunxi_pwm | +----dev +----uevent +----subsystem //symlink to /sys/class/sunxi_pwm +----power | +---- ... a bunch of junk
  3. I checked out matrix, and it says /dev/pwm doesn't exist... which it doesn't. Which leads me back to the turning it on in the fex... I'll dig into that some more.
  4. Well I haven't resolved my issue of not being able to access /dev/mem. But I got around it by using /sys/class/gpio. I wrote up my own code to drive the gpio through this interface using C# (my preferred language): This has got me up and running turning gpio pins on or off. Next I want to get pwm working, I've read around that there is a /sys/class/pwm, but this doesn't exist on my machine. I also noticed its through this that the python library from my previous post attempts to access it as well. I looked in the fex and noticed some entries relating to pwm: [pwm0_para] pwm_used = 0 pwm_positive = port:PA05<3><0><default><default> [pwm1_para] pwm_used = 0 pwm_positive = port:PA06<3><0><default><default> I've changed the pwm_used flag to 1, but nothing changes. I've also attempted creating a software pwm based on a blog post I found... but it was far to inaccurate to use. Is there any c api I could use to access the pwm, or something I'm issing to get /sys/class/pwm? ... also, I notice when I submit posts, the last few lines of my post get removed... what's up with that? I've had to edit this multiple times because it kept deleting it.
  5. So I have a nanopi m1 and a neo. I'm running Ubuntu Xenial on them: https://www.armbian.com/nanopi-neo/ I'm attempting to access the gpio, when I attempt to echo to /sys/class/gpio/export I get permission denied (sudo or not, even if logged in as root). I've also found this library for python to handle gpio on the nanopi: https://github.com/jrspruitt/FriendlyARM_Python_GPIO But when I use it, it says: as root root@nanopineo:/home/admin# python test.py Traceback (most recent call last): File "test.py", line 7, in <module> gpio.gpio_init(16, 1) File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 85, in gpio_init File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 465, in _mem_open mmap.error: [Errno 1] Operation not permitted as user admin@nanopineo:~$ sudo python test.py Traceback (most recent call last): File "test.py", line 7, in <module> gpio.gpio_init(16, 1) File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 85, in gpio_init File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 465, in _mem_open mmap.error: [Errno 1] Operation not permitted admin@nanopineo:~$ python test.py Traceback (most recent call last): File "test.py", line 7, in <module> gpio.gpio_init(16, 1) File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 85, in gpio_init File "build/bdist.linux-armv7l/egg/fgpio/fgpio.py", line 461, in _mem_open OSError: [Errno 13] Permission denied: '/dev/mem' Permission denied is what I expect as user. But not sure what Operation not permitted is for when root/sudo. ... I'm just wondering what is the easiest way to actually access the gpio on this thing. My googling is for not so far.
  6. Ah, darn... admin@nanopim1:~$ dmesg | grep OV5640 [ 9.081894] [OV5640]error at sensor_detect [ 9.081900] [OV5640]chip found is not an target chip. OK, so chip not a target chip? Does this mean that the camera isn't ov5640??? admin@nanopim1:~$ dmesg | grep ov5640 [ 9.001216] [VFE]Find sensor name is "ov5640", i2c address is 78, type is "YUV" ! [ 9.001226] [VFE]Sub device register "ov5640" i2c_addr = 0x78 start! [ 9.128089] [VFE]Sub device register "ov5640" failed! OK, so it failed. admin@nanopim1:~$ dmesg | grep VFE [ 8.816405] [VFE]cci probe start cci_sel = 0! [ 8.816445] [VFE]cci probe end cci_sel = 0! [ 8.816532] [VFE]cci_init end [ 8.875185] [VFE]Welcome to Video Front End driver [ 8.886588] [VFE]pdev->id = 0 [ 8.895492] [VFE]dev->mipi_sel = 0 [ 8.904752] [VFE]dev->vip_sel = 0 [ 8.913784] [VFE]dev->isp_sel = 0 [ 8.928819] [VFE_WARN]vfe vpu clock is null [ 8.946244] [VFE]..........................vfe clk open!....................... [ 8.959833] [VFE]vfe_init end [ 8.990468] [VFE]probe_work_handle start! [ 9.001192] [VFE]v4l2 subdev register input_num = 0 [ 9.001205] [VFE]vfe sensor detect start! input_num = 0 [ 9.001216] [VFE]Find sensor name is "ov5640", i2c address is 78, type is "YUV" ! [ 9.001226] [VFE]Sub device register "ov5640" i2c_addr = 0x78 start! [ 9.001239] [VFE]v4l2_device_register_subdev return 0 [ 9.001248] [VFE]registered sensor subdev is OK! [ 9.001253] [VFE]Check sensor! [ 9.014558] [VFE]mclk on [ 9.081331] [VFE CCI_0 ERR] Status error at addr_8bit = 78, wr_flag = 1, val = 12f0a30 [ 9.081607] [VFE CCI_0 ERR] Status error at addr_8bit = 78, wr_flag = 1, val = 1000a30 [ 9.081881] [VFE CCI_0 ERR] Status error at addr_8bit = 78, wr_flag = 1, val = 1000a30 [ 9.081908] [VFE]mclk off [ 9.118049] [VFE]vfe sensor subdev unregister! [ 9.128089] [VFE]Sub device register "ov5640" failed! [ 9.138717] [VFE_ERR]vfe sensor register check error at input_num = 0 [ 9.151200] [VFE]V4L2 device registered as video0 [ 9.161457] [VFE]..........................vfe clk close!....................... [ 9.174762] [VFE]probe_work_handle end! [ 10.988651] [VFE]vfe_open [ 10.997761] [VFE]..........................vfe clk open!....................... [ 11.012341] [VFE]vfe_open ok [ 11.012569] [VFE]vfe_close [ 11.012579] [VFE]vfe select input flag = 0, s_input have not be used . [ 11.012596] [VFE]..........................vfe clk close!....................... [ 11.012625] [VFE]vfe_close end [ 11.054387] [VFE]vfe_open [ 11.054403] [VFE]..........................vfe clk open!....................... [ 11.054441] [VFE]vfe_open ok [ 11.054618] [VFE]vfe_close [ 11.054628] [VFE]vfe select input flag = 0, s_input have not be used . [ 11.054644] [VFE]..........................vfe clk close!....................... [ 11.054673] [VFE]vfe_close end I honestly have no idea what this all means.
  7. Thanks @lex for confirming those are the steps. So I went and found a fex file on the forums that looked like it might work: [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00<2><default><default><default> vip_csi_mck = port:PE01<2><default><default><default> vip_csi_hsync = port:PE02<2><default><default><default> vip_csi_vsync = port:PE03<2><default><default><default> vip_csi_d0 = port:PE04<2><default><default><default> vip_csi_d1 = port:PE05<2><default><default><default> vip_csi_d2 = port:PE06<2><default><default><default> vip_csi_d3 = port:PE07<2><default><default><default> vip_csi_d4 = port:PE08<2><default><default><default> vip_csi_d5 = port:PE09<2><default><default><default> vip_csi_d6 = port:PE10<2><default><default><default> vip_csi_d7 = port:PE11<2><default><default><default> vip_csi_sck = port:PE12<2><default><default><default> vip_csi_sda = port:PE13<2><default><default><default> vip_dev0_mname = "ov5640" vip_dev0_pos = "rear" vip_dev0_lane = 4 vip_dev0_twi_id = 2 vip_dev0_twi_addr = 0x78 vip_dev0_isp_used = 1 vip_dev0_fmt = 0 vip_dev0_stby_mode = 1 vip_dev0_vflip = 1 vip_dev0_hflip = 0 vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1500000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = port:PD14<1><default><default><default> vip_dev0_reset = port:PE14<1><default><default><default> vip_dev0_pwdn = port:PE15<1><default><default><default> vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = vip_dev0_act_used = 0 vip_dev0_act_name = "ad5820_act" vip_dev0_act_slave = 0x18 vip_dev1_mname = "" vip_dev1_pos = "rear" vip_dev1_lane = 1 vip_dev1_twi_id = 0 vip_dev1_twi_addr = vip_dev1_isp_used = 0 vip_dev1_fmt = 1 vip_dev1_stby_mode = 0 vip_dev1_vflip = 0 vip_dev1_hflip = 0 vip_dev1_iovdd = "" vip_dev1_iovdd_vol = 2800000 vip_dev1_avdd = "" vip_dev1_avdd_vol = 2800000 vip_dev1_dvdd = "" vip_dev1_dvdd_vol = 1500000 vip_dev1_afvdd = "" vip_dev1_afvdd_vol = 2800000 vip_dev1_power_en = vip_dev1_reset = vip_dev1_pwdn = vip_dev1_flash_en = vip_dev1_flash_mode = vip_dev1_af_pwdn = ...edit... ok weird, the other stuff I put in my post didn't appear for some reason. Have to retype it. So after a reboot it shows up as /dev/video0. Furthermore the dmesg reports this: admin@nanopim1:~$ dmesg | grep OK [ 4.570152] [VFE]registered sensor subdev is OK! So, looks good. But, ffmpeg and fswebcam still report the same things again: admin@nanopim1:~$ ffmpeg -t 5 -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -pix_fmt nv12 -r 30 \ -b:v 64k -c:v cedrus264 test.mp4 ffmpeg version 3.1.3-1~bpo8+1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.9.2 (Debian 4.9.2-10) configuration: --prefix=/usr --extra-version='1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libopencv --enable-libx264 libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 48.101 / 57. 48.101 libavformat 57. 41.100 / 57. 41.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 47.100 / 6. 47.100 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 [video4linux2,v4l2 @ 0x144c3d0] ioctl(VIDIOC_S_INPUT): No such device /dev/video0: No such device admin@nanopim1:~$ fswebcam -d /dev/video0 --verbose test.jpg --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. src_v4l2_get_capability,87: /dev/video0 information: src_v4l2_get_capability,88: cap.driver: "sunxi-vfe" src_v4l2_get_capability,89: cap.card: "sunxi-vfe" src_v4l2_get_capability,90: cap.bus_info: "sunxi_vfe sunxi_vfe.0" src_v4l2_get_capability,91: cap.capabilities=0x05000001 src_v4l2_get_capability,92: - VIDEO_CAPTURE src_v4l2_get_capability,101: - READWRITE src_v4l2_get_capability,103: - STREAMING No input was specified, using the first. Unable to query input 0. VIDIOC_ENUMINPUT: Invalid argument
  8. Hello all, just joined the forum since this is my first time using Armbian. So I got a NanoPi M1 and the dvp cam500b. From what I understand this camera uses the omnivision ov5640. I am having trouble getting this thing recognized in armbian. I get /dev/video0 to be listed by adding it to /etc/modules, but if I go to access it with any software it reports back 'no such device' or to the similar effect (this includes mjpg-streamer, fswebcam, ffmpeg). Researching around I find many forum posts of people saying one must modify the 'fex' file... to which I found out this is the decompiled version of the /boot/script.bin file using the sunxi-tools/bin2fex. Thing is, when I go into this 'fex' file, I have no idea what I must do. I find a location in it referring to [csi0], under which the gc2035 camera like so: vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00<2><default><default><default> vip_csi_mck = port:PE01<2><default><default><default> vip_csi_hsync = port:PE02<2><default><default><default> vip_csi_vsync = port:PE03<2><default><default><default> vip_csi_d0 = port:PE04<2><default><default><default> vip_csi_d1 = port:PE05<2><default><default><default> vip_csi_d2 = port:PE06<2><default><default><default> vip_csi_d3 = port:PE07<2><default><default><default> vip_csi_d4 = port:PE08<2><default><default><default> vip_csi_d5 = port:PE09<2><default><default><default> vip_csi_d6 = port:PE10<2><default><default><default> vip_csi_d7 = port:PE11<2><default><default><default> vip_csi_sck = port:PE12<2><default><default><default> vip_csi_sda = port:PE13<2><default><default><default> vip_dev0_mname = "gc2035" vip_dev0_pos = "front" vip_dev0_lane = 1 vip_dev0_twi_id = 2 vip_dev0_twi_addr = 120 vip_dev0_isp_used = 0 vip_dev0_fmt = 0 vip_dev0_stby_mode = 0 vip_dev0_vflip = 1 vip_dev0_hflip = 1 vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = port:PA17<1><default><default><1> vip_dev0_reset = port:PE14<1><default><default><1> vip_dev0_pwdn = port:PE15<1><default><default><0> vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = vip_dev0_act_used = 0 vip_dev0_act_name = "ad5820_act" vip_dev0_act_slave = 24 vip_dev1_mname = "" vip_dev1_pos = "rear" vip_dev1_lane = 1 vip_dev1_twi_id = 0 vip_dev1_twi_addr = vip_dev1_isp_used = 0 vip_dev1_fmt = 1 vip_dev1_stby_mode = 0 vip_dev1_vflip = 0 vip_dev1_hflip = 0 vip_dev1_iovdd = "" vip_dev1_iovdd_vol = 2800000 vip_dev1_avdd = "" vip_dev1_avdd_vol = 2800000 vip_dev1_dvdd = "" vip_dev1_dvdd_vol = 1500000 vip_dev1_afvdd = "" vip_dev1_afvdd_vol = 2800000 vip_dev1_power_en = vip_dev1_reset = vip_dev1_pwdn = vip_dev1_flash_en = vip_dev1_flash_mode = vip_dev1_af_pwdn =