jb63
Posts: 147
Joined: Mon May 11, 2015 6:41 pm
Location: Chicago, USA
Contact: Website

How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sat Jan 11, 2020 1:34 am

I bought few RPI 4's ... but after opening them (and mixing them) I can't differentiate the 1GB from the 4GB ... any clue?

There are a couple of Youtube movies, but they talk about production date, which to me is not very 'reliable'
Last edited by jb63 on Sun Jan 12, 2020 10:22 am, edited 1 time in total.

trejan
Posts: 1211
Joined: Tue Jul 02, 2019 2:28 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sat Jan 11, 2020 1:53 am

Look at the revision code in /proc/cpuinfo or run "free -h". Some of the memory will be used by the GPU so you'll get something around 3.7GB even though it is a 4GB Pi 4.

You can look at the part number of the memory chip but we don't have a full list so it isn't exhaustive.

4GB: Micron D9WHV or Samsung 4HMMGCJ
2GB: Micron D9WHZ
1GB: Samsung 4HBMGCJ

andrum99
Posts: 1067
Joined: Fri Jul 20, 2012 2:41 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sat Jan 11, 2020 10:03 pm

jb63 wrote:
Sat Jan 11, 2020 1:34 am
I bought few RPI 4's ... but after opening them (and mixing them) I can't differentiate the 1GB from the 4GB ... any clue?

There are a couple of Youtube movies, but they talk about production data, which to me is not very 'reliable'
Easy - boot them, find out which is which, then put a sticker on them. You might also be able to figure out the memory size from what is printed on the top of it.

User avatar
HermannSW
Posts: 2027
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sat Jan 11, 2020 11:54 pm

andrum99 wrote:
Sat Jan 11, 2020 10:03 pm
You might also be able to figure out the memory size from what is printed on the top of it.
This expression results in 1, 2 or 4:

Code: Select all

$ echo $((`grep -i MemTotal /proc/meminfo | cut -f1 -dk | cut -f2 -d:` / (1024*1024) + 1))
4
$
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

cjan
Posts: 777
Joined: Sun May 06, 2012 12:00 am

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 12:45 am

weigh its weight.

User avatar
Imperf3kt
Posts: 3380
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 1:14 am

I simply boot them and type top.
This tells me what model I gave via the total ram capacity.

I really should put a sticker or some other identifying mark on them (like maybe a silkscreen)
55:55:44:44:4C
52:4C:52:42:41

klricks
Posts: 6852
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 1:29 am

I set my hostname to something like: RPi4B4G
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

GlowInTheDark
Posts: 390
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 1:45 am

It's pretty obvious that it is trivial to tell them apart from software. I.e., once you're booted up.

I think it's pretty obvious the point of the thread is how can you tell just by looking at it. I.e., w/o powering it up.

And it sounds like the answer is: You can't.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

trejan
Posts: 1211
Joined: Tue Jul 02, 2019 2:28 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 1:56 am

GlowInTheDark wrote:
Sun Jan 12, 2020 1:45 am
I think it's pretty obvious the point of the thread is how can you tell just by looking at it. I.e., w/o powering it up.

And it sounds like the answer is: You can't.
You look at the part number written on the RAM...

GlowInTheDark
Posts: 390
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 2:05 am

trejan wrote:
Sun Jan 12, 2020 1:56 am
GlowInTheDark wrote:
Sun Jan 12, 2020 1:45 am
I think it's pretty obvious the point of the thread is how can you tell just by looking at it. I.e., w/o powering it up.

And it sounds like the answer is: You can't.
You look at the part number written on the RAM...
There you go. I thought there was probably a way.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 7:24 am

GlowInTheDark wrote:
Sun Jan 12, 2020 2:05 am
trejan wrote:
Sun Jan 12, 2020 1:56 am
GlowInTheDark wrote:
Sun Jan 12, 2020 1:45 am
I think it's pretty obvious the point of the thread is how can you tell just by looking at it. I.e., w/o powering it up.

And it sounds like the answer is: You can't.
You look at the part number written on the RAM...
There you go. I thought there was probably a way.
As detailed in the second post in THIS thread ! :roll:
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
buja
Posts: 542
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 8:00 am

A bit stupid really that RAM size is not printed on the board, it's useful information and there is plenty of space for it.
The markings on the memory chip are hard to read and just a code, no indication of the size (unless you look up the type of course).

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 8:36 am

buja wrote:
Sun Jan 12, 2020 8:00 am
A bit stupid really that RAM size is not printed on the board, it's useful information and there is plenty of space for it.
The markings on the memory chip are hard to read and just a code, no indication of the size (unless you look up the type of course).
I expect that maintaining and making three versions of the board (even if the only difference is the screen print) would cost more.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25439
Joined: Sat Jul 30, 2011 7:41 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 10:51 am

PeterO wrote:
Sun Jan 12, 2020 8:36 am
buja wrote:
Sun Jan 12, 2020 8:00 am
A bit stupid really that RAM size is not printed on the board, it's useful information and there is plenty of space for it.
The markings on the memory chip are hard to read and just a code, no indication of the size (unless you look up the type of course).
I expect that maintaining and making three versions of the board (even if the only difference is the screen print) would cost more.
PeterO
Exactly right. And also a recipe for confusion. Make production process more complicated, and if production gets it wrong you have a load of mislabelled boards.

Always worth remembering that we spend a lot of time thinking about stuff. If you think something could be done better, we have almost certainly thought about it already, and decided not to do it for some reason; might be production complexity, might be cost, might be technically unfeasible. The amount of work that goes in to taking a design to production is extraordinary. Which is why so many kickstarters fail, they do not realise the complexities involved.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jb63
Posts: 147
Joined: Mon May 11, 2015 6:41 pm
Location: Chicago, USA
Contact: Website

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 2:19 pm

Thank you all. Like one user answered above, I'm primarily after ways to identifying them from just looking at the (non-connected) hardware. I'll boot them up both and simply attach a small sticker.

Thanks.

bls
Posts: 450
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 3:06 pm

HermannSW wrote:
Sat Jan 11, 2020 11:54 pm
andrum99 wrote:
Sat Jan 11, 2020 10:03 pm
You might also be able to figure out the memory size from what is printed on the top of it.
This expression results in 1, 2 or 4:

Code: Select all

$ echo $((`grep -i MemTotal /proc/meminfo | cut -f1 -dk | cut -f2 -d:` / (1024*1024) + 1))
4
$
Slick!

GlowInTheDark
Posts: 390
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 5:10 pm

I wouldn't exactly say "slick". Whenever you see multiple invocations of what I call the "basic Unix tools" (things like cat, grep, cut, sed, join, comm, etc), you know that somebody just kinda cobbled it together on the command line without any real design.

Anyway, ...

Code: Select all

mawk '/MemTotal/ { print "Memory size in Gb:",int($2/(1024*1024)) + 1 }' /proc/meminfo
Same basic algorithm. Should work with any version of AWK (note that "mawk" is the default AWK in Debian systems, including Raspbian).
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 5:24 pm

GlowInTheDark wrote:
Sun Jan 12, 2020 5:10 pm
I wouldn't exactly say "slick". Whenever you see multiple invocations of what I call the "basic Unix tools" (things like cat, grep, cut, sed, join, comm, etc), you know that somebody just kinda cobbled it together on the command line without any real design.

Anyway, ...

Code: Select all

mawk '/MemTotal/ { print "Memory size in Gb:",int($2/(1024*1024)) + 1 }' /proc/meminfo
Same basic algorithm. Should work with any version of AWK (note that "mawk" is the default AWK in Debian systems, including Raspbian).
But for a command you are going to run once ...... does it matter ?
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

bls
Posts: 450
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 5:28 pm

GlowInTheDark wrote:
Sun Jan 12, 2020 5:10 pm
I wouldn't exactly say "slick". Whenever you see multiple invocations of what I call the "basic Unix tools" (things like cat, grep, cut, sed, join, comm, etc), you know that somebody just kinda cobbled it together on the command line without any real design.

Anyway, ...

Code: Select all

mawk '/MemTotal/ { print "Memory size in Gb:",int($2/(1024*1024)) + 1 }' /proc/meminfo
Same basic algorithm. Should work with any version of AWK (note that "mawk" is the default AWK in Debian systems, including Raspbian).
It’s one line. It does the job. Perhaps you didn’t have your coffee this morning? :lol:

Also...your updated version is slick also! ;) ;)

User avatar
HermannSW
Posts: 2027
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 6:19 pm

GlowInTheDark wrote:
Sun Jan 12, 2020 5:10 pm
I wouldn't exactly say "slick". Whenever you see multiple invocations of what I call the "basic Unix tools" (things like cat, grep, cut, sed, join, comm, etc), you know that somebody just kinda cobbled it together on the command line without any real design.
That is what the basic *nix tools are made for, and for basic tasks like determining memory size OK in my eyes.
Anyway, ...

Code: Select all

mawk '/MemTotal/ { print "Memory size in Gb:",int($2/(1024*1024)) + 1 }' /proc/meminfo
Same basic algorithm. Should work with any version of AWK (note that "mawk" is the default AWK in Debian systems, including Raspbian).
awk is for me a level above "basic *nix tools", and you are right that because of its pattern matching power is preferable for this task.
But adding all the text makes its result harder to use for other tools.
So I prefer this minimal length code living inside your code:

Code: Select all

$ awk '/MemTotal/{print int($2/(2^20))+1}' /proc/meminfo
4
$
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

GlowInTheDark
Posts: 390
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 6:26 pm

Heh heh...
But for a command you are going to run once ...... does it matter ?
Well, it obviously matters to me, since I took the time to post.

So, the operative question is: Does it matter to you?
And, the answer is that it seems it does, since you took the time to post.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 7:25 pm

GlowInTheDark wrote:
Sun Jan 12, 2020 6:26 pm
Heh heh...
But for a command you are going to run once ...... does it matter ?
Well, it obviously matters to me, since I took the time to post.

So, the operative question is: Does it matter to you?
And, the answer is that it seems it does, since you took the time to post.
What matters to me is not "is it perfect?" but "does it do the job?".
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
Imperf3kt
Posts: 3380
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 8:49 pm

jamesh wrote:
Sun Jan 12, 2020 10:51 am


Exactly right. And also a recipe for confusion. Make production process more complicated, and if production gets it wrong you have a load of mislabelled boards.
Sorry, but I don't buy this.
You still print three different versions of the box the device comes in... What if production puts them in the wrong box? You've got a bunch of mislabelled Pi (and substantially more problematic than a misprinted silkscreen)
55:55:44:44:4C
52:4C:52:42:41

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 9:18 pm

Imperf3kt wrote:
Sun Jan 12, 2020 8:49 pm
You've got a bunch of mislabelled Pi (and substantially more problematic than a misprinted silkscreen)
Ask yourself "Which of the two is easier to correct ?"
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
Imperf3kt
Posts: 3380
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: How to Differentiate RPI4 - 1 vs. 2 vs. 4 GB ?

Sun Jan 12, 2020 9:23 pm

PeterO wrote:
Sun Jan 12, 2020 9:18 pm
Imperf3kt wrote:
Sun Jan 12, 2020 8:49 pm
You've got a bunch of mislabelled Pi (and substantially more problematic than a misprinted silkscreen)
Ask yourself "Which of the two is easier to correct ?"
PeterO
The misprinted silkscreen?
People will get the correct Pi they ordered, but with some incorrect and unimportant words written on it.

If you get the box wrong, and you've shipped people who bought a Pi4 4GB, a 2GB model, you need to determine which batch was in the wrong boxes, where those boxes went, recall them, hope they aren't mixed with millions of other identical boxes in a warehouse etc...


My point is that the chance of a Pi receiving a misprinted silkscreen, is the same as a Pi ending up on the wrong box and being sold as a Pi model it isn't, so I don't really see any reason not to do it based on that particular reasoning.
55:55:44:44:4C
52:4C:52:42:41

Return to “Advanced users”