How to enable the Raspberry Pi 4 to work remotely? - raspberry-pi

Anyone knows how to operate the Raspberry Pi 4 remotely? So that I don't need to always connect it to a monitor when I want to use it.
My Pi is Raspberry Pi 4 with Yocto image built inside. I wonder how to configure the Pi so that it can be used remotely without the need to connect to a monitor. Any helps will be appreciated!

If you're using the Yocto reference distro 'Poky', then you can enable one of the following IMAGE_FEATUREs:
ssh-server-dropbear (uses Dropbear SSH)
ssh-server-openssh (uses OpenSSH)
and that will start a SSH server at boot.
A quick way to do this, is to add the following to your local.conf:
# local.conf
EXTRA_IMAGE_FEATURES += "ssh-server-dropbear"
A more permanent solution is to define a custom image recipe:
# my-custom-image.bb
require core-image-minimal.bb
DESCRIPTION = "A small image with a SSH server for remote access"
IMAGE_FEATURES += "ssh-server-dropbear"
Alternatively, if you already have your own Yocto configurations - just add either the dropbear or openssh package to your image/packagegroups.

Related

Buildroot ir remote using ir-keytable or lirc

I created an image for raspberry pi zero 2 w using buildroot,
Also added overlay gpio-ir in config.txt but not able to receive ir signal.
No logs are printed for gpio in dmesg.
No devices are showing in /proc/bus/input/devices
Can anyone help?
I found solution my self.
Actually buildroot is not start gpio-ir-recv module at boot time.
So we need to load module manually at boot time.
We can load module by this command
modprobe gpio-ir-recv
So i have created one service to load module in /etc/init.d

How to turn USB port power on and off in Raspberry PI 4

On a Raspberry PI 3B+, it's simple to turn power on its four USB ports off and on. Simply write a "0" to /sys/devices/platform/soc/3f980000.usb/buspower to turn power off and a "1" to turn power on.
The same method doesn't work on Raspberry PI 4B, 4GB (the hex number before ".usb" is different, that's NOT the problem). I have tried uhubctl and hub-ctl as well without any success. I have used a USB power meter to measure the voltage on the ports. It doesn't change. Un a PI 3B+ it changes as expected.
Does the PI 4 support turning USB power off and on in software at all? If it does, how to do it? Or is there a bug somewhere that has to be fixed to make it work? I use the newest Rapbian on both the Pi 3B+ and the Pi 4.
Yes, uhubctl supports RPi4B, I have recently added support for it - you need to use uhubctl version 2.4.0 or later (or build it from master branch). It is also necessary to update USB firmware using sudo rpi-eeprom-update to make power switching actually work.
Note that you are missing out by using sysfs method to turn USB off on RPi3B+ - using uhubctl you can control either all 4 ports, or 2 of them independently. RPi4B only supports turning off all ports at once.
As far as I read Raspberry Pi and Linux issues on GitHub, it seems that there was a bugfix released for uhubctl on 2019 July. Patch I'm refering to: mvp/uhubctl#4aae44c. It should be merged to master. So...
Another thing to have in mind, it seems that RRi 4B hardware only supports "ganged power switching", which means... that You can only turn on and off ALL the USB ports. Not every single one in particular.
To shut off power for USB ports and Ethernet type the following into the Raspberry Pi Terminal and press enter:
echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/unbind
For that you need to install:
sudo apt-get install uhubctl
For turn on again use this command:
echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/bind

Installing Ravendb on the Raspberry Pi

I'm currently trying to install Ravendb 4.1.5-patch-41012 for the Raspberry Pi on my Raspberry Pi 3 Model B running Raspbian Stretch Lite. When I run the run.sh script it will give an error about not being able to open a browser even if I set the Setup.Mode in the settings to none. After that I'm able to run server commands but I'm not able to access Ravendb studio and the Ravendb server locally or using my local network. Are there extra steps I have to take and or thing I have to keep in mind when installing Ravendb on the Raspberry Pi?
Raspbian Stretch Lite doesn't equipped with local web browser, therefor you may need to give outside access before using web setup. In the following link you can find description on the Server's configuration: https://ravendb.net/docs/article-page/4.1/csharp/server/configuration/configuration-options
Modify Server/settings.json in a way it fits your security needs, as follows (Replace 10.0.0.90 with your Pie's IP)
Totally unsecured access from anywhere (ATTENTION: This will give access to the database to any one with access to this docker instance):
{
"ServerUrl": "http://0.0.0.0:8080",
"PublicServerUrl": "http://10.0.0.90:8080",
"Setup.Mode": "None",
"Security.UnsecuredAccessAllowed": "PublicNetwork",
}
Access from docker's host machine or other machines on you local LAN:
{
"ServerUrl": "http://10.0.0.90:8080",
"Setup.Mode": "None",
"PublicServerUrl": "http://10.0.0.90:8080",
"Security.UnsecuredAccessAllowed": "PrivateNetwork",
"License.Eula.Accepted": true
}
Browsing to http://10.0.0.90:8080 should work at this point.
You can use cli, read : https://ravendb.net/docs/article-page/4.1/Csharp/server/configuration/command-line-arguments
Example:
cd ~/RavenDB/Server
./Raven.Server --Security.UnsecuredAccessAllowed=PublicNetwork --ServerUrl=http://0.0.0.0:8080 --PublicServerUrl=http://10.0.0.90:8080 --Setup.Mode="None" --DataDir=/mnt/ExternalDisk/RavenDB
As a side note: I do recommend to set "DataDir" to external mounted USB disk, rather then using the default SD card data path, if this is your case.
And later on you may want to use scripts for adding RavenDB as service on your Pie (see install-daemon.sh here : https://github.com/ravendb/ravendb/tree/v4.2/scripts/linux)
The run.sh is trying to start a browser the first time you start RavenDB to give you access to it. Given that you are running the Lite version, there is no such browser, obviously.
See Adi's comment on how to access RavenDB from outside the Pi machine.
You can just call server/Raven.Server instead of the run.sh instead to start RavenDB

how to get beaglebone black wifi with buildroot

I am trying to build beaglebone black wifi with buildroot but it seems that there are several configuration , for u-boot and kernel.
What is the right def config , am335-evm or omap3-beagle for BBB wireless?
What is the right kernel and def config for BBB wireless?
U-boot should be the target image format u-boot.bin or u-boot.img?
Does anyone has a git repo of a working beaglebone black ( wireless or not) working?
What are the minimum uEnv.txt settings to get u-boot start working?
Thanks!
You can use beaglebone_defconfig configuration file:
make beaglebone_defconfig
It enables support for multiple am335x boards like BBB, am335x-evm etc. This BR configuration provides U-Boot and U-Boot's internal scripts would read the board ID and load corresponding device tree blob. At the end of the build process you'll get a SD card image, that you can directly burn onto your SD card.
The only things missing are WiLink firmware and wpa_supplicant. Just select following packages in BR's menuconfig:
BR2_PACKAGE_WILINK_BT_FIRMWARE
BR2_PACKAGE_WPA_SUPPLICANT
Ok, so it does work, but i was waited to see on the HDMI the login.
After I connected UART using this post:
https://codechief.wordpress.com/2013/11/11/beaglebone-black-serial-debug-connection/ ( but i did replace tx and rx)
Pressed the S2 button i do see the linux prompt.

setting default directory on raspberry pi

I recently tried to install php on my raspberry pi, and a web server. By doing so the default location of user pi is now var/www, but it used to be /home/pi. How can I change it back to the way it was?
The most proper way is to use Virtual Hosts in the directory : /etc/apache2/sites-available/
The default is pointing to /var/www/
I'm always creating a user for a project and then I point the Virtual Host and I use SuPHP for the security.
To solve your problem, look at the file /etc/apache2/sites-available/default
Edit :
is it a problem related to apache and php or system/unix ?