Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Wednesday, November 23, 2022

How to check--get the Raspberry Pi CPU temperature simplest way. Use command in terminal.

Type in the terminal:

vcgencmd measure_temp

and you will get result like below:

screenshot - Raspberry Pi - terminal command for get CPU temperature


Or type in the terminal:

cat /sys/class/thermal/thermal_zone0/temp

and you will get result like below:

screenshot - Raspberry Pi - get CPU temperature in terminal command


This is based on the Raspbian or Raspberry Pi OS from Raspberry Pi foundation. So I am not sure about other distro OS.




You can find so many articles out there but I wrote this probably for me. I just don't want to go through all the article for that three letters. It is really simple command.

I'm not native speaker so I might used wrong google search keyword though.


Saturday, March 16, 2019

Can Raspberry Pi boot from USB flash drive? And about how to do it guide.

Simple answer is 'yes, it can' but read on....
Or skip to the "So I will write summary first:" below.
Or skip to the "Raspberry Pi 3 B+ support USB boot.  How about Pi Zero W? Or other Pi?" below.


Not everyone is beginner, I think.

When people looking for how to guide for installing the OS(operating system), they were probably beginner or very first time trying to use Raspberry Pi. If that's the case, step by step guide might be very good choice.

But even so, it is better to explain general concept, I think.

If someone already knew some computer stuff, he or she probably doesn't need that step by step guide. Because Raspberry Pi is computer that means it is same concept.
For example, someone is Windows user like me and some Windows user knew if computer--motherboard support USB booting, Windows user can simply go to the CMOS setting and do boot from the USB stick.
So I'm thinking Raspberry Pi is computer so it might support USB boot, too.

So I'd like to know whether Raspberry Pi support USB boot or not. Or I might have to do something to get USB boot.
That's what I want to know, right?



So I will write summary first:


BCM2837-based Raspberry Pis which were all the Pi 3 models include compute module 3 and Pi 2 Model B v1.2, support USB host and Ethernet boot.

So if you have any of models with BCM2837, you can follow any general install OS guide (and install to the USB flash memory stick) which you might already knew.

And if you have other models include Pi Zero and Zero W, you need single file on your micro sd card and then it will boot from USB memory stick. So you can boot from USB memory stick and also need micro sd card with single file which I will explain below.



thought about boot from SD and then USB.

I am currently using the multiboot via berryboot.

And sometimes, I felt berryboot wasn't enough what I am trying to do. So I am thinking about like that.
3 or 4 OS on SD card and then 1 or 2 OS from USB flash memory.


So I was googling about it like this:
how do i install raspbian on usb memory


And I clicked below guide:

And read this part:
Important information
This tutorial is out-dated and has been updated here: ....
So I did clicked link which is below guide:

I have a Linux machine but most of my data--Raspberry Pi image file and etc, was on Windows which is my main computer.
So I clicked Windows version tutorial--below link.


I appreciate the detail guides. But when I am trying go through this guide it made me very confusing.
See this "Step 2 – Install Raspbian to the micro sd card"
And then "Note: If you’re using a Raspberry Pi 3+, you don’t need to do step 2. Jump straight to step 3."

"Step 3 – Install Raspbian to the USB Flash Drive"
The process is exactly the same as step 2, but this time we choose the USB flash drive as.....

And here--"If you're using a Raspberry Pi 3 Model B+, you can skip step 4."

"Step 4 – Prepare the Raspberry Pi for boot from USB"

"Step 5 – Boot Raspbian from USB Flash Drive"


Huh?
I realised that it is exactly same step as install Raspbian on micro sd card.

I have Raspberry Pi 3 B+ and Pi Zero W. So I already knew how to installing any OS on micro sd card.


As you can see, it took very long time to figure out.
Unfortunately, I clicked very old guide--May 2013. That probably is the reason though.



Raspberry Pi 3 B+ support USB boot. How about Pi Zero W? Or other Pi?

I am thinking newer Pi can support boot from USB memory stick but how about Raspberry Pi Zero W which I also have.

So I googling about it and found this:


This question already reveal how to do the booting from USB stick.

Quoted from the question.
The older Raspberry Pi's (Pi 1, Pi 2 and Pi Zero) couldn't boot from a USB-device, but the Raspberry Pi 3 has support for it. The Pi and Pi 2 have semi-support for it (using an SD-card with a single bootfile).

So if I wanted to boot from USB stick in Pi 1 and 2, I can place single bootfile--which I don't know it yet.

And other people answered that Pi Zero W use older chip like Pi 1 and 2.

And then I found someone wrote about that single bootfile--bootcode.bin.
And pointed to the source:
Special bootcode.bin-only boot mode section in Raspberry Pi boot modes - raspberrypi/documentation
Quoted from above link:
USB host and Ethernet boot can be performed by BCM2837-based Raspberry Pis (these are all Pi 3 models, and some Pi 2Bs). In addition, all Raspberry Pi models can use a new bootcode.bin-only method to enable USB host and Ethernet booting.

Just format an SD card as FAT32 and copy on the latest bootcode.bin.

This is useful for the Raspberry Pi 1, 2, and Zero models, which are based on the BCM2835 and BCM2836 devices, and in situations where a Pi 3 fails to boot (the latest bootcode.bin includes additional bugfixes for the Pi 3, compared to the boot code burned into the BCM2837).

If you have a problem with a mass storage device still not working even with this bootcode.bin, then please add a new file 'timeout' to the SD card. This should extend the time it waits for the mass storage device to initialise to six seconds.

I'm not 100% for sure yet. But if Raspberry Pi use BCM2837, USB host and Ethernet boot will support.

And I found all the Raspberry Pi specifications from Raspberry Pi - Wikipedia.
Screenshot of Wikipedia's Raspberry Pi Specifications section.
And as you can see, Pi 2 Model B v1.2 uses BCM2837. And all the Pi 3--3 Model A+, 3 Model B, B+ and Compute Model 3, lite, 3+.


So if you have Pi 2 Model B with v1.2, Pi 3 series and Compute Model 3 series, you can just install any OS on USB stick and remove micro SD card.

If you have other version include Pi Zero W, you can format the micro SD card and copy the bootcode.bin file.


Yes, I haven't tried it yet. But I think those are from the Raspberry Pi's official repository.
So I'm sure it will work.



Kali and Raspbian booted from USB flash drive.

I probably have to get more information about it so I just found this:
quoted from above link:
HawaiianPi wrote:
The Pi3 will check for a boot SD card first, before booting from a USB device. If no boot SD card is found in 5 seconds, then it looks for a boot USB device.

I think this is quite similar process as USB boot in PC--desktop and laptop computer.

When I read from above link, someone said some USB disk won't work. And I wasn't sure about it--If it's FAT32, why it shouldn't be.

But first I tried with quite old 8GB USB stick, it didn't work--Pi 3 B+ without micro SD card and Pi Zero W with single file on micro SD card.
So I thought I need to do something.

And I realised this could be compatibility issue. So I put my kind of new memory card read which can read SDXC format card, too.

Tada!


As you can see that micro sd card slot is empty.
Kali lite booted from USB Flash memory stick in Raspberry Pi 3 B+.
That USB memory stick doesn't work with USB boot--I tried like 2+ os and also with Pi Zero W.


This time, I tried same USB memory card reader with Pi Zero W. And it worked well.
And I had to put single file in micro sd card.
Raspbian stretch booted from USB Flash memory stick in Raspberry Pi Zero W.

If you'd like to connect more than two USB stick, portable hard disk or SSD, things became quite complicated. Because Raspberry Pi doesn't know which USB drive to boot from.

So you have to search more about it.


I hope you did learn about the basic concept or process of USB boot in Raspberry Pi.

Friday, March 15, 2019

Adafruit's Portable 5 inch Monitor with HDMI DIY looked interesting. But in reality....


I've seen this video: Portable HDMI Display for Raspberry Pi - YouTube

And I thought it looks very nice and quite useful because it isn't only for the Raspberry Pi--I can use as my DSLR monitor or game console monitor as well--I have a Nintendo NES classic edition which is kind of portable console.
So I'd like to do this....



It's expensive than I expected.

But when I saw inside of it, it shouldn't be easy to do.
Building the portable monitor won't be easy, for sure--I haven't done soldering before. But it requires a lot of parts to buy, too.

And if I do this, I might learn a lot of things about Adafruit, for sure.

So I visited building guide wep page.
Overview | Portable 5in Monitor with HDMI | Adafruit Learning System

And I realised I don't only spend a lot of time, I need a lot of money to building it, too.

  • 5.0" 800x480 TFT Display $29.95
  • TFP401 HDMI Breakout $24.95
  • FPC Extension Board $4.50
  • Powerboost 1000C $19.95
  • 2500mAh Battery $14.95
  • Slide Switch $0.95
  • Tripod Screw Insert $1.50
  • Total: $96.75

I thought this is too expensive for me. I need other things like print 3D case and lots of tools to do this.


So when I go through their guide, I saw that it can powering up the screen through USB.
That means, I can simply use my smartphone powerbank.
So no need to buy Powerboost 1000C and 2500mAh Battery.
And I don't have 3D printer so I don't need slide switch and tripod screw insert, too.

So I need three parts--5 inch display, TFP401 HDMI breakout, FPC extension board.
So total $59.4.



Cheaper or even better alternative--Aliexpress.

That means I don't need to do this.
Because I can simply buy from cheap Chinese store in Aliexpress, like this:
This is screenshot of 5 inch capacitive lcd display from Livetime Store in Aliexpress.
5 inch Raspberry Pi 3 Model B+ Touch Screen 800*480 Capacitive LCD Display + HDMI Cable + USB Cable + CD for Raspberry Pi 3-in Demo Board Accessories on Aliexpress.com

This is 5 inch capacitive touch display. And it costs $38--include free international shipping.
This model was different driver board design than 5 inch resistive display so I couldn't find case for this model.
5 inch resistive display case costs $6 to $10 in Aliexpress.
I can buy 5 inch display with case for about $48.

So it's much cheaper and better(include touch panel) than Adafruit's.
I know this because I just ordered one from there. So I search the a lot of similar--5 inch lcd.


If I wanted to learn about Adafruit, I probably can invest that much time and money.
But now I'd like to more focus on Raspberry Pi--and programming.

So I will buy 5 inch capacitive touch display.


You can also buy other 5 inch screen from Aliexpress like this:

This is the screenshot of '5 inch lcd hdmi' search result in Aliexpress.
Buy 5 inch lcd hdmi and get free shipping on AliExpress.com

This is the screenshot of '5 inch screen' search result in Aliexpress.
Buy 5 inch display and get free shipping on AliExpress.com

When you are searching the lcd screen, it doesn't show up many items. But you can find store that specialize in Raspberry Pi or SBC(single board computer). So you probably have to check Raspberry Pi store one by one.



It looks hard to build but maybe not that much.

At first, I don't think it's easy thing to do. When I saw this link:
On/Off Switch | Portable 5in Monitor with HDMI | Adafruit Learning System
It doesn't seem to easy, does it?
But if you are thinking about portable project, I think it's worth the effort.


I saw the next page. And if I learn about soldering, I think I can do this.
TFP401 Driver | Portable 5in Monitor with HDMI | Adafruit Learning System

And next,
Display | Portable 5in Monitor with HDMI | Adafruit Learning System
This part need just connect and position the cable. After that, screen is working.

Next part is mounting to the case.


Overall, if I learn and practicing soldering, it shouldn't be so hard.

But I still don't have a 3D printer and I don't like spend that much money.
So I will buy from Aliexpress.

Many of web store like adafruit, elements14, sparkfun, pimoroni were probably based on USA or UK so shipping and currency is too expensive to my country--Korea.
And same kind of store in Korea was all imported from those countries so things were much more expensive.

That's why Aliexpress is the best choice--for me. And probably to you, too.