Se afișează postările cu eticheta raspberrypi. Afișați toate postările
Se afișează postările cu eticheta raspberrypi. Afișați toate postările

marți, octombrie 22, 2019

Life of RaspberryPI: Boost the frequency of Raspberry PI 4


I have bought recently the new RaspberryPI 4 and built a custom case for it.


You can see that the fan is quite big, powered by a separate 12V power supply.
That means it will have no CPU temperature issues, in standby the temperature is about 33°C.

Then, why not take full advantage of the quad core 1.5GHz processor?
By default, the PI 4 runs at 600MHz for low power consumption.
So, to change this, just edit the config file:

root@raspberrypi:~# cd/boot
root@raspberrypi:~# vi config.txt

Uncomment the line for below parameter and set it to 1500 MHz:
arm_freq=1500

Under the [pi4] block, add a new line:
force_turbo=1

This will allow the PI to use a custom frequency, instead of the default 600MHz. (not 700MHz as it says in the config)

Save the file and reboot the PI.

After the system will be back online, you can check for the processor frequency:

 root@raspberrypi:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1500000

Or you can issue the lscpu command, the CPU frequency should be the same.

Also, the temperature didn't increase too much:

root@raspberrypi:~# /opt/vc/bin/vcgencmd measure_temp
temp=36.0'C

I also made a stress test, and with a huge load, the temperature was about 48-49 degrees Celsius. And I didn't even use a heatsink, although I am planning to add one.

root@raspberry:~# w
 11:58:43 up 16:25,  2 users,  load average: 11.43, 11.03, 10.18
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
pi       tty1     -                Fri10   25:41m  0.13s  0.09s -bash
pi       pts/0    192.168.100.13   11:14    2.00s 24.60s  0.07s sshd: pi [priv]
root@raspberry:~# /opt/vc/bin/vcgencmd measure_temp
temp=48.0'C
root@raspberry:~# lscpu | grep -i hz
CPU max MHz:         1500.0000
CPU min MHz:         1500.0000
root@raspberry:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1500000

So, with a good cooling system you can benefit from the maximum resources the PI has to offer.

Of course, you can also overclock the PI, using some other parameters such as over_voltage. I don't need to do it, not even experimentally, but maybe someone is willing to give it a try. I've heard around the web that the frequency can be set up to 1750MHz, or even 2000MHz, but I wouldn't do it.

Anyway, the PI 4 is just amazing and really worth the money. With 4GB of RAM and the quad core proc, it can be used as a mini home server for multiple purposes.

Have fun!

sâmbătă, februarie 14, 2015

Life of RaspberryPI: Remote Desktop through VNCViewer

Hi everyone,



If you run RaspberryPI headless because you don't have a monitor, you might want to see the RaspberryPI's Desktop remotely.
For this, you need to set up a VNC server on RaspberryPI and a VNC client on your laptop.
The connection will be made via LAN cable, the same you are using for SSH control.

1. Set up VNC server on RaspberryPI

Connect with Putty to your device and send this commands:
root@raspberrypi:~# sudo apt-get install tightvncserver
Type y and press Enter in order to allow installation. 
root@raspberrypi:~# tightvncserver
Set up a password of 8 characters and an optional password for view only.

root@raspberrypi:~# vncserver :0 -geometry 1024x768 -depth 24

Launch a Desktop with 1024x768 resolution.

2. Install VNC client on your laptop


Download VNC Viewer and install it.
Open the program, type the IP of RaspberryPI and click on Connect.
Type in the password you set above and you are ready to go!

Life of RaspberryPI: Connect the PI to the internet.

Hi everyone,

In the previous post I showed you how to install Raspbian and how to connect to you Raspberry PI.
Now, you may want to connect it to the internet. There are many ways to do it.

1. USB tethering from mobile phone

This method saves your RJ-45 port which you can continue to use for SSH connection.

First, you have to connect your mobile phone to one Raspberry PI USB port via microUSB cable.
In your phone go to Settings > Tethering > USB Tethering. Check the button to enable the connection.

On RaspberryPI send the command:
root@raspberrypi:~# sudo dhclient usb0
root@raspberrypi:~# ping google.com
PING google.com (80.97.208.35) 56(84) bytes of data.
64 bytes from 80.97.208.35: icmp_req=1 ttl=53 time=49.6 ms
Now you can see that the internet is working if you ping Google.

2. Share your Wi-Fi through your LAN cable

Let's say your laptop is connected to a Wi-Fi hotspot (e.g. your router).
The RaspberryPI is connected with your laptop through LAN cable.

Go to Control Panel > Network and Internet > Network and Sharing Center
Click on Change Adapter Settings (left panel).
Right click on the Wireless Network Connection > Properties > Share
Check Allow other network .... and select Local Area Connection. Press Ok.

Now, click on Local Area Connection > Properties > IP v4 > Properties
and make sure it will take an IP automatically:
Start Menu > Run > cmd  and type ipconfig:


Now, copy this IP and add it to cmdline.txt located on the microSD card:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait ip=169.254.1.1::169.254.165.161

You can do this by either plugging the microSD into the laptop and edit the file with Notepad, or you can edit the file through Putty:

root@raspberrypi:/# cd /boot
root@raspberrypi:/boot# vi cmdline.txt




Similarly, edit the file /etc/resolv.conf to look like this:
root@raspberrypi:~# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
These two lines are the Google DNS servers. It helps your device locate websites and hostnames. Now, reboot your device:
root@raspberrypi:/boot# reboot
Broadcast message from root@raspberrypi (pts/1) (Sat Feb 14 11:02:52 2015):
The system is going down for reboot NOW!
After reboot:

root@raspberrypi:~# ping google.com
PING google.com (80.97.208.24) 56(84) bytes of data.
64 bytes from 80.97.208.24: icmp_req=1 ttl=53 time=598 ms
64 bytes from 80.97.208.24: icmp_req=2 ttl=53 time=34.3 ms
So it works!

Life of RaspberryPI. Hello World!

Hi everyone,

So far I have only been using microcontrollers in my projects. They were doing fine the tasks they were supposed to (usually one), but had their limitations such as low clock speed (20MHz) and more important, it was extremely hard to implement a real time operating system and to run parallel tasks.

A RaspberryPI microcomputer is a tiny board that offers both the performances of a real computer and the features of a microcontroller: IO pins, small dimensions and programmability.

RaspberryPI B+

I bought this from a local store in Bucharest and I was so excited that this little toy will run Linux for me!

They recommend us all to use the NOOBS installer. But if you don't have a monitor available, it's an impossible mission to have it running. So what I will show you next, is how to run the RaspberryPI headless (no monitor, no keyboard, no mouse).

Run headless RaspberryPI

RaspberryPI boots from a microSD card. To install an operating system on it, you have to download the latest Raspbian image: via torrent or direct link.
Unzip it and you will obtain a .img file, such as: 2015-01-31-raspbian.img

Download Win32 Disk Image, install it and Write the image to a microSD card (4GB or above).
Make sure you select the right device. Check My Computer for your microSD letter assigned.

Once the process completes, edit the file cmdline.txt located on the microSD card and assign an IP to your RaspberryPI:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait ip=169.254.1.1

You can eject the microSD card from your computer and plug it into your RaspberryPI.

Now, connect a LAN cable between the RaspberryPI RJ-45 port to your laptop's RJ-45 port.
Power on the device via microUSB port. You should see the LEDs flickering.



You can now connect to your Raspberry PI using Putty.
Just type in the IP you set above and click on open:

You will be asked for your credentials:
login as: pi
pi@169.254.1.1's password: raspberry


Now you can administer the PI as you want! Have fun!