Earlier on this blog, I posted something about the BASIC language on Linux.
It turns out that all the tools mentioned in this posting are available on Raspberry Pi computers too. In fact, BWBASIC, FreeBasic and Geany work in the exact same way.
Earlier on this blog, I posted something about the BASIC language on Linux.
It turns out that all the tools mentioned in this posting are available on Raspberry Pi computers too. In fact, BWBASIC, FreeBasic and Geany work in the exact same way.
Raspberry Pi computers may not always have the best amount of RAM available. For small embedded applications, this is just perfect, no precious ram wasted by remaining empty.
However, depending on the application, more memory might be required. The fallback would be virtual memory. In big server installations, swap is not even a topic. However, if an SD-card is were the files live on, SWAP is somewhat out of the picture.
If CPU power is not an issue, ZRAM might be a solution of the RAM-shortage of an RPi-application.
While my RPi500 has plenty of RAM, I installed ZRAM anyways.
This is what my present memory situation looks like:
total used free shared buff/cache available
Mem: 8131616 835544 6173708 103560 1315828 7296072
Swap: 4270584 0 4270584
My RPi400 evolves more and more into my daily driver for my office activities. Here and there I got paper documents to share, so I needed to scan those, for sending them as PDFs around the world.
Many year ago, I purchased a Canon LiDE 30 USB scanner. This scanner is powered by the USB connection only. Until today, I used this particular scanner on a powered USB hub, thinking the power draw would be to great for the RPi400.
Well, I was wrong. Today, I hooked the scanner up to one of the USB3 ports of the RPi400 directly and the scanner worked perfectly.
If you wonder, the Canon LiDE 30 is supported up to Windows Vista 32bit or Mac OS X 10.5 (Leopard) and won't work on anything more modern than that in Microsoft or Apple environments.
However, we are in good luck with linux and the "sane" environment.
On Raspberry Pi linux systems, XSane is available. To my surprise, the RPi400 delivers sufficient current on the USB3 connectors to power my Canon LiDE 30 scanner.
In my earlier post, locating a valid Arduino connection, I used exception handling by catching the error message created by attempting to open a non-existing device.
Of course there is an easier way of doing this in a POSIX compliant system, by looking at the existence of the respective device files. If you are confused about the ttyUSB0 device, this is how an inexpensive Arduino clone appears in my system.
Here is my new approach, which is bit more elegant and less brutish. This approach uses the "glob" module and the "set" data-type.
import glob
def listFiles(prefix):
_=set()
for file in glob.glob(prefix):
_.add(file)
return _
def findArduino():
ser_dev={'/dev/ttyACM0','/dev/ttyACM1','/dev/ttyUSB0'}
dev_list=listFiles('/dev/tty*')
for _ in ser_dev:
if _ in dev_list:
return _
if __name__=='__main__':
arduino=findArduino()
if arduino:
print('Arduino found at',arduino)
else:
print('Arduino not found')
Is that a click-bait title?!
I don't think so. While Raspberry Pis were doing well over the years. There never was an attempt to creating a breakthrough by the RPi-foundation. At least that's my thought on things.
Personally, I was never really attracted to their devices, until the RPi3B+ was released. Now we are talking. Not perfect yet, however, the device was boot-able over USB and with 1GB of RAM, this has beaten many of my previous Linux machines.
With the RPi 4 coming in, the game changed. Now we are talking about a tiny computer that boots from USB3, adding the speed needed for real computing.
In fact, I used a RPi4-8GB in a 64bit computing environment successfully.
The before mentioned setup required some pain and suffering to set up, in particular choosing the 64bit OS that supports the 8GB. So, is that what I would recommend to others? No it is not, only if you know your ways around Linux and stuff. Many of the amenities you get with a 32bit Raspberry Pi OS wont be there. Lets wait and see how the 64bit Raspberry Pi OS will perform, once it left the beta stage.
So, what the fuzz about the RPi 400 then? Well, it is not much of an improvement over the RPi4 to be honest. However, having the only choice of a 4GB version eliminates the need for a 64bit OS. Consequently, the Raspberry Pi OS is all you might want to use.
And that is what I am running on my machine, which I actually use for business, believe it or not. I wished the keyboard was a little bit better, but for the rest, the RPi 400 does a fine job.
To add something technical here, I did overclock my RPi 400 to 2.1GHz by adding the following lines to the file /boot/config.txt (I left the original comment line for reference):
#uncomment to overclock the arm. 700 MHz is the default.
over_voltage=6
arm_freq=2100
gpu_freq=750
Earlier, I describe the use of BerryBoot with an external USB HDD with a RPi (1) B+. To be honest, this was a terrible user experience. While everything worked, this setup was tantalisingly slow. I mean really really slow.
My assumption is that the USB2 implementation of the RPi1B+ does not reach USB2 speeds, not even close. Presumably the USB ports a run by the CPU, which in itself is relatively low power already. Consequently, I abandoned the idea of running the RPi1B+ from a USB drive.
As an experiment, I used the exact same external USB-HDD and microSD-card with my RPi3B+. What a difference! This setup really resembles a usable desktop computer.
In my experience, the Raspberry Pi 3 B+ appears to be able to run the USB2 ports at USB2 speeds.
While booting and running of the microSD-card appears to be a little bit more snappy, the combo of BerryBoot and the externally powered 3.5" HDD on USB2 delivers an acceptable user experience.
The obvious advantage of this particular install is the amount of storage available, in my case more than 300GB. The amount is only dependent on the HDD in the enclosure.
Lately, for various reasons, I got into using Raspberry Pis, in particular in combination with the GPIO.
What puts me off by a bit is the fact that the regular RPis used (micro) SD cards. While reading from an SD card might not be that bad, but writing to it, over and over again, will destroy over a short period of time. Thereby destroying the data you stored on it.
For my projects, therefore, another solution had to be found.
In this series of posts, I will document my experiences using various methods and devices to avoid the wear and tear of an SD card.
This first episode reflects on using BerryBoot to boot from and load the OS from USB connected devices.
Using and installing BerryBoot is very simple. Download the archive provided in the above mention link. Make sure you picked the file that fits your Raspberry Pi.
During writing this article, it appears that the BerryBoot image now changed to a single archive for all variants of the RPi. I have not tested this, since I just a few hours prior to the writing of this post, downloaded the archive for Pi0 to Pi3+ boards.
Anyway, I stick with what I have and what worked for me earlier.
In my present test, I am using a Raspberry Pi 1 B+ with a 2GB micro-SD card as a boot device and a USB-2 HDD enclosure with a 320GB 3.5" hard-disk. The enclosure came with a 2TB disk, which is used in something else by now.
Further, the enclosure is powered externally by a 12V wall-ward. This, of course, is important, since a Raspberry Pi would never be able to provide the power for any HDD.
Following the procedure as set out on the BerryBoot page, an OS will be written to the USB attached device. I opted for a full install of Raspberry Pi OS, as it is presently called.
After having booted "into" the HDD, the experience is certainly less snappy, compared to running the OS from the SD card. However, the mere difference is storage space should put up some questions: 8GB SD card vs. 320GB HDD.
Initially, no swap space was created. So, I decided for creating a swap-file on the root directory of the hard-drive. That did not work. It appears that under BerryBoot, using a swap file is impossible.
A solution to the missing swap-file is to install zram-tools, which will enable a virtual swap into compressed memory.
In following posts, I will discuss various other options for booting a Raspberry Pi from USB devices.