Re: [beagleboard] bbb Internal ADC configuration settings?
Hi, So I finally had the time to upgrade my beaglebone, and it now has this kernel: 4.1.18-ti-r53 However, now, a lot of the directories and stuff have changed. I can't even enable the adc (echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots) because there is no longer any folder called bone_capemgr.9. root@beaglebone:/sys/devices# ls -l total 0 drwxr-xr-x 3 root root 0 Mar 20 17:12 armv7_cortex_a8 drwxr-xr-x 3 root root 0 Mar 20 17:12 breakpoint drwxr-xr-x 21 root root 0 Mar 20 17:12 platform drwxr-xr-x 3 root root 0 Mar 20 17:12 soc0 drwxr-xr-x 3 root root 0 Mar 20 17:12 software drwxr-xr-x 6 root root 0 Mar 20 17:12 system drwxr-xr-x 3 root root 0 Mar 20 17:12 tracepoint drwxr-xr-x 15 root root 0 Mar 20 17:12 virtual The folder armv7_cortex_a8 doesn't have slots and when I tried: echo cape-bone-iio > /sys/devices/armv7_cortex_a8/slots it said permission denied. There is also no longer any iio folder within /sys/bus: root@beaglebone:/sys/bus# ls -l total 0 drwxr-xr-x 4 root root 0 Mar 20 17:12 clockevents drwxr-xr-x 4 root root 0 Mar 20 17:12 clocksource drwxr-xr-x 4 root root 0 Mar 20 17:12 container drwxr-xr-x 4 root root 0 Mar 20 17:12 cpu drwxr-xr-x 4 root root 0 Mar 20 17:12 event_source drwxr-xr-x 4 root root 0 Mar 20 17:12 hid drwxr-xr-x 4 root root 0 Mar 20 17:12 i2c drwxr-xr-x 4 root root 0 Mar 20 17:12 mdio_bus drwxr-xr-x 4 root root 0 Mar 20 17:12 mmc drwxr-xr-x 4 root root 0 Mar 20 17:12 nvmem drwxr-xr-x 5 root root 0 Mar 20 17:12 pci drwxr-xr-x 4 root root 0 Mar 20 17:12 platform drwxr-xr-x 4 root root 0 Mar 20 17:12 scsi drwxr-xr-x 4 root root 0 Mar 20 17:12 sdio drwxr-xr-x 4 root root 0 Mar 20 17:12 serio drwxr-xr-x 4 root root 0 Mar 20 17:12 soc drwxr-xr-x 4 root root 0 Mar 20 17:12 spi drwxr-xr-x 4 root root 0 Mar 20 17:12 usb drwxr-xr-x 4 root root 0 Mar 20 17:12 virtio drwxr-xr-x 4 root root 0 Mar 20 17:12 w1 drwxr-xr-x 4 root root 0 Mar 20 17:12 workqueue On Saturday, March 19, 2016 at 4:15:04 PM UTC-4, john3909 wrote: > > Yeah, that is what I thought. IIO on the 3.8 kernel didn’t have a lot of > features and this is why you are having difficulty using it. I would > recommend upgrading to the 4.1 kernel or even the 4.4 kernel. I personally > use the 4.1 kernel, but I back ported IIO from the IIO-next kernel so that > I am using the latest IIO which includes DMA framework support. > > Regards, > John > > > > > On Mar 19, 2016, at 9:46 AM, Audrey <ao...@smith.edu > wrote: > > Hi William, I did read that article you sent me. I was unable to follow > the Driver Configuration bit, but as far as the continuous mode is > concerned, after careful re-reading of the article, I think I understand > that you are trying to tell me that I should be in the /dev/iio:device0 > directory to read the continuous mode. However, my problem is that buffer, > scan_elements, and mode, which the article says are used to set up the > continuous mode, should be in the /sys/bus/iio/devices/iio:device0 > directory. And that was where I was in, but I could not find them, which is > my current problem. > > John3909, my kernel version is 3.8.13-bone70. > > I think if this doesn't pan out, I will be looking into using the PRU, > although I would like to understand the current system better before moving > on to something more complicated. > > Thanks everyone for your help! > > On Friday, March 18, 2016 at 5:59:01 PM UTC-4, William Hermans wrote: >> >> Audrey, >> >> Please read the link I gave you a couple weeks ago . . . >> http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#Continuous_Mode >> >> Everything you need to know to use the ADC is explained on this page. But >> from your last post, and the paths you've shown us. You're in the wrong >> directory. Essentially, you're still in the one-shot directories, which are >> completely separate from the continuous mode directory structure. >> >> On Fri, Mar 18, 2016 at 1:46 PM, John Syne <john...@gmail.com> wrote: >> >>> What is your kernel version? >>> >>> Regards, >>> John >>> >>> >>> >>> >>> On Mar 18, 2016, at 1:22 PM, Audrey <ao...@smith.edu> wrote: >>> >>> It says: >>> root@beaglebone:/# echo 1 > >>> /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en >>> -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No >>> such file or directory >>> >>> and I can't find scan_elements in sys/bus/iio/devices/iio:device0 >>> root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l >>> total 0 >>> -r--r--r-- 1 root root 4096 Mar 1 21:13 dev >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage0_raw &
Re: [beagleboard] bbb Internal ADC configuration settings?
Thanks! On Monday, March 21, 2016 at 4:06:10 PM UTC-4, RobertCNelson wrote: > > On Mon, Mar 21, 2016 at 2:52 PM, Audrey <ao...@smith.edu > > wrote: > > Thanks John, do you know where to get kernel 4.1? This is the only place > I > > know that has beaglebone images, but they don't specify which kernel > each > > version has: http://beagleboard.org/latest-images > > Fresh as of yesterday: 4.1.18-ti-r53 > > > http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Image_Testing_Snapshots > > > We've been fixing up the usb gadget setup, so they are a more stable > then the "8.3" images on http://beagleboard.org/latest-images > > Regards, > > -- > Robert Nelson > https://rcn-ee.com/ > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] bbb Internal ADC configuration settings?
Thanks John, do you know where to get kernel 4.1? This is the only place I know that has beaglebone images, but they don't specify which kernel each version has: http://beagleboard.org/latest-images I know that my beaglebone has the image BBB-eMMC-flasher-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz On Saturday, March 19, 2016 at 4:15:04 PM UTC-4, john3909 wrote: > > Yeah, that is what I thought. IIO on the 3.8 kernel didn’t have a lot of > features and this is why you are having difficulty using it. I would > recommend upgrading to the 4.1 kernel or even the 4.4 kernel. I personally > use the 4.1 kernel, but I back ported IIO from the IIO-next kernel so that > I am using the latest IIO which includes DMA framework support. > > Regards, > John > > > > > On Mar 19, 2016, at 9:46 AM, Audrey <ao...@smith.edu > wrote: > > Hi William, I did read that article you sent me. I was unable to follow > the Driver Configuration bit, but as far as the continuous mode is > concerned, after careful re-reading of the article, I think I understand > that you are trying to tell me that I should be in the /dev/iio:device0 > directory to read the continuous mode. However, my problem is that buffer, > scan_elements, and mode, which the article says are used to set up the > continuous mode, should be in the /sys/bus/iio/devices/iio:device0 > directory. And that was where I was in, but I could not find them, which is > my current problem. > > John3909, my kernel version is 3.8.13-bone70. > > I think if this doesn't pan out, I will be looking into using the PRU, > although I would like to understand the current system better before moving > on to something more complicated. > > Thanks everyone for your help! > > On Friday, March 18, 2016 at 5:59:01 PM UTC-4, William Hermans wrote: >> >> Audrey, >> >> Please read the link I gave you a couple weeks ago . . . >> http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#Continuous_Mode >> >> Everything you need to know to use the ADC is explained on this page. But >> from your last post, and the paths you've shown us. You're in the wrong >> directory. Essentially, you're still in the one-shot directories, which are >> completely separate from the continuous mode directory structure. >> >> On Fri, Mar 18, 2016 at 1:46 PM, John Syne <john...@gmail.com> wrote: >> >>> What is your kernel version? >>> >>> Regards, >>> John >>> >>> >>> >>> >>> On Mar 18, 2016, at 1:22 PM, Audrey <ao...@smith.edu> wrote: >>> >>> It says: >>> root@beaglebone:/# echo 1 > >>> /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en >>> -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No >>> such file or directory >>> >>> and I can't find scan_elements in sys/bus/iio/devices/iio:device0 >>> root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l >>> total 0 >>> -r--r--r-- 1 root root 4096 Mar 1 21:13 dev >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage0_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage1_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage2_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage3_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage4_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage5_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage6_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage7_raw >>> -r--r--r-- 1 root root 4096 Mar 1 21:13 name >>> drwxr-xr-x 2 root root0 Mar 1 21:13 power >>> lrwxrwxrwx 1 root root0 Mar 1 20:47 subsystem -> >>> ../../../../../bus/iio >>> -rw-r--r-- 1 root root 4096 Mar 1 20:47 uevent >>> >>> >>> On Friday, March 18, 2016 at 4:15:00 PM UTC-4, john3909 wrote: >>>> >>>> >>>> On Mar 18, 2016, at 1:06 PM, Audrey <ao...@smith.edu> wrote: >>>> >>>> Hm. >>>> >>>> Sorry, but unfortunately I'm still quite a bit lost. What should I be >>>> doing to dev/iio:device0 (open?) in order to do the following: >>>> echo 1 > in_voltage0_en >>>> >>>> From memory, >>>> >>>> echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en >>>> >>>> echo 1 > buffer/enable >>>> >>>> echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable >>>> >>>> Regards, >&g
Re: [beagleboard] bbb Internal ADC configuration settings?
Hm. Sorry, but unfortunately I'm still quite a bit lost. What should I be doing to dev/iio:device0 (open?) in order to do the following: echo 1 > in_voltage0_en echo 1 > buffer/enable I'm assuming that I should be able to see in_voltage0_en and buffer in the folder /sys/bus/iio/devices/iio:device0 but I currently do not see those attributes/drivers/folders/buffers/whatever-you-want-to-call-them. Typing root@beaglebone:/dev# open iio:device0 doesn't seem to do anything. Do you think you could break your steps down even further? Thanks. On Friday, March 18, 2016 at 3:49:39 PM UTC-4, john3909 wrote: > > It is a driver, so you can open, poll and read from /dev/iio:device0 > > For a quick test, do the following: After you enable the various > scan_channels, start the buffer and then do the following: > > dd if=/dev/iio:device0 of=~/test.txt > > Press ctrl-C to stop capture. > > Use hexdump to view the file. > > Regards, > John > > > > > On Mar 18, 2016, at 12:37 PM, Audrey <ao...@smith.edu > > wrote: > > It says: > root@beaglebone:/dev# cd iio:device0 > -bash: cd: iio:device0: Not a directory > root@beaglebone:/dev# cat iio:device0 > cat: iio:device0: Invalid argument > > > On Friday, March 18, 2016 at 3:25:13 PM UTC-4, john3909 wrote: >> >> The buffer is available here: >> >> /dev/iio:device0 >> >> Because the driver uses interrupts, you won’t get the speed you want. The >> driver has to be updated to use DMA if you want to use full speed. Reading >> from the buffer will reduce your CPU load compared to using LDR_PATH >> because this interface blocks until a sample is available, but not long >> enough for the thread to sleep. To use DMA, IIO have introduced a DMA >> framework and most of what you need is already available. However, IIO are >> going to be updating the IIO DMA framework to do zero copy between the >> kernel module and the socket interface, using MMU maps. >> >> Regards, >> John >> >> >> >> >> On Mar 18, 2016, at 11:21 AM, Audrey <ao...@smith.edu> wrote: >> >> Hi everyone, >> >> First of all, thank you everyone for trying to help me. I appreciate >> everyone's input. >> >> I took everyone's advice, and have moved away from bash to C++. It's >> clocking at about 2 milliseconds, but I would really like it to go down >> into the microsecond range: >> >>> /** Simple LDR Reading Application >>> * Written by Derek Molloy for the book "Exploring BeagleBone: Tools and >>> * Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014 >>> * ISBN 9781118935125. Please see the file README.md in the repository >>> root >>> * directory for copyright and GNU GPLv3 license information. >>> */ >>> >>> #include >>> #include >>> #include >>> #include >>> using namespace std; >>> >>> #define LDR_PATH "/sys/bus/iio/devices/iio:device0/in_voltage" >>> >>> int readAnalog(int number) >>> { >>>stringstream ss; >>>ss << LDR_PATH << number << "_raw"; >>>fstream fs; >>>fs.open(ss.str().c_str(), fstream::in); >>>fs >> number; >>>fs.close(); >>>return number; >>> } >>> >>> int main(int argc, char* argv[]) >>> { >>>cout << "Starting the readLDR program" << endl; >>>int value; >>>int i=1; >>>while (true) >>>{ >>> float value = (float)readAnalog(0)/4095*1.8; >>> cout <<"V= " << value << endl; >>> cout << i << endl; >>> i++; >>>} >>>return 0; >>> } >>> >> >> Thank you TJF for pointing me to libpruio. I'll use it later if I need >> it, but for now I rather not use the PRU if I don't need to. >> >> So I noticed this thing where I can't see the buffer, or scan_elements, >> or mode in iio:device0, and I wonder if I'm not enabling the adc dto >> properly or something: >> >>> root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l >>> total 0 >>> -r--r--r-- 1 root root 4096 Mar 1 20:51 dev >>> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage0_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage1_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage2_raw >>> -rw-r--r-- 1 root root 4096 Mar 1 22:03
Re: [beagleboard] bbb Internal ADC configuration settings?
Hi William, I did read that article you sent me. I was unable to follow the Driver Configuration bit, but as far as the continuous mode is concerned, after careful re-reading of the article, I think I understand that you are trying to tell me that I should be in the /dev/iio:device0 directory to read the continuous mode. However, my problem is that buffer, scan_elements, and mode, which the article says are used to set up the continuous mode, should be in the /sys/bus/iio/devices/iio:device0 directory. And that was where I was in, but I could not find them, which is my current problem. John3909, my kernel version is 3.8.13-bone70. I think if this doesn't pan out, I will be looking into using the PRU, although I would like to understand the current system better before moving on to something more complicated. Thanks everyone for your help! On Friday, March 18, 2016 at 5:59:01 PM UTC-4, William Hermans wrote: > > Audrey, > > Please read the link I gave you a couple weeks ago . . . > http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#Continuous_Mode > > Everything you need to know to use the ADC is explained on this page. But > from your last post, and the paths you've shown us. You're in the wrong > directory. Essentially, you're still in the one-shot directories, which are > completely separate from the continuous mode directory structure. > > On Fri, Mar 18, 2016 at 1:46 PM, John Syne <john...@gmail.com > > wrote: > >> What is your kernel version? >> >> Regards, >> John >> >> >> >> >> On Mar 18, 2016, at 1:22 PM, Audrey <ao...@smith.edu > >> wrote: >> >> It says: >> root@beaglebone:/# echo 1 > >> /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en >> -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No >> such file or directory >> >> and I can't find scan_elements in sys/bus/iio/devices/iio:device0 >> root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l >> total 0 >> -r--r--r-- 1 root root 4096 Mar 1 21:13 dev >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage0_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage1_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage2_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage3_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage4_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage5_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage6_raw >> -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage7_raw >> -r--r--r-- 1 root root 4096 Mar 1 21:13 name >> drwxr-xr-x 2 root root0 Mar 1 21:13 power >> lrwxrwxrwx 1 root root0 Mar 1 20:47 subsystem -> >> ../../../../../bus/iio >> -rw-r--r-- 1 root root 4096 Mar 1 20:47 uevent >> >> >> On Friday, March 18, 2016 at 4:15:00 PM UTC-4, john3909 wrote: >>> >>> >>> On Mar 18, 2016, at 1:06 PM, Audrey <ao...@smith.edu> wrote: >>> >>> Hm. >>> >>> Sorry, but unfortunately I'm still quite a bit lost. What should I be >>> doing to dev/iio:device0 (open?) in order to do the following: >>> echo 1 > in_voltage0_en >>> >>> From memory, >>> >>> echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en >>> >>> echo 1 > buffer/enable >>> >>> echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable >>> >>> Regards, >>> John >>> >>> >>> I'm assuming that I should be able to see in_voltage0_en and buffer in >>> the folder /sys/bus/iio/devices/iio:device0 but I currently do not see >>> those attributes/drivers/folders/buffers/whatever-you-want-to-call-them. >>> >>> Typing >>> root@beaglebone:/dev# open iio:device0 >>> doesn't seem to do anything. >>> >>> Do you think you could break your steps down even further? >>> >>> Thanks. >>> >>> On Friday, March 18, 2016 at 3:49:39 PM UTC-4, john3909 wrote: >>>> >>>> It is a driver, so you can open, poll and read from /dev/iio:device0 >>>> >>>> For a quick test, do the following: After you enable the various >>>> scan_channels, start the buffer and then do the following: >>>> >>>> dd if=/dev/iio:device0 of=~/test.txt >>>> >>>> Press ctrl-C to stop capture. >>>> >>>> Use hexdump to view the file. >>>> >>>> Regards, >>>> John >>>> >>>> >>>> >>>> >
[beagleboard] Re: bbb Internal ADC configuration settings?
Hi everyone, First of all, thank you everyone for trying to help me. I appreciate everyone's input. I took everyone's advice, and have moved away from bash to C++. It's clocking at about 2 milliseconds, but I would really like it to go down into the microsecond range: > /** Simple LDR Reading Application > > * Written by Derek Molloy for the book "Exploring BeagleBone: Tools and > > * Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014 > > * ISBN 9781118935125. Please see the file README.md in the repository root > > * directory for copyright and GNU GPLv3 license information.*/ > > > > #include > > #include > > #include > > #include > > using namespace std; > > > > #define LDR_PATH "/sys/bus/iio/devices/iio:device0/in_voltage" > > > > int readAnalog(int number) > > { > >stringstream ss; > >ss << LDR_PATH << number << "_raw"; > >fstream fs; > >fs.open(ss.str().c_str(), fstream::in); > >fs >> number; > >fs.close(); > >return number; > > } > > > > int main(int argc, char* argv[]) > > { > >cout << "Starting the readLDR program" << endl; > >int value; > >int i=1; > >while (true) > >{ > > float value = (float)readAnalog(0)/4095*1.8; > > cout <<"V= " << value << endl; > > cout << i << endl; > > i++; > >} > >return 0; > > } > Thank you TJF for pointing me to libpruio. I'll use it later if I need it, but for now I rather not use the PRU if I don't need to. So I noticed this thing where I can't see the buffer, or scan_elements, or mode in iio:device0, and I wonder if I'm not enabling the adc dto properly or something: > root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l > total 0 > -r--r--r-- 1 root root 4096 Mar 1 20:51 dev > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage0_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage1_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage2_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage3_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage4_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage5_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage6_raw > -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage7_raw > -r--r--r-- 1 root root 4096 Mar 1 20:51 name > drwxr-xr-x 2 root root0 Mar 1 20:51 power > lrwxrwxrwx 1 root root0 Mar 1 20:50 subsystem -> > ../../../../../bus/iio > -rw-r--r-- 1 root root 4096 Mar 1 20:50 uevent This is what I've been doing to "enable" the adc (although I don't really know what it is doing. I can't find the file cape-bone-iio in bbb, and if I try echo cape-bone-iio > test.txt, it is just a regular string.): echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots I tried searching for /driver/iio/adc/ti_am335x_adc.c, but I can't find it (there's nothing in root@beaglebone:/sys/bus/iio/drivers#). Could you perhaps specify the full filepath? Thanks. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] bbb Internal ADC configuration settings?
It says: root@beaglebone:/# echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No such file or directory and I can't find scan_elements in sys/bus/iio/devices/iio:device0 root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l total 0 -r--r--r-- 1 root root 4096 Mar 1 21:13 dev -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage0_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage1_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage2_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage3_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage4_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage5_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage6_raw -rw-r--r-- 1 root root 4096 Mar 1 21:13 in_voltage7_raw -r--r--r-- 1 root root 4096 Mar 1 21:13 name drwxr-xr-x 2 root root0 Mar 1 21:13 power lrwxrwxrwx 1 root root0 Mar 1 20:47 subsystem -> ../../../../../bus/iio -rw-r--r-- 1 root root 4096 Mar 1 20:47 uevent On Friday, March 18, 2016 at 4:15:00 PM UTC-4, john3909 wrote: > > > On Mar 18, 2016, at 1:06 PM, Audrey <ao...@smith.edu > wrote: > > Hm. > > Sorry, but unfortunately I'm still quite a bit lost. What should I be > doing to dev/iio:device0 (open?) in order to do the following: > echo 1 > in_voltage0_en > > From memory, > > echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en > > echo 1 > buffer/enable > > echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable > > Regards, > John > > > I'm assuming that I should be able to see in_voltage0_en and buffer in the > folder /sys/bus/iio/devices/iio:device0 but I currently do not see those > attributes/drivers/folders/buffers/whatever-you-want-to-call-them. > > Typing > root@beaglebone:/dev# open iio:device0 > doesn't seem to do anything. > > Do you think you could break your steps down even further? > > Thanks. > > On Friday, March 18, 2016 at 3:49:39 PM UTC-4, john3909 wrote: >> >> It is a driver, so you can open, poll and read from /dev/iio:device0 >> >> For a quick test, do the following: After you enable the various >> scan_channels, start the buffer and then do the following: >> >> dd if=/dev/iio:device0 of=~/test.txt >> >> Press ctrl-C to stop capture. >> >> Use hexdump to view the file. >> >> Regards, >> John >> >> >> >> >> On Mar 18, 2016, at 12:37 PM, Audrey <ao...@smith.edu> wrote: >> >> It says: >> root@beaglebone:/dev# cd iio:device0 >> -bash: cd: iio:device0: Not a directory >> root@beaglebone:/dev# cat iio:device0 >> cat: iio:device0: Invalid argument >> >> >> On Friday, March 18, 2016 at 3:25:13 PM UTC-4, john3909 wrote: >>> >>> The buffer is available here: >>> >>> /dev/iio:device0 >>> >>> Because the driver uses interrupts, you won’t get the speed you want. >>> The driver has to be updated to use DMA if you want to use full speed. >>> Reading from the buffer will reduce your CPU load compared to using >>> LDR_PATH because this interface blocks until a sample is available, but not >>> long enough for the thread to sleep. To use DMA, IIO have introduced a DMA >>> framework and most of what you need is already available. However, IIO are >>> going to be updating the IIO DMA framework to do zero copy between the >>> kernel module and the socket interface, using MMU maps. >>> >>> Regards, >>> John >>> >>> >>> >>> >>> On Mar 18, 2016, at 11:21 AM, Audrey <ao...@smith.edu> wrote: >>> >>> Hi everyone, >>> >>> First of all, thank you everyone for trying to help me. I appreciate >>> everyone's input. >>> >>> I took everyone's advice, and have moved away from bash to C++. It's >>> clocking at about 2 milliseconds, but I would really like it to go down >>> into the microsecond range: >>> >>>> /** Simple LDR Reading Application >>>> * Written by Derek Molloy for the book "Exploring BeagleBone: Tools and >>>> * Techniques for Building with Embedded Linux" by John Wiley & Sons, >>>> 2014 >>>> * ISBN 9781118935125. Please see the file README.md in the repository >>>> root >>>> * directory for copyright and GNU GPLv3 license information. >>>> */ >>>> >>>> #include >>>> #include >>>> #include >>>> #include >>>> using namespac
Re: [beagleboard] bbb Internal ADC configuration settings?
It says: root@beaglebone:/dev# cd iio:device0 -bash: cd: iio:device0: Not a directory root@beaglebone:/dev# cat iio:device0 cat: iio:device0: Invalid argument On Friday, March 18, 2016 at 3:25:13 PM UTC-4, john3909 wrote: > > The buffer is available here: > > /dev/iio:device0 > > Because the driver uses interrupts, you won’t get the speed you want. The > driver has to be updated to use DMA if you want to use full speed. Reading > from the buffer will reduce your CPU load compared to using LDR_PATH > because this interface blocks until a sample is available, but not long > enough for the thread to sleep. To use DMA, IIO have introduced a DMA > framework and most of what you need is already available. However, IIO are > going to be updating the IIO DMA framework to do zero copy between the > kernel module and the socket interface, using MMU maps. > > Regards, > John > > > > > On Mar 18, 2016, at 11:21 AM, Audrey <ao...@smith.edu > > wrote: > > Hi everyone, > > First of all, thank you everyone for trying to help me. I appreciate > everyone's input. > > I took everyone's advice, and have moved away from bash to C++. It's > clocking at about 2 milliseconds, but I would really like it to go down > into the microsecond range: > >> /** Simple LDR Reading Application >> * Written by Derek Molloy for the book "Exploring BeagleBone: Tools and >> * Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014 >> * ISBN 9781118935125. Please see the file README.md in the repository root >> * directory for copyright and GNU GPLv3 license information.*/ >> >> #include >> #include >> #include >> #include >> using namespace std; >> >> #define LDR_PATH "/sys/bus/iio/devices/iio:device0/in_voltage" >> >> int readAnalog(int number) >> { >>stringstream ss; >>ss << LDR_PATH << number << "_raw"; >>fstream fs; >>fs.open(ss.str().c_str(), fstream::in); >>fs >> number; >>fs.close(); >>return number; >> } >> >> int main(int argc, char* argv[]) >> { >>cout << "Starting the readLDR program" << endl; >>int value; >>int i=1; >>while (true) >>{ >> float value = (float)readAnalog(0)/4095*1.8; >> cout <<"V= " << value << endl; >> cout << i << endl; >> i++; >>} >>return 0; >> } >> > > Thank you TJF for pointing me to libpruio. I'll use it later if I need it, > but for now I rather not use the PRU if I don't need to. > > So I noticed this thing where I can't see the buffer, or scan_elements, or > mode in iio:device0, and I wonder if I'm not enabling the adc dto properly > or something: > >> root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l >> total 0 >> -r--r--r-- 1 root root 4096 Mar 1 20:51 dev >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage0_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage1_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage2_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage3_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage4_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage5_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage6_raw >> -rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage7_raw >> -r--r--r-- 1 root root 4096 Mar 1 20:51 name >> drwxr-xr-x 2 root root0 Mar 1 20:51 power >> lrwxrwxrwx 1 root root0 Mar 1 20:50 subsystem -> >> ../../../../../bus/iio >> -rw-r--r-- 1 root root 4096 Mar 1 20:50 uevent > > > This is what I've been doing to "enable" the adc (although I don't really > know what it is doing. I can't find the file cape-bone-iio in bbb, and if I > try echo cape-bone-iio > test.txt, it is just a regular string.): > echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots > > I tried searching for /driver/iio/adc/ti_am335x_adc.c, but I can't find it > (there's nothing in root@beaglebone:/sys/bus/iio/drivers#). Could you > perhaps specify the full filepath? > > Thanks. > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beagleboard...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. > > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] bbb Internal ADC configuration settings?
Thanks for the reply John. Could you perhaps explain how to modify the oversample, open delay time, and sample time in greater detail in the BB-ADC overlay? I do not see these variables in the dto in github (https://github.com/beagleboard/devicetree-source/blob/master/arch/arm/boot/dts/BB-ADC-00A0.dts). Also, what value can/should I change them to? So just to clarify, reading from /sys/bus/iio/devices/iio:device0/in_voltage0_raw reads attributes using sysfs, while reading from /dev/iio:device0 reads the values using IIO? Also another conceptual question, can you explain what exactly is in_voltage0_raw and iio:device0? I know it's not a folder, and I interact with it by using cat. So is it just like a text file or something? Thanks. On Sunday, March 6, 2016 at 2:15:17 PM UTC-5, john3909 wrote: > > That is because you are doing this wrong. Reading attributes via sysfs is > slow and not meant for this purpose. With IIO, you enable a scan element > (echo 1 > in_voltage0_en) and then you enable the buffer (echo 1 > > buffer/enable)and then you read the values from /dev/iio:device0. In the > BB-ADC overlay, you can modify the scan update time by modifying the > Oversample (default is 16x), Open Delay time (default is 0x98) and sample > time (default is 1). Now the IIO ADC driver captures samples using > interrupts which isn’t ideal, but it will capture samples at a much higher > rate than can be read from sysfs. If you want to capture at full speed, the > driver needs to be updated to use DMA. > > Regards, > John > > > > > On Mar 6, 2016, at 12:19 AM, Audrey <ao...@smith.edu > wrote: > > Where can I find it (and set it)? > > I'm right now trying to collect voltage readings using beaglebone's > internal adc using a bash script and a while loop. Right now the data > collection is clocking at around 33 microseconds, but I know that the > internal adc should be able to collect data as fast as 5 microseconds. What > should I do to make that happen? Is the problem with making while loops > move faster, or is it about setting the adc configurations? > > This is my bash script: > > #!/bin/bash > > #echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots > > t0=$(date +%s%6N) > > while true; do >t1=$(date +%s%6N) >rawVal=$(cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw) >voltage=$(bc -l <<< $rawVal/4095*1.8) >time=$(expr $t1 - $t0) >echo $time $voltage > done > > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beagleboard...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. > > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] bbb Internal ADC configuration settings?
Where can I find it (and set it)? I'm right now trying to collect voltage readings using beaglebone's internal adc using a bash script and a while loop. Right now the data collection is clocking at around 33 microseconds, but I know that the internal adc should be able to collect data as fast as 5 microseconds. What should I do to make that happen? Is the problem with making while loops move faster, or is it about setting the adc configurations? This is my bash script: #!/bin/bash #echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots t0=$(date +%s%6N) while true; do t1=$(date +%s%6N) rawVal=$(cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw) voltage=$(bc -l <<< $rawVal/4095*1.8) time=$(expr $t1 - $t0) echo $time $voltage done -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] Installing bc package/ floating point arithmetic in BASH
You were right. Thanks! It works now. On Friday, March 4, 2016 at 9:55:58 PM UTC-5, William Hermans wrote: > > You should probably check to make sure you're actually connected to the > internet . . . chances are really good based on your output that you're > not.. > > On Fri, Mar 4, 2016 at 7:16 PM, Audrey <ao...@smith.edu > > wrote: > >> Hi I tried that but it still didn't work. apt-get update had problems: >> >> root@beaglebone:~# apt-get update >> Err http://repos.rcn-ee.net wheezy Release.gpg >> Could not resolve 'repos.rcn-ee.net' >> Err http://security.debian.org wheezy/updates Release.gpg >> Could not resolve 'security.debian.org' >> Err http://ftp.us.debian.org wheezy Release.gpg >> Could not resolve 'ftp.us.debian.org' >> Err http://ftp.us.debian.org wheezy-updates Release.gpg >> Could not resolve 'ftp.us.debian.org' >> Reading package lists... Done >> W: Failed to fetch >> http://ftp.us.debian.org/debian/dists/wheezy/Release.gpg Could not >> resolve 'ftp.us.debian.org' >> >> W: Failed to fetch >> http://ftp.us.debian.org/debian/dists/wheezy-updates/Release.gpg Could >> not resolve 'ftp.us.debian.org' >> >> W: Failed to fetch >> http://security.debian.org/dists/wheezy/updates/Release.gpg Could not >> resolve 'security.debian.org' >> >> W: Failed to fetch >> http://repos.rcn-ee.net/debian/dists/wheezy/Release.gpg Could not >> resolve 'repos.rcn-ee.net' >> >> W: Some index files failed to download. They have been ignored, or old >> ones used instead. >> >> >> On Friday, March 4, 2016 at 5:33:56 PM UTC-5, RobertCNelson wrote: >>> >>> On Fri, Mar 4, 2016 at 4:22 PM, Audrey <ao...@smith.edu> wrote: >>> > So I want to do floating point arithmetic in BASH, but I have trouble >>> > installing the bc package (https://www.gnu.org/software/bc/). >>> > >>> > I type in: >>> > apt-get install bc >>> > >>> > and it tells me: >>> > Reading package lists... Done >>> > Building dependency tree >>> > Reading state information... Done >>> > E: Unable to locate package bc >>> > >>> > So. Any idea on how to either do floating point arithmetic in BASH >>> some >>> > other way, or how to install bc on beaglebone black? >>> >>> apt-get update >>> apt-get install bc >>> >>> Regards, >>> >>> -- >>> Robert Nelson >>> https://rcn-ee.com/ >>> >> -- >> For more options, visit http://beagleboard.org/discuss >> --- >> You received this message because you are subscribed to the Google Groups >> "BeagleBoard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to beagleboard...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] Installing bc package/ floating point arithmetic in BASH
Hi I tried that but it still didn't work. apt-get update had problems: root@beaglebone:~# apt-get update Err http://repos.rcn-ee.net wheezy Release.gpg Could not resolve 'repos.rcn-ee.net' Err http://security.debian.org wheezy/updates Release.gpg Could not resolve 'security.debian.org' Err http://ftp.us.debian.org wheezy Release.gpg Could not resolve 'ftp.us.debian.org' Err http://ftp.us.debian.org wheezy-updates Release.gpg Could not resolve 'ftp.us.debian.org' Reading package lists... Done W: Failed to fetch http://ftp.us.debian.org/debian/dists/wheezy/Release.gpg Could not resolve 'ftp.us.debian.org' W: Failed to fetch http://ftp.us.debian.org/debian/dists/wheezy-updates/Release.gpg Could not resolve 'ftp.us.debian.org' W: Failed to fetch http://security.debian.org/dists/wheezy/updates/Release.gpg Could not resolve 'security.debian.org' W: Failed to fetch http://repos.rcn-ee.net/debian/dists/wheezy/Release.gpg Could not resolve 'repos.rcn-ee.net' W: Some index files failed to download. They have been ignored, or old ones used instead. On Friday, March 4, 2016 at 5:33:56 PM UTC-5, RobertCNelson wrote: > > On Fri, Mar 4, 2016 at 4:22 PM, Audrey <ao...@smith.edu > > wrote: > > So I want to do floating point arithmetic in BASH, but I have trouble > > installing the bc package (https://www.gnu.org/software/bc/). > > > > I type in: > > apt-get install bc > > > > and it tells me: > > Reading package lists... Done > > Building dependency tree > > Reading state information... Done > > E: Unable to locate package bc > > > > So. Any idea on how to either do floating point arithmetic in BASH some > > other way, or how to install bc on beaglebone black? > > apt-get update > apt-get install bc > > Regards, > > -- > Robert Nelson > https://rcn-ee.com/ > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Installing bc package/ floating point arithmetic in BASH
So I want to do floating point arithmetic in BASH, but I have trouble installing the bc package (https://www.gnu.org/software/bc/). I type in: apt-get install bc and it tells me: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package bc So. Any idea on how to either do floating point arithmetic in BASH some other way, or how to install bc on beaglebone black? Alternatively, is it possible to pass in a value from bash to like a java script or something? -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] Re: bonescript analogRead() while loop
Thanks so much for the help! On Thursday, March 3, 2016 at 12:46:02 PM UTC-5, William Hermans wrote: > > *I'm still a bit confused about while loops vs setInterval() though. Like >> I vaguely get that there is a difference between the two but I don't really >> understand javascript all that well. * >> >> *Why does setInterval() work while the while loop does not? What is the >> code if I wanted to implement my own setInterval() function?* >> > > Here: http://stackoverflow.com/questions/729921/settimeout-or-setinterval > is a good explanation of what setInterval(), and setTimeout() *are*. But > again, Javascript is an event driven language, which in this context is an > incredible strength. setInterval(), and setTimeout() are events( or > callbacks if you prefer ). They're meant to "fire" when a certain > condition has been met, and execute a callback function. These are all but > guaranteed to execute. > > On the opposite side of things. while is just a loop. A loop which may > repeat so often is actually overwhelms the code that is meant to run . . > .But in fact I'm not 100% sure what the problem may be. I have not looked > through every bit of related code, and quite honestly I won't either. My > instinct does tell me that there is a glitch in the bonescript code, and > just willy nilly running that code in a loop is the root cause. > > On Thu, Mar 3, 2016 at 5:56 AM, Dennis Lee Bieber <wlf...@ix.netcom.com > > wrote: > >> On Wed, 2 Mar 2016 21:02:38 -0800 (PST), Audrey >> <ao...@smith.edu > declaimed the following: >> >> >Hi sorry, yeah no I did actually use >> > >> >b.analogRead('P9_36', printStatus); >> > >> >although I did write it here as just analogRead('P9_36', printStatus); >> > >> >So I don't think that's the issue, although good point. >> > >> >> As gets pointed out in comp.lang.python quite often: >> >> Always use cut to avoid transcription errors that cause >> others to >> go off in the wrong direction... >> -- >> Wulfraed Dennis Lee Bieber AF6VN >> wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/ >> >> -- >> For more options, visit http://beagleboard.org/discuss >> --- >> You received this message because you are subscribed to the Google Groups >> "BeagleBoard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to beagleboard...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] Re: bonescript analogRead() while loop
Yeah I don't really like it either by the bonescript library documentation doesn't specify further than what they gave so I wouldn't know what to put as x even if I did want to put it in. Yes, setInterval() did the trick. Thanks for your help! I'm still a bit confused about while loops vs setInterval() though. Like I vaguely get that there is a difference between the two but I don't really understand javascript all that well. Why does setInterval() work while the while loop does not? What is the code if I wanted to implement my own setInterval() function? On Thursday, March 3, 2016 at 2:49:56 AM UTC-5, William Hermans wrote: > > However, I definitely would not consider this good coding style* > > On Thu, Mar 3, 2016 at 12:48 AM, William Hermans <yyr...@gmail.com > > wrote: > >> Audrey, and yeah I vaguely remember something about Javascript for single >> parameter functions using the function with no parameter when called is >> possible. However, I definitely would not good coding style . . . >> >> On Thu, Mar 3, 2016 at 12:15 AM, William Hermans <yyr...@gmail.com >> > wrote: >> >>> *Yeah, I was thinking that the asynchronous/callback nature of >>>> javascript is the problem for this but I was wondering how to circumvent >>>> it.* >>>> >>> >>> The typical way to deal with this type of situation would be to write a >>> callback. In this case, it might be better to write a timed callback, >>> instead of running a constant loop. loops typically I tend to think of as >>> procedural, where javascript really isnt procedural in nature. More >>> callback / object oriented if that makes sense ? >>> >>> So perhaps use setTimeout() instead of a loop. >>> >>> On Wed, Mar 2, 2016 at 11:54 PM, Audrey <ao...@smith.edu > >>> wrote: >>> >>>> I'm not sure why printStatus() doesn't require a argument when called, >>>> but that's what they used in the documentation ( >>>> http://beagleboard.org/support/BoneScript/analogRead/) and I have used >>>> it for a single data point and it worked. I believe analogRead passes in >>>> the argument x into printStatus for you. >>>> >>>> Yeah, I was thinking that the asynchronous/callback nature of >>>> javascript is the problem for this but I was wondering how to circumvent >>>> it. >>>> >>>> On Thursday, March 3, 2016 at 1:37:49 AM UTC-5, William Hermans wrote: >>>>> >>>>> var b = require('bonescript'); >>>>> while (true) { >>>>>analogRead('P9_36', printStatus); >>>>> } >>>>> function printStatus(x) { >>>>>console.log('x.value = ' + x.value); >>>>> } >>>>> >>>>> I havent seen the prototype for analogRead() but the above code seems >>>>> wrong. printStatus() takes a single arguement, yet you're not passing any >>>>> argument to it. Another thing I would like to point out. All Javascript >>>>> should be async in nature, since Javascript is callback oriented. This is >>>>> like one of the major language attractions over other languages. >>>>> >>>>> Anyway, I'm thinking your problem with not getting anything to print, >>>>> is that you're not actually passing anything to the printing function . .. >>>>> >>>>> On Wed, Mar 2, 2016 at 10:02 PM, Audrey <ao...@smith.edu> wrote: >>>>> >>>>>> Hi sorry, yeah no I did actually use >>>>>> >>>>>> b.analogRead('P9_36', printStatus); >>>>>> >>>>>> although I did write it here as just analogRead('P9_36', >>>>>> printStatus); >>>>>> >>>>>> So I don't think that's the issue, although good point. >>>>>> >>>>>> On Wednesday, March 2, 2016 at 11:07:41 PM UTC-5, Dennis Lee Bieber >>>>>> wrote: >>>>>>> >>>>>>> On Wed, 2 Mar 2016 15:06:05 -0800 (PST), Audrey >>>>>>> <ao...@smith.edu> declaimed the following: >>>>>>> >>>>>>> > >>>>>>> >Hi guys, >>>>>>> > >>>>>>> >So I want to use the function analogRead() with a while loop, like >>>>>>> so: >>>>>>> > >>>>>>> >var b = require('bonescript'); >>>>>&g
Re: [beagleboard] Re: bonescript analogRead() while loop
I'm not sure why printStatus() doesn't require a argument when called, but that's what they used in the documentation (http://beagleboard.org/support/BoneScript/analogRead/) and I have used it for a single data point and it worked. I believe analogRead passes in the argument x into printStatus for you. Yeah, I was thinking that the asynchronous/callback nature of javascript is the problem for this but I was wondering how to circumvent it. On Thursday, March 3, 2016 at 1:37:49 AM UTC-5, William Hermans wrote: > > var b = require('bonescript'); > while (true) { >analogRead('P9_36', printStatus); > } > function printStatus(x) { >console.log('x.value = ' + x.value); > } > > I havent seen the prototype for analogRead() but the above code seems > wrong. printStatus() takes a single arguement, yet you're not passing any > argument to it. Another thing I would like to point out. All Javascript > should be async in nature, since Javascript is callback oriented. This is > like one of the major language attractions over other languages. > > Anyway, I'm thinking your problem with not getting anything to print, is > that you're not actually passing anything to the printing function . .. > > On Wed, Mar 2, 2016 at 10:02 PM, Audrey <ao...@smith.edu > > wrote: > >> Hi sorry, yeah no I did actually use >> >> b.analogRead('P9_36', printStatus); >> >> although I did write it here as just analogRead('P9_36', printStatus); >> >> So I don't think that's the issue, although good point. >> >> On Wednesday, March 2, 2016 at 11:07:41 PM UTC-5, Dennis Lee Bieber wrote: >>> >>> On Wed, 2 Mar 2016 15:06:05 -0800 (PST), Audrey >>> <ao...@smith.edu> declaimed the following: >>> >>> > >>> >Hi guys, >>> > >>> >So I want to use the function analogRead() with a while loop, like so: >>> > >>> >var b = require('bonescript'); >>> >while (true) { >>> > analogRead('P9_36', printStatus); >>> >>> Based upon all the examples I've seen, you need to reference the >>> analogRead() IN THE "require" MODULE... >>> >>> b.analogRead(...) >>> >>> http://beagleboard.org/Support/BoneScript/analogRead/ >>> -- >>> Wulfraed Dennis Lee Bieber AF6VN >>> wlf...@ix.netcom.comHTTP://wlfraed.home.netcom.com/ >>> >>> -- >> For more options, visit http://beagleboard.org/discuss >> --- >> You received this message because you are subscribed to the Google Groups >> "BeagleBoard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to beagleboard...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Re: Help with Enabling SPI?
Hi William and John, I managed to get the SPI enabled! Instead of changing the uEnv/nfs-uEnv files, I stopped at the step right before and ran the test to check if the SPI was enabled, and it was. Thanks for all of your help! -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [beagleboard] Help with Enabling SPI?
Hi William, Thanks for your reply. I'm trying to flash bbb now. Could I ask what's the difference between flashing an image vs flashing the eMMC? I thought flashing the bbb meant flashing everything. I do not currently have anything that I want to keep on bbb. What's the difference between booting from an nfs share vs booting normally? Also, what do you suggest I do in the future? I didn't follow the blog guy's advice and had simply added the line, although I did change the file name from nfs-uEnv.txt to uEnv.txt. Should I leave the file name as nfs-uEnv.txt next time? Thanks. On Friday, February 19, 2016 at 7:04:16 PM UTC-5, William Hermans wrote: > > *After that, I changed the name of the file from nfs-uEnv.txt to just >> uEnv.txt and rebooted bbb by typing reboot on the terminal, and now I don't >> think bbb works.* >> > > Ok, I missed this part originally. Yes, you're attempting to boot from an > nfs share, so unless you have an nfs share, setup exactly like how is > implied in the uEnv,txt file. Changing nfs-uEnv.txt to uEnv.txt without > modification will fail. > > On Fri, Feb 19, 2016 at 4:59 PM, William Hermans <yyr...@gmail.com > > wrote: > >> *Delete any lines that may appear in uEnv.txt and add the following and >>> save. This change will tell the board to apply the SPI0 Device Tree >>> Overlay we created on startup.* >>> >> >> The above is very, very bad advice. The uEnv.txt is a very important file >> for booting the beaglebone black( or any beagle hardware ), and arbitrarily >> deleting lines from, or the whole file is not very smart at all. I would >> suggest in the future to avoid any advice, guide, or whatever from that >> blog site. >> >> So, if you board is now in an unbootable state, you're options are rather >> limited. In either case, you will need an sdcard, with either a standalone, >> or flashing image on it. Then boot from that. With a standalone image, >> you'll have to reinstate the uEnv.txt file back to the original contents >> before you followed that bad advice from that blog site. If you do not know >> how to do this, then perhaps your best option is to reflash the entire eMMC. >> >> If you have data on the eMMC that you need / want to keep. You can back >> that up fairly easily before reflashing . . . >> >> On Fri, Feb 19, 2016 at 4:44 PM, Audrey <ao...@smith.edu > >> wrote: >> >>> Hi everyone, >>> >>> I want to enable SPI0 on beaglebone black, and I've been following >>> resources online: >>> >>> >>> http://embedded-basics.blogspot.com/2014/10/enabling-spi0-on-beaglebone-black.html >>> http://elinux.org/BeagleBone_Black_Enable_SPIDEV >>> >>> after changing uEnv.txt and rebooting bbb however, bbb doesn't come back >>> online. All 4 of the usr LEDs are on, and I can no longer connect back to >>> beaglebone. >>> >>> Firstly, a few clarifications, in My Computer > BeagleBone Getting >>> Started, I did not find any uEnv.txt file, but nfs-uEnv.txt. The contents >>> of nfs-uEnv.txt are: >>> >>> ##Rename as: uEnv.txt to boot via nfs >>>> ##https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt >>>> ##SERVER: sudo apt-get install tftpd-hpa >>>> ##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa >>>> ##SERVER: zImage/*.dtb need to be located here: >>>> ##SERVER: TFTP_DIRECTORY/zImage >>>> ##SERVER: TFTP_DIRECTORY/dtbs/*.dtb >>>> ##client_ip needs to be set for u-boot to try booting via nfs >>>> client_ip=192.168.1.101 >>>> #u-boot defaults: uncomment and override where needed >>>> #server_ip=192.168.1.100 >>>> #gw_ip=192.168.1.1 >>>> #netmask=255.255.255.0 >>>> #hostname= >>>> #device=eth0 >>>> #autoconf=off >>>> #root_dir=/home/userid/targetNFS >>>> #nfs_options=,vers=3 >>>> #nfsrootfstype=ext4 rootwait fixrtc >>>> >>> >>> In the embedded-linux blog, he suggested to delete everything in the >>> file and put in >>> >>> optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01 >>>> >>>> >>> I however followed the instructions from elinux, and just copied the the >>> above line. After that, I changed the name of the file from nfs-uEnv.txt to >>> just uEnv.txt and rebooted bbb by typing reboot on the terminal, and now I >>> don't think bbb works. >>> >>> Any ideas on what I'm doing wrong? >>
Re: [beagleboard] Help with Enabling SPI?
Hi John, Thanks for your reply. I'm new to linux systems, much less embedded linux systems. How would I know if I'm using NFS and systemd? I'm currently in the processing of flashing bbb, so I don't know if this new version of bb will be the same as before. Also, I thought enabling the SPI was an internal process? From what I've been reading about NFS and connman they talk about internet connections etc. I'm a bit confused. What's the difference between uEnv.txt vs nfs-uEnv.txt? Thanks! On Friday, February 19, 2016 at 9:34:48 PM UTC-5, john3909 wrote: > > I’ve had this problem myself. If you are using NFS and systemd, then you > must prevent connman from managing eth0: > > In /lib/systemd/system/connman.service, add -I eth0 to the connmand line > > Regards, > John > > > > > On Feb 19, 2016, at 3:44 PM, Audrey <ao...@smith.edu > wrote: > > Hi everyone, > > I want to enable SPI0 on beaglebone black, and I've been following > resources online: > > > http://embedded-basics.blogspot.com/2014/10/enabling-spi0-on-beaglebone-black.html > http://elinux.org/BeagleBone_Black_Enable_SPIDEV > > after changing uEnv.txt and rebooting bbb however, bbb doesn't come back > online. All 4 of the usr LEDs are on, and I can no longer connect back to > beaglebone. > > Firstly, a few clarifications, in My Computer > BeagleBone Getting > Started, I did not find any uEnv.txt file, but nfs-uEnv.txt. The contents > of nfs-uEnv.txt are: > > ##Rename as: uEnv.txt to boot via nfs >> ##https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt >> ##SERVER: sudo apt-get install tftpd-hpa >> ##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa >> ##SERVER: zImage/*.dtb need to be located here: >> ##SERVER: TFTP_DIRECTORY/zImage >> ##SERVER: TFTP_DIRECTORY/dtbs/*.dtb >> ##client_ip needs to be set for u-boot to try booting via nfs >> client_ip=192.168.1.101 >> #u-boot defaults: uncomment and override where needed >> #server_ip=192.168.1.100 >> #gw_ip=192.168.1.1 >> #netmask=255.255.255.0 >> #hostname= >> #device=eth0 >> #autoconf=off >> #root_dir=/home/userid/targetNFS >> #nfs_options=,vers=3 >> #nfsrootfstype=ext4 rootwait fixrtc >> > > In the embedded-linux blog, he suggested to delete everything in the file > and put in > > optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01 >> >> > I however followed the instructions from elinux, and just copied the the > above line. After that, I changed the name of the file from nfs-uEnv.txt to > just uEnv.txt and rebooted bbb by typing reboot on the terminal, and now I > don't think bbb works. > > Any ideas on what I'm doing wrong? > > Thanks. > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beagleboard...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. > > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Help with Enabling SPI?
Hi everyone, I want to enable SPI0 on beaglebone black, and I've been following resources online: http://embedded-basics.blogspot.com/2014/10/enabling-spi0-on-beaglebone-black.html http://elinux.org/BeagleBone_Black_Enable_SPIDEV after changing uEnv.txt and rebooting bbb however, bbb doesn't come back online. All 4 of the usr LEDs are on, and I can no longer connect back to beaglebone. Firstly, a few clarifications, in My Computer > BeagleBone Getting Started, I did not find any uEnv.txt file, but nfs-uEnv.txt. The contents of nfs-uEnv.txt are: ##Rename as: uEnv.txt to boot via nfs > ##https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt > ##SERVER: sudo apt-get install tftpd-hpa > ##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa > ##SERVER: zImage/*.dtb need to be located here: > ##SERVER: TFTP_DIRECTORY/zImage > ##SERVER: TFTP_DIRECTORY/dtbs/*.dtb > ##client_ip needs to be set for u-boot to try booting via nfs > client_ip=192.168.1.101 > #u-boot defaults: uncomment and override where needed > #server_ip=192.168.1.100 > #gw_ip=192.168.1.1 > #netmask=255.255.255.0 > #hostname= > #device=eth0 > #autoconf=off > #root_dir=/home/userid/targetNFS > #nfs_options=,vers=3 > #nfsrootfstype=ext4 rootwait fixrtc > In the embedded-linux blog, he suggested to delete everything in the file and put in optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01 > > I however followed the instructions from elinux, and just copied the the above line. After that, I changed the name of the file from nfs-uEnv.txt to just uEnv.txt and rebooted bbb by typing reboot on the terminal, and now I don't think bbb works. Any ideas on what I'm doing wrong? Thanks. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.