Jump to content

OldMan

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

857 profile views
  1. With a little shell script I can switch gpio6 on/off: #!/bin/sh # PWM1 / GPIOA6 P=6 G="/sys/class/gpio/gpio${P}" if [ ! -d "${G}" ]; then echo "Exporting GPIO${P}" echo ${P} > /sys/class/gpio/export echo out > ${G}/direction fi i=100 while [ "$i" -gt 0 ]; do i=`expr $i - 1` sleep .2 echo 1 > ${G}/value sleep .1 echo 0 > ${G}/value done if [ -d "${G}" ]; then echo "Unexporting GPIO${P}" echo ${P} > /sys/class/gpio/unexport fi but I dont see anything which could enable PWM on this pin: root@nanopineo:~# ll /sys/class/gpio/gpio6/ total 0 -rw-r--r-- 1 root root 4096 Feb 21 11:38 active_low lrwxrwxrwx 1 root root 0 Feb 21 11:38 device -> ../../../sunxi-pinctrl -rw-r--r-- 1 root root 4096 Feb 21 11:37 direction -rw-r--r-- 1 root root 4096 Feb 21 11:38 edge drwxr-xr-x 2 root root 0 Feb 21 11:38 power lrwxrwxrwx 1 root root 0 Feb 21 11:38 subsystem -> ../../../../../class/gpio -rw-r--r-- 1 root root 4096 Feb 21 11:37 uevent -rw-r--r-- 1 root root 4096 Feb 21 11:38 value Is it possibe to enable PWM on the NanoPi Neo via sysfs?
  2. Hi all, I'm trying to get some sensors working with latest Armbian on a NanoPi Neo ... 1st thing is that there are a bunch of modules loaded where I have no hardware for, f.e. pcf8591 and bmp085: root@nanopineo:~# uname -a Linux nanopineo 3.4.113-sun8i #28 SMP PREEMPT Thu Feb 2 02:01:28 CET 2017 armv7l GNU/Linux root@nanopineo:~# lsmod Module Size Used by ir_lirc_codec 3650 0 lirc_dev 7834 1 ir_lirc_codec ir_mce_kbd_decoder 2885 0 ir_sanyo_decoder 1480 0 ir_sony_decoder 1422 0 ir_jvc_decoder 1452 0 ir_rc6_decoder 1941 0 ir_rc5_decoder 1412 0 ir_nec_decoder 1556 0 sunxi_cir 1601 0 rc_core 12727 10 ir_lirc_codec,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,sunxi_cir,ir_mce_kbd_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_sanyo_decoder bmp085 3487 0 pcf8591 3363 0 g_serial 27617 0 btrfs 712409 0 root@nanopineo:~# cat /etc/modules #w1-sunxi #w1-gpio #w1-therm #sunxi-cir g_serial root@nanopineo:~# dmesg | grep plat [ 0.115079] plat: add bmp085 device [ 0.115079] plat: add pcf8591 device except for g_serial which seems loaded from /etc/modules I cant find from where the rest gets loaded ...? Then when trying to delete the instance of pcf8591 (I need address 0x48 for a lm75a ) I get: root@nanopineo:~# ll /sys/bus/i2c/devices/i2c-0/ total 0 drwxr-xr-x 4 root root 0 Jan 1 1970 0-0048 drwxr-xr-x 3 root root 0 Feb 19 19:18 0-004f drwxr-xr-x 3 root root 0 Jan 1 1970 0-0077 --w------- 1 root root 4096 Feb 21 11:02 delete_device lrwxrwxrwx 1 root root 0 Feb 19 19:17 device -> ../../twi.0 drwxr-xr-x 3 root root 0 Jan 1 1970 i2c-dev -r--r--r-- 1 root root 4096 Feb 19 19:17 name --w------- 1 root root 4096 Feb 19 19:18 new_device drwxr-xr-x 2 root root 0 Feb 19 19:11 power lrwxrwxrwx 1 root root 0 Feb 19 19:11 subsystem -> ../../../../bus/i2c -rw-r--r-- 1 root root 4096 Jan 1 1970 uevent root@nanopineo:~# echo 0x48 > /sys/bus/i2c/devices/i2c-0/delete_device -bash: echo: write error: Invalid argument root@nanopineo:~# echo 0x4f > /sys/bus/i2c/devices/i2c-0/delete_device -bash: echo: write error: Invalid argument root@nanopineo:~# echo 0x77 > /sys/bus/i2c/devices/i2c-0/delete_device -bash: echo: write error: Invalid argument here the device at 0x4f is another lm75a which I have self instantiated and which works fine - though even that I cant remove ... so my questions are: 1) from where get all those modules (pcf8591, bmp085, ir* and related) loaded and why? 2) why does deleting of devices not work? I've have an older version of Armbian running on a BPI and there I can delete instantiated devices just fine ... Excuse me if this has already been asked/answered in another thread but I have heavily searched but wasnt successful :-(
  3. I have also a BMP180 and its absolutely easy to read it out since there exists a kernel module bmp085 for it ... however if you only want to read temperatures I would prefer the LM75(A) chip which uses also I2C, and there exists a kernel module too ... Armbian has already the bmp085 module included IIRC; the lm75 module is currently missing, but I asked Igor already for it, and next release comes with a bunch more of sensor modules (see the link tkaiser posted above); till then we can still use Python or a C program for reading the LM75; ready-ro-use breakouts are really cheap on the Bay: http://www.ebay.com/itm/331655700684 http://www.ebay.com/itm/400974994990 and if you want to solder self, the chips only + adapter pcb are even cheaper: http://www.ebay.com/itm/221852588460 http://www.ebay.com/itm/321572647120 but I would not extend the I2C bus more than 70cm; so if you're looking for temp sensors for outdoors then the DS18B20 seems the right choice; waterproof versions are really cheap, f.e.: http://www.ebay.com/itm/171422502025 although I have some DS18B20 which I used already with Arduinos, I've not yet connected one to a BPi board, so cant tell how well this will work or what software support exists for it (kernel module?) ...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines