fabiochiu/medium-articles huggingface dataset:
Running a python script when a Raspberry Pi boots up.
By: Andy Burdett
Tags: Raspberry Pi

If like me, you’ve spent the last twelve months working from home and only seeing your work colleagues via Zoom, Google Meet or Microsoft Teams you’ve probably seen lots of poorly lit desk spaces and shadowy figures giving updates to your daily stand up meeting.

I was one of those individuals until I dug out an old Raspberry Pi with it’s Pimoroni unicorn hat. I thought to myself it would be cool to have all the LEDs light up and emit a bright white light when it booted so that my colleagues could see who was giving the update.

Pimoroni have a vast array of boards you can use with the Raspberry Pi. They also produce libraries and examples of how to use their boards.

For this task I reused the simple.py python program tweaked a few parameters for the colour and brightness so that all the LEDs were white.

sudo simple.py

Simple right?

How would I get this python script to run when the Raspberry Pi booted up? Also how to run it without the sudo command?

The solution I came up with was to add the script to the /etc/rc.local file. Because this is executed at boot and as root sudo is not required. Using nano I added the following line just before the exit 0

python /home/pi/Pimoroni/unicornhat/examples/simple.py &

The & at the end of the line is required so that the python command is spawned in it’s own process and the rc.local can exit.

Reboot and you’re done.
How To Find IP Address Of Raspberry Pi
By: James J. Davis
Tags: Raspberry Pi, Network

Guys & girls, there is nothing easier than finding an IP address of your little computer! Let me quickly describe one of my favorite video lessons here.

You sometimes need to find out the MAC address of your Raspberry Pi. For instance, you want to find it among the list of devices attached to your LAN, because you want your router’s DHCP service to assign your RPi a permanently dedicated IP address instead of letting the DHCP just assign it the next available IP address each time you start it up.

Then you can SSH into the same IP address each time to log into your RPi from your PC or Mac knowing it will always be there, without having to search for the RPi on the network.

Some LANs are configured to allow access only for white-listed devices by MAC address, so you’ll also need to know yours to be able to use such a LAN.

A MAC address (media access control address) is a unique identifier used as a network address for most IEEE 802 network technologies, including Ethernet. MAC addresses are most often assigned by the manufacturer of a network interface controller (NIC) and are stored in its hardware, such as the card’s read-only memory or some other firmware mechanism. It is like a fingerprint in that it's guaranteed that no other device will have the same MAC address as yours.

The MAC address is contained in the system info file

/sys/class/net/eth0/address

which you can display using

cat /sys/class/net/eth0/address

Or from the command line you can simply use the following command :

ifconfig eth0

This will display results something like this :

eth0 Link encap:Ethernet HWaddr c8:11:cf:d1:1d:f4 inet addr:192.168.0.24 Bcast:192.168.0.255 Mask:255.255.255.0

inet6 addr: fe80::ba27:ebff:fefc:9fd2/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:336 errors:0 dropped:0 overruns:0 frame:0

TX packets:304 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:27045 (26.4 KiB)

TX bytes:43758 (42.7 KiB)

The “HWaddr” in the display represents the device’s MAC address. In this example its c8:11:cf:d1:1d:f4

Hope that helps!
How To Connect Raspberry Pi To Laptop
By: James J. Davis
Tags: Raspberry Pi, How To, Geek

I was wondering if there was a way to connect Raspberry Pi using an Ethernet cable directly to a laptop? I was trying to use this video lesson for beginners and in the end created my own list which I want to share with you today.

So, you will need

1. A regular Ethernet cable

2. Laptop

3. Raspberry Pi 2+

Prerequisites

Installing network-manager and nmap

sudo apt-get install network-manager

sudo apt-get install nmap

Editing a wired connection

Change the IpV4 settings to “Share to other computers” Save Reboot

Share WiFi from your laptop via Ethernet cable

Connect your RPi to your laptop using an Ethernet cable and check the broadcast address of the connection:

/sbin/ifconfig eth1 | grep “Bcast” | awk -F: ‘{print $3}’ | awk ‘{print $1}’

For example, 10.41.0.255. Use this address to find out the IP address of your RPi

nmap -n -sP 10.41.0.255/24

Log in to your RPi from your laptop (-Y with X redirection).

ssh -Y pi@10.42.0.96

Great! Now your RPi is connected to your laptop and the RPi can share a WiFi connection.

pi@raspberrypi ~ $

Share the screen and keyboard

Install vncserver on your Raspberry Pi

sudo apt-get update

sudo apt-get install tightvncserver

Install vncviewer on your laptop by downloading RealVNC (it supports multiple platforms).

To be able to copy & paste from VNC server to VNC viewer, you need to install autocutsel on your RPi.

sudo apt-get install autocutsel

If that site doesn’t work, try downloading the .deb directly from a mirror site like mirror and install it, for example

sudo dpkg -i autocutsel_0.10.0–1_armhf.deb

Run vncserver on your RPi

vncserver :1

Add autocutsel to /home/pi/.vnc/xstartup

#!/bin/sh

xrdb $HOME/.Xresources xsetroot -solid grey

autocutsel -fork

# Fix to make GNOME work

export XKL_XMODMAP_DISABLE=1

/etc/X11/Xsession

Run vncviewer on your laptop

vncviewer

The vncviewer window will appear and you will enter the IP address of your RPi (given by your laptop) and then port 1, which is your VNC server. For example: 10.42.0.96:1 in my case.

Connect it to the vncserver hosted on your RPi by entering a password (set the password yourself)

Now you can see the RPi desktop on your laptop!

Read more about RPi zero projects:
Raspberry Pi Headless Configuration
By: Andrea Scanzani
Tags: Raspberry Pi, Software, Security, Authentication, Linux

OS Configuration

Once our Raspberry Pi is started, it will connect to our WiFi network.

To connect to our small server we will use the SSH protocol, with the help of a tool like PuTTy or using our favorite SSH Client.

We will use the hostname of our server which is raspberrypi, and the default credentials of the OS which are:

username= pi

password= raspberry

Running the command:

ssh pi@raspberrypi

and by entering the password, we will be magically connected to our Raspberry Pi.

Now we can proceed to update the Operating System, with the latest security fixes by launching this command:

sudo apt update

sudo apt upgrade

Exapdn Filesystem

sudo raspi-config

In the newly opened window we go to “Advanced Options”

raspi-config > Advanced Options

and the click on “Expand Filesystem”.

raspi-config > Advanced Options > Expand Filesystem

Assign a Static IP to the Raspberry Pi

To assign a static IP on our Router to the Raspberry Pi we need to edit the “/etc/dhcpcd.conf” file.

Assigning a static IP is always useful also for the router side configurations that we are going to carry out.

Let’s open our file being edited with the command:

sudo nano /etc/dhcpcd.conf

And we will insert the following text:

interface wlan0

static ip_address=192.168.1.100/24

static routers=192.168.1.1

static domain_name_servers=8.8.8.8

As you can see we have set the following values:

Static IP = 192.168.1.100 (it will be that of our Raspberry Pi)

Router IP = 192.168.1.1

DNS = 8.8.8.8 (We will use Google DNS)

Create a new Users

Now we can proceed to create our user on the machine and disable the default user pi to avoid unpleasant surprises from malicious people.

As the name of the new user we will use andrea. To create the new user we can execute the commands:

sudo adduser andrea sudo usermod -a -G users,sudo andrea

The first command will create the user and ask us what password to set, while the second will make it a sudoers user (same root rights).

Now let’s proceed to block and disable the default pi user:

sudo su andrea sudo passwd --lock pi

Now we’re going to tell the SSH service which user we can expect connections from. We will enable the new user andrea and disable the old user pi.

Let’s edit the /etc/ssh/sshd_config file with

sudo nano /etc/ssh/sshd_config

And we’re going to add the following content to the end of the file:

AllowUsers andrea

DenyUsers pi

Now we can reboot our Raspberry Pi from the command line:

sudo reboot

And we can now connect with our new user:

ssh andrea@raspberrypi

or use the static IP that we have set:
Raspberry Pi Install Docker and Kubernetes
By: Andrea Scanzani
Tags: Raspberry Pi, Docker, Kubernetes, Clustering

Install Kubernetes with K3s

Before starting the installation we need to make a change and enable cgroups, which is not enabled by default on ARM machines.

Let’s edit the file:

sudo nano /boot/cmdline.txt

and add the following string to the end of the file:

cgroup_enable=memory cgroup_memory=1

Now we can proceed with the installation:

sudo curl -sfL https://get.k3s.io | sh -s - --docker

With the “-docker” statement we are telling K3s to use Docker as the runtime system for Containers.

Once the installation is complete, check the status of the K3s service:

sudo systemctl status k3s

and we can see our node on the Kubernetes cluster:

sudo kubectl get nodes

And we will have an output similar to this:

Kubernetes Nodes

The commands to stop and start K3s are as follows:

sudo systemctl stop k3s sudo systemctl status k3s sudo systemctl start k3s

Configuring the Kubernetes Dashboard (K3s)

To enable the Kubernets dashboard we need to run the following commands:

GITHUB_URL=https://github.com/kubernetes/dashboard/releases VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml

The mode to access the interface is via Bearer Token, to retrieve it we must first create an RBAC (Role-based access control) configuration for the Dashboard.

Let’s create the dashboard.admin-user.yml file with the following content:

apiVersion: v1

kind: ServiceAccount

metadata:

name: admin-user

namespace: kubernetes-dashboard

Let’s create the dashboard.admin-user-role.yml file with the following content:

apiVersion: rbac.authorization.k8s.io/v1

kind: ClusterRoleBinding

metadata:

name: admin-user

roleRef:

apiGroup: rbac.authorization.k8s.io

kind: ClusterRole

name: cluster-admin

subjects:

- kind: ServiceAccount

name: admin-user

namespace: kubernetes-dashboard

and then deploy the configurations:

sudo k3s kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml

Now to get the Token we can use the command:

sudo k3s kubectl -n kubernetes-dashboard describe secret admin-user-token | grep ^token

We enable the port-forwarding to expose the dashboard to the outside:

sudo k3s kubectl port-forward -n kubernetes-dashboard service/kubernetes-dashboard 10443:443 --address 0.0.0.0

Now the dashboard will be visible from the following url: https://<IP>:10443/

Choosing the Token Authentication mode, and inserting the recovered Token from the command line we will have full access to the Dashboard:
Noobs for Raspberry Pi
Tags: Raspberry Pi, Raspberry Pi 3, Noob, Raspbian, Raspberry

NOOBS is an easy introduction to the expansive world of electrical engineering. Take the hassle out of starting up by using this simple program to do all the dirty work.

Since you are new to all of this activity, NOOBS steps in to recommend the best operating system to work with your project.

NOOBS, as the name suggests, is a program for newcomers to the field of electronics. This is the first stepping stone on the long road to becoming an expert. Its purpose is to provide the user with a range of operating systems available for download. With this app, your job is to pick the one that makes the most sense.

Each system you download will work better for different situations. If you are working on a robot that serves beer, let this app know and it will recommend the one that makes the most sense. Custom suggestions work for all kinds of jobs, like digital art, simple electronics setups, and automation on existing platforms.

The most comforting part of this program is that it is light and easy to use. No need to worry about putting too much pressure on your computer or phone. Downloading is quick and easy, just like the program itself. Plus, constant updates keep your mind at peace. You will always have guaranteed compatibility with any projects you start.

NOOBS works on all Windows and Linux computers as a relay for operating systems that only work on Raspberry Pi.

No. The only real competition from NOOBS comes from berry boost, a program that matches its functionality and ease of use. Try both and see which one you’re most comfortable with.

This app is a great start for those interested in electronic engineering. It makes learning easier and lets you feel free to have fun with it.

Yes. Be courageous and start today; NOOBS has a lot to gain in terms of creativity and functionality.
Open Source Face Recognition on Raspberry Pi 3/4
By: Simba Zhang
Tags: Raspberry Pi, Deep Learning, Face Recognition

Privacy is the most important issue for the AI surveillance camera. Currently, all the camera with facial recognition feature need upload camera streaming to the cloud. So that’s really a risk to leak personal information of end user.

That’s why SharpAI developed DeepCamera. DeepCamera coming with private deployment, camera information saved to local storage, run face recognition model on the edge device not only for the cost but also protect personal privacy.

You can check out the code an d run it on your own Raspberry Pi. So, everything is under your control. Following is the source code and user manual on github:

https://github.com/SharpAI/DeepCamera
How To Restart Raspberry Pi Safely And Quickly
By: James J. Davis
Tags: Raspberry Pi, Raspbian, Raspberry Pi 3, Raspberry Pi 4

To avoid damaging the file system on the SD card, you should always shut down and reboot the Raspberry Pi properly (not just unplug the power cord).

To safely shut down or reboot your Raspberry Pi through the GUI, simply find the appropriate buttons in the menu.

In this post, I will show you how to restart raspberry pi from the command line (or you can see video lessons)

When RPi (or any other UNIX-like system) shuts down or reboots correctly, using commands from the terminal or their GUI equivalents, it first tries to shut down all gracefully processes by sending them a SIGTERM signal, which notifies them to save data and shut down. After a while, to all remaining processes, it sends SIGKILL, unmounts all file systems and sends the appropriate command to the ACPI power management interface.

Turn off the Raspberry Pi

Use any of the above commands to turn off the RPi correctly:

$ sudo halt

$ sudo poweroff

$ sudo shutdown -h now

$ sudo shutdown -h 10 # after 10 minutes

$ sudo init 0

Once the shutdown process is complete, the green LED on the Raspberry Pi board will blink a few times — it is then safe to disconnect the power cable.

It’s okay if only the red LED stays on — it means that the Raspberry Pi is connected to a stable power source.

Safely reboot Raspberry Pi

Execute any of the following commands to safely reboot the RPi:

$ sudo reboot

$ sudo shutdown -r now

$ sudo shutdown -r 10 # after 10 minutes

$ sudo init 6

How do I restart my Raspberry Pi from a remote system?

Something like this might help:

ssh pi@192.168.1.XXX 'echo raspberry | sudo shutdown -r now'

this command connects to your Raspberry using SSH and issues a restart command, make sure you replace 192.168.1.XXX with the real address.

Have fun guys & girls!

You might also want to know other tricks with RPi:
Electromaker Show Episode 25
Tags: Raspberry Pi, Electromaker Show, Arduino

Electromaker Show Episode 25

Welcome to the Electromaker show, episode 24! This week saw a major Raspberry Pi OS update, Elementary OS released for the Raspberry Pi, an Adafruit machine learning module for the Raspberry Pi announced, the Nintendo Game and Watch Classic hacked to run Doom, and more. Check out these maker, tech, DIY, IoT, crowdfunding, and embedded updates! Electromaker Follow Dec 9, 2020 · 1 min read

Welcome to the Electromaker show, episode 25! This week saw a major Raspberry Pi OS update, Elementary OS released for the Raspberry Pi, an Adafruit machine learning module for the Raspberry Pi announced, the Nintendo Game and Watch Classic hacked to run Doom, and more. Check out these maker, tech, DIY, IoT, crowdfunding, and embedded updates!

We publish a new show every week. Subscribe here. Don’t have time to watch the show? Listen to the Electromaker Show in podcast format!

Electromaker Show Episode 25 Highlights
Creating your Personal Desktop with Raspberry Pi 400
By: Khai Fahmi Zaki
Tags: Raspberry Pi, Computer Science, Getting Started, Ubuntu, Programming

Getting Started — Raspberry Pi

Creating your Personal Desktop with Raspberry Pi 400

Raspberry Pi 400 Personal Computer

Introduction

Have you ever thought of having a personal computer that is portable, lightweight and relatively cheap? In 2020, the Raspberry Pi Foundation has released a new product which might get you excited for this reason. The released Raspberry Pi 400, is a computer in a keyboard (this might seems weird for some of you). Basically, it looks just like a plain keyboard but it can be a computer because it has most of the computing components built within the keyboard. This comprehensive guide will be ideal for those who are new and interested to get started with Raspberry Pi as I will be sharing my personal configuration to get everything running quickly and cheaply.

Best part of Raspberry Pi 400, you don’t necessarily need to be a techie to use it

In this article, I will be explaining the terms and steps as simple as possible so that anyone can follow along and have their own Raspberry Pi 400 personal desktop running. I will also include links for those who are interested in digging deeper into the topic. For those who have a Raspberry Pi 3/4, don’t worry! You can follow along this guide and apply the same steps to get your Raspberry Pi 3/4 running.

Contents

Why Raspberry Pi 400? Items You Need (with costs) Step 1: Prepare the Operating System (OS) Step 2: Hardware Setup Step 3: Computer Configuration

Why Raspberry Pi 400?

Usually, when speaking about the Raspberry Pi, most people would imagine the single board computer that programmers or tech people uses to program certain stuffs. This is the typical Raspberry Pi 2/3/4 being offered in the recent years.

Simple words, Raspberry Pi 400 is a keyboard that has the capability of a computer.

To get it clear, the Raspberry Pi 400 isn’t much different compared to the popular Raspberry Pi 2/3/4 in terms of its technical aspects. The differences lies in its design where it isn’t just a piece of board but is a single computer board integrated within a keyboard. This makes it convenient for anyone even those who are not very technical to use this device as their personal computer. All you need are a screen, a mouse, a micro SD card and some cables (micro-HDMI and power supply) which you might already have! Another good advantage of the Raspberry Pi 400 is you can reduce the messy cables you have on your table as there are only 2 essential cables needed to get Raspberry Pi 400 running and usable.
Create simple recognition object detection in the live time on the Raspberry Pi — version 2. Using TensorFlow Lite
By: Alex G.
Tags: Raspberry Pi, Python, Object Detection, Tensorflow Lite, TensorFlow

Note before you start:

So, Let’s start :)

Hardware preparation:

Software preparation:

For run this application just run the next commands:

Clone models list from Tensorflow repository:

sudo mkdir object_detection cd object_detection sudo git clone --depth 1 https://github.com/tensorflow/models.git cd models/research/ sudo protoc object_detection/protos/*.proto --python_out=. cd object_detection

Upload Object detection pre-trained model and unzip

wget http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz sudo tar -xzvf ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz

Preparing VNC (if you have)

If you go to VNC Server Options (right-click on the VNC status icon in the top right) and check to Enable direct capture mode on the Troubleshooting page. This will allow you to see the camera output via VNC. Like on the screenshots:

Clone my Python script for object detection to this directory where you located and run this script.

Result:

Create simple recognition object detection in the live time on the Raspberry Pi — version 2 (Photo,GIF by Author) https://github.com/oleksandr-g-rock/simple_object_detection/blob/main/demo_od.gif

So in this article, we created simple recognition object detection in the live time. Code from this article here.
ttyS0 permission denied on ubuntu mate 18.04 on raspberry pi 3b+
By: Andy Hwang
Tags: Raspberry Pi, Serial Port, Ttys0, Ubuntumate

I had been trying to connect to my gps module through the serial pins on the raspberry pi io bay. I goal is to publish fix messages using ros, and that’s why I’m using ubuntu mate — I don’t want to compile ros on raspberry pi os. The ttyS0 on my raspberry pi 3b+ works without changing any of the permission settings when I’m using rpi os, so it’s unlikely to be a hardware issue. And here is the problem I went into.

The ttyS0 access gets reset every 30 seconds or so.

I used sudo chmod 666 /dev/ttyS0 to gain access to the default user, pi, and it will work right away with cat /ttyS0 and any other program I’m using. However, the access will be changed by something just in a few seconds. My user, pi, is in the dialout and tty group, and the raspberry pi serial interface setting in sudo raspi-config is set to login shell disabled and serial interface enabled. well, it didn’t work.

The fix, or to be more precise the workaround, is to use ttyAMA0.

Following the instructions on https://roboticsbackend.com/raspberry-pi-hardware-permissions/ , the ttyAMA0 can be set to use the GDIO pins. The steps are:

add “dtoverlay=pi3-disable-bt” into “/boot/config.txt”

remove “console=serial0,115200” and “console=tty1” in “/boot/cmdline.txt”

add the user to the dialout group “sudo adduser your_username dialout”

The result is that /dev/ttyAMA0 will listen to GPIO14 and GPIO15, Tx and Rx without asking for permissions, and the permission won’t get reset.
Image classification (persons, animals, other) on raspberry pi from pi-camera (in live time) using custom model tflite (output to terminal), using TensorFlow Lite
By: Alex G.
Tags: Raspberry Pi, Tflite, Python, Tensorflow Lite, TensorFlow

Note before you start:

So, let's start :)

Hardware preparation:

Software preparation:

1. Create a neural network model to predict 3 classes: persons, animals, others.

I have already done it in the article below. So in this article, you do not need to do this.

2 Convert h5 model to tflite model

I have already done it in the article below. So in this article, you do not need to do this.

3 So, let’s try to predict class from camera raspberry pi in live time with output to the terminal using Tensorflow Lite and custom model tflite (which I trained and saved above).

For that, you need to run the next code:



git clone #clone my repogit clone https://github.com/oleksandr-g-rock/image_classification_pi_camera_live_time_custom_model_tflite.git #go to folder

cd image_classification_pi_camera_live_time_custom_model_tflite

wget #download tflite modelwget https://github.com/oleksandr-g-rock/how_to_convert_h5_model_to_tflite/raw/main/animall_person_other_v2_fine_tuned.tflite #run script

python3 classify_picamera_with_live_time_custom_tflite_model.py

4 You should see something like that.

Image classification (persons, animals, other) on raspberry pi from pi-camera (in live time) using custom model tflite (output to terminal) (Photo,GIF by Author) https://github.com/oleksandr-g-rock/image_classification_pi_camera_live_time_custom_model_tflite/blob/main/0_3rpJEUsVESUEAJgP.gif

Result:

In this article, we created a solution for image classification for the classes (persons, animals, others) on Raspberry Pi from Pi-camera in live time.

I will use a custom model tflite which I converted from h5.

And all results will be shown in the terminal. Code for this article is available here.
Booting a Raspberry Pi from USB
Tags: Raspberry Pi, Raspbian, Homelab, Self Hosted, Raspberry Pi 4

Photo by Jainath Ponnala on Unsplash

For faster disk IO on the Rapberry Pi, it’s possible to boot from a USB drive. To get an idea of the performance gains, see the work done by Jeff Greerling.

For my setup, I used 3 Raspberry Pi 4s and a variety of drives/enclosures I picked up on sale. The best performing setup was with a WD NVMe drive and an external enclosure.

Booting the Raspberry Pi from USB is a fairly straight forward process. You must update to the latest firmware and change the boot order.

Updating Firmware

Flash an SD card with the Raspberry Pi OS. You can use the Raspberry Pi imager tool to prepare the SD card. I used the Lite version of the Raspberry Pi OS which doesn’t have a desktop environment. To enable ssh access to the device, you can simply create an empty file named “ssh” in the root directory on the SD card.

Once booted, you should be able to ssh into the pi using the default user “pi” with password “raspberry”.

You can now run the following commands to update the firmware.

Now reboot the device.

Once the device is rebooted, you can run the following command. Note: when I ran this command, nothing seemed to happen — your mileage may vary.

Finally, using the raspi-config menu, you can change the boot order to USB Boot. If there is no SD card present, the device will now boot from USB.

Preparing a USB Boot Drive

Once again using the Raspberry Pi imager tool, you can flash your OS of choice onto your USB drive. I used Ubuntu 20.10 Server 64bit.

Booting from USB

Power down your Pi, remove the SD card and plug in your USB device into one of the USB 3 ports. Your device should now boot from your USB drive when you power it back on!
How to setup iofogctl on Raspberry Pi OS
By: Rouzbeh Karimi
Tags: Raspberry Pi, Golang, Iofogctl, Machine Learning, Edge

In a previous article I described how you can implement an intelligent edge ecosystem using iofog to demonstrate an AI oriented example on edge.

In this section we are going to prepare ourselves to deploy the previous example on a real edge device by setting up iofogctl on raspberry pi os.

to setup iofogctl on raspberry pi os we need to build it for ARM architecture and since it is developed using golang we should first setup the go sdk on raspberry.

Install Go SDK

first navigate to https://golang.org/dl/ and choose the go sdk ending in armv6l.tar.gz like https://golang.org/dl/go1.15.5.linux-armv6l.tar.gz ,

wget https://golang.org/dl/go1.15.5.linux-armv6l.tar.gz

then extract it using sudo tar -C /usr/local -xzf go.1.15.5.linuxc-armv6l.tar.gz

to persist it as your os known commands edit ~/.profile and add the following lines

PATH=$PATH:/usr/local/go/bin

GOPATH=$HOME/go

now to apply your changes use the command bellow:

source ~/.profile

to make sure whether its setup is done execute go version and it must print the go version details.

Install iofogctl

to install iofogctl you should download its tagged version source from https://github.com/eclipse-iofog/iofogctl/releases. https://github.com/eclipse-iofog/iofogctl/archive/v2.0.3.tar.gz .

now extract it using tar -xzf v2.0.3.tar.gz .

now if you do not have rice go module first go on and run sudo apt-get install golang-rice .

then go to extracted iofogctl tar folder, edit the Makefile, find export GOARCH ?=amd64 , change it to export GOARCH ?=arm and save your changes.

go on and run make build in same folder.

the script will create a bin folder putting a file named iofogctl in it. to make sure it has the right architecture run file bin/iofogctl | grep --color -i arm and it should highlight the arm word in terminal.
How to make a Raspberry pi Action camera ?
By: Vineet Kumar Gupta
Tags: Raspberry Pi, DIY, Coding, Action Camera, Python Flask

Raspberry pi is one the cheapest single board computer available but what can you make a action camera out of it , lets see

This Tutorial is based on this Github Repository

Step 1 : Collect all the items required

Raspberry Pi any model should work but make sure wifi is present (This was tested on zero w) Pi camera any version should work currently only the official pi camera modules are supported but soon support for web cam would be added (Tested with v1.3) Power Bank or any 5v Power supply

Pi Camera

Step 2: Login into device using ssh or if having gui open terminal

Default username is ‘pi’ and password is ‘raspberry’

Step 3: Clone the RPcam repository to pi using git clone

git clone https://github.com/vineetkrgupta/RPcam

Step 3: Move to the newly created directory as RBcam and install all the requirements for the program using pip

pip3 install -r requirements.txt

After the installation is complete the recorded video would be saved in the /static/Videos folder and /static/Photos folder

Step 4 : Make script persistent

In order to make script persistent and run it everytime when the device is powered on we will use crontab ,to do that first we have to make an entry we can do that by the following command

sudo crontab -e

After that a confirmation popup might appear type Y to accept and then use arrow keys to move down the file opened and make the following entry in the last of the document

@reboot python3 /home/pi/RPcam/main.py

Final Step

After doing this , we have to restart our device , as usual our device will connect to the network and now we just can use it using any web browser by the following commands but before that we need to find the ip of the raspberry pi . which can be found using looking into the network .

<raspberry pi ip >:5000

Now in order to click picture use

<raspberry pi ip >:5000/TakePicture

In order to view the last Picture or video taken just use

<raspberry pi ip >:5000/last

Similarly various functions can be called such as

/check (to check the storage left) /TakePicNight ( to take picture in night mode take about 1 min for a photo to capture) /StartRecord (start recording video) /StopRecord (stop recording video) /shutdown ( Shutdown the device ) /last ( see the last media captured )

IMPORTANT INFORMATION

Inorder to make everything very easy and use it on go club eveything into a small package and an addition PIR sensor might be used to detect motion and capture images

Project with PIR

Now by connecting raspberry pi to phone hotspot we can control the raspberry pi camera on the game

To avoid typing the whole url everytime in browser in order to capture photo or video we can use an app such as

And then create shortcuts such as these

To Import these setting go to settings and select import and then import from url and use the following url

After that manually change the ip of Every shortcut to the ip of your raspberry pi

And finally you can use your new raspberry pi Action camera

Happy experimenting :)
Solid Copper Raspberry Pi 4 Case Costs $250
Tags: Raspberry Pi, Technology, Computing, DIY, Gadgets

The 785 gram case looks fantastic and keeps the Pi cool even when overclocked to 2.1GHz.

By Matthew Humphries

The Raspberry Pi offers a very cheap way to get a desktop computer—unless, of course, you decide to place it inside this gorgeous solid-copper case.

As Tom’s Hardware reports, the Solid Copper Maker Block Case for Raspberry Pi 4 from Desalvo Systems costs an eye-watering $249.95. In return, your case can not only look amazing, but it can also keep your Pi running cool even at the highest of overclocks.
Electromaker Show Episode 24
Tags: Raspberry Pi, Electromaker Show, Arduino

Electromaker Show Episode 24

This week saw the release of open-source firmware to turn an STM32 “Blue Pill” into a multi-purpose test and measurement instrument. We also cover the two new Tinkerboards which will give the Raspberry Pi 4 a run for its money, crowdfunding campaigns, cool electronic projects and much more! Electromaker Follow Nov 25, 2020 · 1 min read

Welcome to The Electromaker Show episode 23! This week saw the release of open-source firmware to turn an STM32 “Blue Pill” into a multi-purpose test and measurement instrument. We also cover the two new Tinkerboards which will give the Raspberry Pi 4 a run for its money, crowdfunding campaigns, cool electronic projects and much more!

We publish a new show every week. Subscribe here. Don’t have time to watch the show? Listen to the Electromaker Show in podcast format!
Asus Announces Tinker Board 2 and 2S Single-Board Computers
Tags: Raspberry Pi, Technology, Computing, DIY

The Raspberry Pi gets some fresh competition from Asus’ new boards, with 1.5x performance promised.

By Matthew Humphries

Single-board computers have grown in popularity over the last several years thanks to the Raspberry Pi. Asus introduced a competitor called the Tinker Board back in 2017, and now we’re getting a second-generation board with two model options.

As NotebookCheck reports (via French publication Clubic), the Tinker Board 2 and Tinker Board 2S are exactly the same except for one feature: The 2S includes 16GB of eMMC storage and a Micro SD card slot, whereas the Tinker Board 2 includes only a Micro SD card slot.

Both boards use the Rockchip RK3399 64-bit system-on-chip, consisting of a dual-core ARM Cortex-A72 running at 2GHz and quad-core ARM Cortex-A53 running at 1.5GHz. The GPU is an ARM Mali-T860 MP4 running at 800MHz, and 2GB/4GB dual-channel LPDDR4 RAM options will be available.

There are plenty of connectivity options on these boards (which measure just 85mm by 56mm), including:

1x HDMI 2.0 (4K-capable)

1x USB 3.2 Gen1 Type-C (OTG & DisplayPort 1.2)

3x USB 3.2 Gen1 Type-A

1x 22-pin MIPI DSI

1x 15-pin MIPI CSI-2

1x RJ-45 Gigabit LAN

1x Wi-FI 802.11 AC and Bluetooth 5.0

1x 40-pin GPIO header

1x DC fan header

1x RTC battery header

1x Power and recovery headers

1x 12 V — 19 V DC-in barrel connector

The expected performance gain over the original Tinker Board is 1.5x, and Asus is supporting Debian 9 Linux and Android 10, although Android support isn’t expected until Q1 2021. We don’t know pricing or an official release date yet, but the first Tinker Board cost $60, and it seems likely Asus will try to hit a similar price point again, especially considering the 8GB Raspberry Pi 4 costs $75.

Meanwhile, the latest product carrying the Raspberry Pi name is a keyboard with a Raspberry Pi 4 inside and offering everything you need except a display for under $100, or just the keyboard on its own for $70.
Raspberry Pi 2 Model B Soğutma Modifikasyonu
By: Hakan Çevi̇k
Tags: Raspberry Pi, Embedded Systems, Raspbian, Cooling System, Raspberry Pi 2

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Raspberry Pi Configurazione Headless
By: Andrea Scanzani
Tags: Raspberry Pi, Software, Security, Google, Linux

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Raspberry Pi Smart Security Camera
By: Ritesh Kanjee
Tags: Raspberry Pi, Python, Security Camera, Computer Vision, Object Detection

Today we are going to build our own real-time AI surveillance camera using a Raspberry Pi and the OpenCV AI kit. This Raspberry Pi CCTV camera will be able detect a person using a MobileNet SSD at an astonishing 30 FPS as well as sound an Alarm to stop any impending theft.

The Problem that we are trying to solve is, that there are not much real time raspberry pi CCTV camera solutions online and if they are real-time, then the processing is not an embedded solution, its done on a server, PC or cloud.

Another option is to use something like a Neural Compute Stick or Google Coral, which is great but their form factors are slightly bulky especially when we are trying to minimize our security camera size.

Instead we are going to try using the OpenCV AI Kit attached to almost any raspberry pi even a Raspberry Pi zero for a small footprint surveillance camera.

So lets get straight into it!

Click Here to Watch NOW!!
マルチCPUアーキテクチャの自宅k8sクラスタを運用する話. arm64とamd64が混在しているk8sクラスタの運用
Tags: Raspberry Pi, Arm, Scheduling, Kubernetes, Amd

Assigning Pods to Nodes

You can constrain a Pod to only be able to run on particular Node(s), or to prefer to run on particular nodes. There…
Use a Raspberry Pi 4 for Time Machine (works with macOS 11 Big Sur)
By: Sascha Eggenberger
Tags: Raspberry Pi, Tutorial, Mac, Time Machine, Big Sur

Storage

Connect Hard drive to USB 3.0 port

As the Raspberry Pi 4 ships with 2x USB 3.0 ports we can connect an external hard drive as our disk space for backing up data. Also we should get decent speeds as we also get a 1GBit/s wired connection with the Pi 4.

Determine the device ID (UUID) of your USB drive

ls -lha /dev/disk/by-uuid

Look for the UUID and rember the mount point (e.g. /dev/sdb1) we’ll need this later

In my case the device was /dev/sdb1 and the UUID we’re looking for was the one below:

7efbdfc5–9c85–4e01–873a-204e00c9aa45

Note: exchange this UUID with yours
ROS¹ on Raspberry PI with docker: Running ROS as remote node in docker
Tags: Raspberry Pi, Docker, Ros2, Ros, Rosnode

This is the third story of the 3-part series: ROS on Raspberry PI. I have divided the topic in 3 parts as below:

Getting started

Custom Dockerfile and Picamera.

Running ROS as remote node in docker (This story)

Dockerfile:

Create a dockerfile using ROS image as base image.

The docker container get the hostname during boot time and it can not be changed later. Use -h option to provide the hostname. If you are planning to connect to the docker container from outside (e.g. remote ROS node) then one of the workaround is to use same hostname as host.

docker run -h raspberrypi -d -p 22:22 -p 45100:45100 -p 45101:45101 -P --name test_sshd hrushikeshd/picar:latest

Create Workspace:

mkdir -p catkin_ws/src

cd catkin_ws

catkin_make

Create your package in the src folder

source devel/setup.sh

Start ROSCORE on RPI. Add ROS_MASTER_URI environment var on docker

You are now ready to talk to ROS on rpi.
RaspberryPi 400 at 4x2.35GHz
By: Sylwester Sosnowski
Tags: Raspberry Pi, Embedded Systems, Tuning, Benchmark, Linux

Overclock your Pi400 to 2.35GHz CPU speed and 800 MHz GPU — and void warranty.

Photo Credit: RaspberryPi.org

As soon as I’ve received my RaspberryPi 400 and reading about people running it up to 2 GHz, I decided to give it a go and see if I can get a stable, well-cooled system with a higher clock speed.

The “stock” Pi400 has the same BCM2711 SoC as the RaspberryPi 4, but in a newer revision, apparently with a more efficient design which gives less heat dissipation. In addition to this, the Pi400 has a big piece of aluminum over the whole bottom area of the keyboard, which is used as a heat sink.

Disclaimer

All the instructions here are to be done at your own risk. You will void your warranty by setting over_voltage.

Tuning

Warning again! This voids your warranty.

/boot/config.txt:

force_turbo=1

over_voltage=15

arm_freq=2350

gpu_freq=800

This gives you a GPU Frequency of 800MHz and a CPU Clock of 2.35GHz per core!

Verifying results

39.9°C at 2.35GHz!

Conclusion

I’ve been running the Pi400 for 2–3 weeks at 2.35GHz. Everything seems stable and maximum temperatures while compiling a Linux kernel with “make -j4” resulted in temperatures around 50–60°C. Pretty neat!
เชื่อมต่อ wifi ให้ raspberry pi แบบไม่มีหน้าจอ
Tags: Raspberry Pi, Rasa, Raspberry, เชื่อมต่อโดยไม่ใส่รหัส, เชื่อมต่อ Pi

balenaEtcher - Flash OS images to SD cards & USB drives

Electron is based on Gtk2, which can't run natively on Wayland. Fortunately, the XWayland Server provides backwards…
RemoteIO-gRPC — I/O abstraction via HTTP/2
By: Sylwester Sosnowski
Tags: Raspberry Pi, Go, Realtime, Gpio, Grpc

Introduction

I’ve started a little project today to learn more about Google gRPC and to allow me to use the RaspberryPi GPIO Pins remotely on my desktop computer via a streaming HTTP/2.0 gRPC API. But what is gRPC?

gRPC (gRPC Remote Procedure Calls[1]) is an open source remote procedure call (RPC) system initially developed at Google in 2015.[2] It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, bidirectional streaming and flow control, blocking or nonblocking bindings, and cancellation and timeouts. It generates cross-platform client and server bindings for many languages. Most common usage scenarios include connecting services in microservices style architecture and connect mobile devices, browser clients to backend services.

Accessing the RaspberryPi I/O via gRPC from a Server 200km away.

Protocol Implementation

Embedded systems usually provide functions for getting/setting pin modes, setting/getting values for analog and digital I/O. Therefore I decided to go the same way and implement a semi-HAL compatible to Arduino / wiringPi.

service RemoteIO {

rpc pinMode(PinModeMessage) returns (PinModeMessage){};

rpc digitalRead(DigitalState) returns (DigitalState){};

rpc digitalWrite(DigitalState) returns (DigitalState){};

rpc analogRead(AnalogState) returns (AnalogState){};

rpc analogWrite(AnalogState) returns (AnalogState){};



rpc spiRead(SPIMessage) returns (SPIMessage){};

rpc spiWrite(SPIMessage) returns (SPIMessage){}; rpc i2cRead(I2CMessage) returns (I2CMessage){};

rpc i2cWrite(I2CMessage) returns (I2CMessage){}; rpc subscribeInterrupt(InterruptMessage) returns (stream DigitalState){};

}

https://raw.githubusercontent.com/DatanoiseTV/RemoteIO-gRPC-proto/main/remoteio.proto

Full implementation here.

Adding a WebUI

gRPC is fun, but with grpcui things are really fun. You only need to expose the reflection service and any gRPC client can determine your RPC functions!

Wrapping up

Now we have the following functionality:

HTTP 2.0 gRPC service listening on TCP port 9000 (no TLS)

gRPC reflection (providing automatic RPC description)

pinMode(), digitalRead(), digitalWrite(), analogRead(), analogWrite()

spiRead(), spiWrite()

i2cRead(), i2cWrite()

Streaming mode

Source Code

You can find the unpolished code at https://github.com/DatanoiseTV/RemoteIO-gRPC

Use at your own risk. This uses /dev/mem for go-rpio, so it requires root.
Thanks for the story.
Tags: Raspberry Pi, Chrome

Thanks for the story. There are so many things that can be done with a rasp pi 4. But one of the problems you ran into should be able to be solved by using the software library to install chrome. There is an arm version of chrome. It’s just not very big in the Linux community because of the whole DRM thing. Most Linux users frown on DRM. And to watch movies and in some part YouTube requires DRM. You might need to update your repositories and then open your software library app and search for chrome and click install.
Simple image classification on raspberry pi from pi-camera (with cycle while) using the pre-trained model VGG16 and TensorFlow
By: Alex G.
Tags: Raspberry Pi, Image Classification, Python, Machine Learning, AI

Note before you start:

So, Let’s start :)

Hardware preparation:

Software preparation:

1 So, for that, you need to create a new file image_classify.py with the next code:

from keras.applications.vgg16 import VGG16

from keras.preprocessing import image

from keras.applications.vgg16 import preprocess_input, decode_predictions

import numpy as np

from picamera import PiCamera

import time model = VGG16(weights='imagenet') while True:

camera = PiCamera()

camera.capture('image.jpeg')

img_path = 'image.jpeg'

img = image.load_img(img_path, target_size=(224, 224))

x = image.img_to_array(img)

x = np.expand_dims(x, axis=0)

x = preprocess_input(x)

preds = model.predict(x)

print('Result:', decode_predictions(preds, top=1)[0])

camera.close()

Let me explain what this code will do:

Add cycle “while”

while True:

At first, these two lines made a photo and save it to an image.jpeg file

camera = PiCamera()

camera.capture('image.jpeg')

After that, this code will classify (predict top 3 classes) what is in the photo

img_path = 'image.jpeg'

img = image.load_img(img_path, target_size=(224, 224))

x = image.img_to_array(img)

x = np.expand_dims(x, axis=0)

x = preprocess_input(x)

preds = model.predict(x)

print('Result:', decode_predictions(preds, top=3)[0])

2 run script for recognizing the image.

python3 image_classify.py

3 You should see something like that. FPS +- 1.0

Simple image classification on raspberry pi from pi-camera (with cycle while) using the pre-trained model VGG16 (Photo,GIF by Author) https://github.com/oleksandr-g-rock/simple_classification_pi_vgg16_pretrain_model_from_pi_camera_while/blob/main/1_jGTp9fWG6HL5xFMyl6C7lg.png

Result:

In this article, we created simple image classification on raspberry pi from pi-camera (with cycle while) using the pre-trained model VGG16. In this example, I using the pre-train model VGG16, but you can try to use any pre-train model. All code is located here.
Abraham Lincoln’s Bloody Statue & Legacy
By: Christopher J. Beale
Tags: San Francisco, Abraham Lincoln, Politics, Native America, California

(Photo: Christopher J. Beale)

I was walking by City Hall Sunday morning when I saw it — the statue of the 16th president, Abraham Lincoln had its face painted red. The letters of his last name were also painted red. As of yet, we don’t know who vandalized the statue, but history may give us a clue as to why.

In school we were taught that Honest Abe freed the slaves, signed the Emancipation Proclamation, and delivered the Gettysburg Address. Those, and other positive impacts of his presidency have been widely celebrated since Lincoln’s death by assassination in 1865. But time, it seems, tries to erase the negatives of past administrations, and Lincoln’s was no different.

Native Americans, for example, have a very different experience with Abraham Lincoln’s legacy.

For people in Native American tribes, he was not The Great Emancipator. Instead of joining in, the posthumous praise he receives serves as a painful reminder of Lincoln’s role in the genocide of Native American peoples.

Looking at Lincoln’s statue in San Francisco, with “blood” on his face I wondered, does the man himself have blood on his hands?

Photo by Library of Congress on Unsplash

At the beginning of the 1860s, President Lincoln supported the Homestead Act and the transcontinental railroad, both of which cost Indigenous people their homes. The Dakota in Minnesota fought back in a bloody battle that would come to be known as the “Sioux Uprising,” where Natives clashed with white settlers over access to food and their own stolen ancestral lands.

The Dakota were captured, tried, convicted and sentenced to death in brief military trials, some lasting less than 5 minutes, with no translators or counsel. As a result, 303 members of the Dakota were scheduled to be put to death.

President Lincoln personally reviewed each case, ultimately providing a reprieve to all but 38 of the condemned, who Lincoln believed were guilty of murder or rape. Those 38 Dakota men were executed the day after Christmas 1862 in Mankato, Minnesota.

It was the largest mass hanging in United States history.

Execution of Thirty-Eight Sioux Indians (Image: Snopes)

Abraham Lincoln saved the lives of 264 other Dakota Warriors, but with the death of those 38, the damage was done. And, like his more amplified positive traits, this moment continues to follow President Lincoln long after his death.

Is Abraham Lincoln responsible for a mass execution? Yes.

How much does it change his overall record? That is for history to decide.