-
- Raspberry Pi Foundation Employee & Forum Moderator
- Posts: 11
- Joined: Mon Feb 17, 2014 11:10 am
STICKY: Errata
Have you spotted a mistake in a recent issue of The MagPi? Let us know here!
Re: Errata
Hi guys.
Firstly, thanks for the great mag.
Secondly on page 33 of issue 33 Richard Smedly
goes into detail about octal numbering relating to
file permissions without first stating what he is referring too.
Had to look up external references to see what was going on.
Apparently its got to do with changing ownership using those octal
numbers. This is done by using chmod XXX filename where XXX refer
to the octal numbers spoken about in the article.
Thanks
Firstly, thanks for the great mag.
Secondly on page 33 of issue 33 Richard Smedly
goes into detail about octal numbering relating to
file permissions without first stating what he is referring too.
Had to look up external references to see what was going on.
Apparently its got to do with changing ownership using those octal
numbers. This is done by using chmod XXX filename where XXX refer
to the octal numbers spoken about in the article.
Thanks
-
- Posts: 3
- Joined: Fri Jan 23, 2015 9:37 pm
Re: Errata
Good point, we should link to relevant manual pages or information for technical information like this.
chmod uses octal (base 8) for encoding 'user', 'group' and 'other' permissions. Each of these has 3 bits, or pieces of information (is it readable, is it writeable, is it executable).
You can use chmod to modify permissions like this:
chmod u+x grants execute permissions to user
chmod u-x revokes execute permissions from user
chmod +x grants execute permissions to user, group, and other
or you can use it to modify permissions in one go like this:
chmod 555 gives read and execute, but no write, to user, group, and other.
5(octal) in binary is 101, so that's r-x ..... read, not write, execute
Because there are 3 bits (binary digits) of flags for user, group and other, and there are 8 combinations of those, this usefully encodes into a base 8 (octal) number.
There is a good calculator here:
http://permissions-calculator.org
There is a good description of the permissions flags and their octal equivalents on the chmod wiki page here:
http://en.wikipedia.org/wiki/Chmod
You can lookup the unix man page for chmod here:
http://unixhelp.ed.ac.uk/CGI/man-cgi?chmod
Or on your raspberry pi, type this at a command prompt to read the resident linux man page on it:
man chmod
If you use ls -l you will see the file permission bits listed in the long directory listing, so when you see the following:
r-xr-x---
Split these into 3 groups (user, group, other)
r-x r-x ---
Now imagine them as binary with the following base-8(octal) headings
421 421 421
101 101 000
Now convert those to octal (base-8) using the base-8 headings as listed above
5 5 0
So chmod 550 will set permissions user(r-x) group(r-x) other()
David
@whaleygeek
Technical editor, The Magpi.
chmod uses octal (base 8) for encoding 'user', 'group' and 'other' permissions. Each of these has 3 bits, or pieces of information (is it readable, is it writeable, is it executable).
You can use chmod to modify permissions like this:
chmod u+x grants execute permissions to user
chmod u-x revokes execute permissions from user
chmod +x grants execute permissions to user, group, and other
or you can use it to modify permissions in one go like this:
chmod 555 gives read and execute, but no write, to user, group, and other.
5(octal) in binary is 101, so that's r-x ..... read, not write, execute
Because there are 3 bits (binary digits) of flags for user, group and other, and there are 8 combinations of those, this usefully encodes into a base 8 (octal) number.
There is a good calculator here:
http://permissions-calculator.org
There is a good description of the permissions flags and their octal equivalents on the chmod wiki page here:
http://en.wikipedia.org/wiki/Chmod
You can lookup the unix man page for chmod here:
http://unixhelp.ed.ac.uk/CGI/man-cgi?chmod
Or on your raspberry pi, type this at a command prompt to read the resident linux man page on it:
man chmod
If you use ls -l you will see the file permission bits listed in the long directory listing, so when you see the following:
r-xr-x---
Split these into 3 groups (user, group, other)
r-x r-x ---
Now imagine them as binary with the following base-8(octal) headings
421 421 421
101 101 000
Now convert those to octal (base-8) using the base-8 headings as listed above
5 5 0
So chmod 550 will set permissions user(r-x) group(r-x) other()
David
@whaleygeek
Technical editor, The Magpi.
Re: Errata
Although I am very familiar with binary, octal and pretty much any other number base used in computing, I just use this basic method for working out permissions (ok, it is pretty much what you said, but worded differently).
As you said, there are three groups of permissions. Each group can contain "r" for Read access, "w" for Write access and "x" for execute file or list directory contents access.
I just remember that r=4, w=2 and x=1 (yes, that's binary, but you don't need to know that to start with).
Add together the numbers that you want for each group.
rw- = 4 + 2 = 6.
r-x = 4 + 1 = 5.
r-- = 4 = 4
rwx = 4 + 2 + 1 = 7
Put them in the chmod command.
rwxrw-r-x is "rwx" 4+2+1 and "r-x" 4+2 and "r-x" 4+1 which makes 765
chmod 765 somefile
(See, I didn't even mention Octal
)
As you said, there are three groups of permissions. Each group can contain "r" for Read access, "w" for Write access and "x" for execute file or list directory contents access.
I just remember that r=4, w=2 and x=1 (yes, that's binary, but you don't need to know that to start with).
Add together the numbers that you want for each group.
rw- = 4 + 2 = 6.
r-x = 4 + 1 = 5.
r-- = 4 = 4
rwx = 4 + 2 + 1 = 7
Put them in the chmod command.
rwxrw-r-x is "rwx" 4+2+1 and "r-x" 4+2 and "r-x" 4+1 which makes 765
chmod 765 somefile
(See, I didn't even mention Octal

Re: Errata
Hello,
I have a problem seeing the text in some of the callout boxes on the .pdf version of issue 39.
The boxes pointing to items in the illustrations on pages 32,34,37, 39, and 58 are black. It looks like the the text might be behind the black boxes.
The text boxes on page 36 look correct.
I'm using Windows 8.1 and the built-in reader program from Microsoft. (Hopefully I won't be banished for that.)
Thanks.
I have a problem seeing the text in some of the callout boxes on the .pdf version of issue 39.
The boxes pointing to items in the illustrations on pages 32,34,37, 39, and 58 are black. It looks like the the text might be behind the black boxes.
The text boxes on page 36 look correct.
I'm using Windows 8.1 and the built-in reader program from Microsoft. (Hopefully I won't be banished for that.)
Thanks.
- DougieLawson
- Posts: 42639
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Errata
Try opening it with Adobe Acrobat Reader. It works OK on my Win10 system running the latest version of that.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Errata
Thank you. You're right. It does look correct using Adobe's reader.
I was trying to minimize the programs I had installed on this computer since I never seem to uninstall anything until I'm out of disk space, but I guess I'll need to keep Acrobat Reader.
I was trying to minimize the programs I had installed on this computer since I never seem to uninstall anything until I'm out of disk space, but I guess I'll need to keep Acrobat Reader.
Re: Errata
The Magpi #43, March 2016, page 12, Whetstone section text, line 2: 'Whestone benchmark'? Need the services of a good sub-editor? 

Re: Errata
MagPi Issue #45
Page 46
Diagram in the top left shows a black wire connected to ground on the Pi connected to the breadboard power rail. The other black wire that connects to the power rail on the right is not connected to the same ground rail.
Circuit won't work.
Page 46
Diagram in the top left shows a black wire connected to ground on the Pi connected to the breadboard power rail. The other black wire that connects to the power rail on the right is not connected to the same ground rail.
Circuit won't work.
Last edited by scotty101 on Fri Apr 29, 2016 8:44 am, edited 1 time in total.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter
Pi Interests: Home Automation, IOT, Python and Tkinter
Re: Errata
Please also see this post related to Issue 45: viewtopic.php?f=106&t=146248#p963232
Beware of the Leopard
Blatant Error
Does the MagPi have editors? If so do they test the copy?
The default /etc/network/interfaces contains the following:-
dhcpcd has been default since May 2015!!!
I stopped reading before I got to the end of the 1st page of Un"Predictable Networking".
I seem to spend half my time telling people NOT to do this - I expect better of the Foundation.
PS It is about time the Foundation edited some of its Tutorials. Raspbian has been using systemd for 9 months but is still telling people how to setup using SysV.
The default /etc/network/interfaces contains the following:-
Code: Select all
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
I stopped reading before I got to the end of the 1st page of Un"Predictable Networking".
I seem to spend half my time telling people NOT to do this - I expect better of the Foundation.
PS It is about time the Foundation edited some of its Tutorials. Raspbian has been using systemd for 9 months but is still telling people how to setup using SysV.
Re: Errata (MagPi #45 on p.24)
MagPi45, p.24:
“…type in the following: raspistill -o firstpic.jpg
You’ll see a red light on the Camera Module, followed by the image of whatever the camera is pointing at…”
Correct me if I’m wrong, but I thought the new RPi v2 camera module has no red light?
“…type in the following: raspistill -o firstpic.jpg
You’ll see a red light on the Camera Module, followed by the image of whatever the camera is pointing at…”
Correct me if I’m wrong, but I thought the new RPi v2 camera module has no red light?
Re: Errata
Issue 46, Page 31 circuit diagram - Echo (?) pin showing as black bar.
Issue 46, Page 60 - you'll need "1x MCP602". The diagram in the next page shows 2 used, but page 63 shows only one used. :/
Issue 46, Page 61 circuit diagram - all chips appear the same. Is the main one meant to be a MCP3002?
Issue 46, Page 60 - you'll need "1x MCP602". The diagram in the next page shows 2 used, but page 63 shows only one used. :/
Issue 46, Page 61 circuit diagram - all chips appear the same. Is the main one meant to be a MCP3002?
Thanks,
Nick
http://www.nick-web.co.uk/ee
Nick
http://www.nick-web.co.uk/ee
Re: Errata
Issue 46 Page 32 Internet Radio, schematic I believe should show MCP3008 pins VDD and V_REF connected together. Without this mod the output from CH0 does not vary. Also the maximum output appears to be around 0.48, so I have changed the test on line 16 of the program to >= 0.4, and on line 19 to <0.4.
Unfortunately the Radio OP does not start until the program is closed, so will continue to work on it, but hope these two tips are helpful.
Unfortunately the Radio OP does not start until the program is closed, so will continue to work on it, but hope these two tips are helpful.
-
- Posts: 60
- Joined: Mon Jul 29, 2013 4:37 pm
Re: Errata
Not really a recent issue but in #1 there is a link to http://www.raspberrypi.org/forum/educat ... on-lessons which no longer works.
Re: Errata
In the dropbox uploader article this month (MagPi 48, page 54) it appears that
has been omitted from the command to grab the dropbox_uploader repo.
It says...
I think it should say...
Code: Select all
git clone
It says...
Code: Select all
github.com/andreafabrizi/Dropbox-Uploader.git
Code: Select all
git clone github.com/andreafabrizi/Dropbox-Uploader.git
Alex Eames RasPi.TV, RasP.iO
Re: Errata
I have just followed the USB setup procedure that was published in the Magpi issue 50. I am quite sure that I followed all of the instructions, however, wen I remove the SD card and start up nothing happens. If I start up with the SD card inserted the Pi works properly but keeps polling the USB hard drive. Has any body got an idea what might have gone wrong? I suppose it's quit obvious that I'm a newbie at this and Linux is a mystery to me.
Kind regards John
Kind regards John
- DougieLawson
- Posts: 42639
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Errata
What model of RPi do you have? If it's a RPi3 then there are simple and clear instructions for getting it booting from a USB drive here: https://www.raspberrypi.org/documentati ... des/msd.mdJohnd2117 wrote:I have just followed the USB setup procedure that was published in the Magpi issue 50. I am quite sure that I followed all of the instructions, however, wen I remove the SD card and start up nothing happens. If I start up with the SD card inserted the Pi works properly but keeps polling the USB hard drive. Has any body got an idea what might have gone wrong? I suppose it's quit obvious that I'm a newbie at this and Linux is a mystery to me.
Kind regards John
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Errata
A few errors crept into the code examples in my "Learn To Code In C" book (one of which is also in the chapter of it featured in Magpi issue 50). Details are as follows:
On page 28 of the book, and in the last example on page 53 of MagPi issue 50, the code block contains the line
This should be
On page 61 of the book, the use of the * as an argument to the program is mangled by the shell on Unix. (It does, however, work correctly on Windows.) To fix this for Unix, replace the line
with
and use 'x' rather than '*' for multiplication.
On page 64 of the book, the code block contains the line
This should be
In the paragraph following this code block, the description "writing the bytes 30, 31...39" should be "writing the bytes 48, 49...57".
On page 66 of the book, the code block contains the line
This declares a variable which is not used in this example - this line should be omitted.
Apologies to anyone inconvenienced by these - I did think I had run all the code examples in the book before it was published, but I seem to have missed these. I've double-checked all the rest of the code examples today, and I think all the rest are ok.
On page 28 of the book, and in the last example on page 53 of MagPi issue 50, the code block contains the line
Code: Select all
int a = 5;
Code: Select all
int a = 0;
Code: Select all
if (*argv[2] == '*') printf ("%d\n", arg1 * arg2);
Code: Select all
if (*argv[2] == 'x') printf ("%d\n", arg1 * arg2);
On page 64 of the book, the code block contains the line
Code: Select all
for (value = 30; value < 40; value++)
Code: Select all
for (value = 48; value < 58; value++)
On page 66 of the book, the code block contains the line
Code: Select all
int value;
Apologies to anyone inconvenienced by these - I did think I had run all the code examples in the book before it was published, but I seem to have missed these. I've double-checked all the rest of the code examples today, and I think all the rest are ok.
Last edited by spl23 on Tue Nov 29, 2016 5:32 pm, edited 1 time in total.
Re: Errata
I am using a RPi3 and I have referred to the article you mention.DougieLawson wrote:What model of RPi do you have? If it's a RPi3 then there are simple and clear instructions for getting it booting from a USB drive here: https://www.raspberrypi.org/documentati ... des/msd.mdJohnd2117 wrote:I have just followed the USB setup procedure that was published in the Magpi issue 50. I am quite sure that I followed all of the instructions, however, wen I remove the SD card and start up nothing happens. If I start up with the SD card inserted the Pi works properly but keeps polling the USB hard drive. Has any body got an idea what might have gone wrong? I suppose it's quit obvious that I'm a newbie at this and Linux is a mystery to me.
Kind regards John
I have tied installing a WD 500Gb Hard Drive, a Sandisk 32Gb Flash drive and a Seagate 500Gb Hard Drive, all failed to mount, and all gave the same error messages.
[ 40429616] sd 0:0:0:0: [sda] No cache mode page found
[ 40429794] sd 0:0:0:0: [sda] Assuming drive cache: write through.
I can't believe that a have a fault on three drives so I must suspect the programming or the RPi3. I wrote the program three times exactly as written?
Regards John
- DougieLawson
- Posts: 42639
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Errata
Open an issue here: https://github.com/raspberrypi/firmware/issues see if the RPF folks can fix this for you.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Errata
Those aren't errors, just normal reports on the discovery of a storage device.Johnd2117 wrote:I have tied installing a WD 500Gb Hard Drive, a Sandisk 32Gb Flash drive and a Seagate 500Gb Hard Drive, all failed to mount, and all gave the same error messages.
[ 40429616] sd 0:0:0:0: [sda] No cache mode page found
[ 40429794] sd 0:0:0:0: [sda] Assuming drive cache: write through.
Do you seen any more lines after them?
Re: Errata
Thanks for your reply.
Nothing happens after the two reports, with all three drive I get the colour screen, the report and then nothing. As I said, I can't believe that three drives have the same fault so is it my RPi3 or the code?
Regards John
Nothing happens after the two reports, with all three drive I get the colour screen, the report and then nothing. As I said, I can't believe that three drives have the same fault so is it my RPi3 or the code?
Regards John
Re: Errata
In MagPi Essentials - Learning to Code With C by Simon Long, main function keeps being definded as returning void.
As the C standard specifies the return type of main should be int and particularly since the return value of main can be and often is used to signify an error to the caller of the program, who may or may not have been human, would it not make sense to teach the correct return type in a beginner's book?
As the C standard specifies the return type of main should be int and particularly since the return value of main can be and often is used to signify an error to the caller of the program, who may or may not have been human, would it not make sense to teach the correct return type in a beginner's book?
Re: Errata
See the second half of chapter 9, where I explain about arguments and return values from main.AndrejP wrote:In MagPi Essentials - Learning to Code With C by Simon Long, main function keeps being definded as returning void.
As the C standard specifies the return type of main should be int and particularly since the return value of main can be and often is used to signify an error to the caller of the program, who may or may not have been human, would it not make sense to teach the correct return type in a beginner's book?
This has been discussed this here already: viewtopic.php?f=106&t=153242 and am not going to justify my decision again.