Comments on: Chapter 9: Interacting with the Physical Environment http://exploringbeaglebone.com Companion Site for the Book by Derek Molloy Wed, 11 Nov 2020 14:16:31 +0000 hourly 1 https://wordpress.org/?v=5.9.2 By: Jose Galan http://exploringbeaglebone.com/chapter9/#comment-2312 Wed, 11 Nov 2020 14:16:31 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2312 Thank you so much for the book and the site. Your dedication to teach others, your methodology and detail is wonderful. As a hobby I’m learning BB, I’m old, use to developed in C in the (87-96) , after that i went to administration in databases and i have been doing that since. In the steeper motor class and application , I’m getting “No such file or Directory” i started debugging the issue, to me is related to new versions of the kernel or library. Others are also reporting the same issue. I did the debug manually, I will get more detail as soon i finish the eclipse setup. Any recommendation?

exploringBB::write (path=”/sys/class/gpio/cd /”, filename=”value”, value=”0″) at /home/debian/C++/exploringBB/library/gpio/util.cpp:43
43 if (!fs.is_open()){
(gdb) s
44 perror(“GPIO: write failed to open file “);
(gdb) s
__GI_perror (s=0xb6fc28f4 “GPIO: write failed to open file “) at perror.c:49
49 perror.c: No such file or directory.
(gdb) s
58 in perror.c
(gdb) s
__GI___fileno (fp=0xb6e02d10 ) at fileno.c:35
35 fileno.c: No such file or directory.
(gdb) s
dup () at ../sysdeps/unix/syscall-template.S:78
78 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) s
79 in ../sysdeps/unix/syscall-template.S
(gdb) s
_IO_new_fdopen (fd=fd@entry=3, mode=0xb6de4094 “w+”) at iofdopen.c:53
53 iofdopen.c: No such file or directory.
(gdb) s
68 in iofdopen.c
(gdb) s
70 in iofdopen.c
(gdb) s
75 in iofdopen.c
(gdb) s
76 in iofdopen.c
(gdb)
88 in iofdopen.c
(gdb)
__GI___libc_fcntl (fd=fd@entry=3, cmd=3) at ../sysdeps/unix/sysv/linux/fcntl.c:42
42 ../sysdeps/unix/sysv/linux/fcntl.c: No such file or directory.

]]>
By: John Kollman http://exploringbeaglebone.com/chapter9/#comment-2296 Sun, 21 Jun 2020 02:06:10 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2296 In reply to John Kollman.

StepperMotor::~StepperMotor() {
delete(this->gpio_MS1);
delete(this->gpio_MS2);
delete(this->gpio_STEP);
delete(this->gpio_SLP);
delete(this->gpio_DIR);
}

]]>
By: John Kollman http://exploringbeaglebone.com/chapter9/#comment-2294 Fri, 19 Jun 2020 04:54:00 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2294 Hi Derek,
I can cross compile the stepper example, I move it to the beaglebone black with the shared object from the libraries and I get a bunch of these errors:
GPIO: write failed to open file : No such file or directory
I run it again and get fewer errors and the motor steps but direction and changing steps do not do anything.
Any thoughts?
Thanks,
John

]]>
By: Derek http://exploringbeaglebone.com/chapter9/#comment-2244 Wed, 07 Aug 2019 22:04:45 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2244 In reply to Stewart Todd Morgan.

Thanks Stewart, I appreciate you flagging those issues. Derek.

]]>
By: Stewart Todd Morgan http://exploringbeaglebone.com/chapter9/#comment-2242 Wed, 07 Aug 2019 20:03:01 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2242 2nd Edition pp. 404-405 (Unneeded/unintentional duplication of text) Compare the paragraph beginning “One solution is to place a Zener diode…” on page 404 with the the paragraph beginning “An alternative to this configuration is to place a Zener diode…” on page 405. Apart from the beginning of the paragraph, these paragraphs are the same, so you might want to strike one in subsequent printings/editions.

]]>
By: Stewart Todd Morgan http://exploringbeaglebone.com/chapter9/#comment-2240 Wed, 07 Aug 2019 19:42:57 +0000 http://exploringbeaglebone.com/?page_id=889#comment-2240 2nd Edition, Page 412, Apparent typo (missing “l” in a directory name): “The build script assumes that the example application source is in /expor-ingbb/chp09/dcmotor/” where the directory should be /explor-ingbb/chp09/dcmotor/.

]]>
By: Derek http://exploringbeaglebone.com/chapter9/#comment-1246 Tue, 14 Apr 2015 21:05:53 +0000 http://exploringbeaglebone.com/?page_id=889#comment-1246 In reply to Brett.

Thanks Brett — very useful!

]]>
By: Brett http://exploringbeaglebone.com/chapter9/#comment-1230 Tue, 14 Apr 2015 13:18:53 +0000 http://exploringbeaglebone.com/?page_id=889#comment-1230 In reply to Derek.

It’s a 2-liner: Let’s assume your x, y data are in a file called calibrate.dat. Then, from within gnuplot type:
f(x) = A + B/x
fit f(x) “calibrate.dat” u 1:2 via A, B

you can then plot the data & the fit with:
plot “calibrate.dat” u 1:2, f(x)

You can choose the fitting range by inserting [lowx: highx] before the filename. (lowx & highx are numbers that define the region over which you wish to fit.

]]>
By: Derek http://exploringbeaglebone.com/chapter9/#comment-1220 Mon, 13 Apr 2015 18:13:27 +0000 http://exploringbeaglebone.com/?page_id=889#comment-1220 In reply to Brett.

Thanks Brett, I had no idea you could perform curve fitting with gnuplot… that’s great to know — I even used it for the additional web materials for Chapter 8 and 13. I’ll have to play with it now! Thanks, Derek.

]]>
By: Brett http://exploringbeaglebone.com/chapter9/#comment-1214 Mon, 13 Apr 2015 14:34:22 +0000 http://exploringbeaglebone.com/?page_id=889#comment-1214 In reply to Derek.

I don’t know how to directly fit to 1/x on Wolfram Alpha, but you could do a linear fit of ln(y) vs ln(x), but extracting the desired coefficients from the fitted ones is obviously messier than for the exponential fit that you did. For my classes, memory was not critical so I just installed gnuplot (freely available for all platforms) on the classes’ Beaglebones. Fitting was then a snap. I hope to put my music software on GitHub sometime this summer. When I do, I’ll let you know. The Theremin is a small part of a much larger project, but it was entertaining. Perhaps I’ll post the Theremin part separately — it does have a few useful tricks in it. Regards, Brett

]]>