Quantcast
Channel: Recent Questions - Raspberry Pi Stack Exchange
Viewing all 50864 articles
Browse latest View live

can't login after modifying .bash_aliases

$
0
0

system: raspbian lite 10
I made the .bash_aliases with some aliases. Accidently i put
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
into .bash_aliases instead of .bashrc. After sourcing it i'm unable to login anymore. Is there an emergency mode to fix the files? (i have not set a root password, and i dont have an external sd-reader atm)


Making Raspbian look like Windows 7

$
0
0

enter image description hereenter image description hereMy goal is to make Raspbian look like the good old OS, Windows 7. So far, I have already completed:

  • Installed the Windows 7 theme
  • Installed the mouse cursor theme
  • Changed the background to default Windows 7 picture
  • Changed the menu bar icon

I have all the default Windows 7 .ico images in my downloads folder, and I am wondering if there is an easy way to install all the icons and replace the default PiXflat file icons. Is there a way to do this? I attempted at making my own theme... but failed miserably. Help is appreciated! I loved the Windows 7 OS, and I heard Linux can look like Windows 7. So this is what I am trying to do

Link to download SegoeUI font from Microsoft: http://b.xfreeservice.com/redir/clickGate.php?u=8otB939m&m=12&p=3b121G4eNI&t=33&splash=0&s=&url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Ftypography%2Ffont-list%2Fsegoe-ui

How can I run 32-bit compiled assembly code on Rasberry PI 4 B, if possible at all?

$
0
0

I bought the PI 4 B for a university project, as I have to make small 32-bit ARM assembly program. However I realized it too late, that it comes with an aarch64 architecture ARM processor.

  • I would like to know if it is possible to compile my source code using gcc and run it on my PI.
  • Can I install a 32-bit operating system on it, so I can run it like that maybe?
  • Is it possible to run a virtual machine, like VBox (as far as I know it is not available for ARM architecture)?

TTL serial connection doesn't work

$
0
0

I am trying to connect Raspberry Pi with a TTL serial cable.I couldn't get it to work. My Debian packages are up to date.I activated serial and gpio connections via raspi-config.

I try this command on linux but only a black screen appears.

sudo screen /dev/ttyUSB0 115200

Additional informations:

Manjaro:

red@manjaro ~$ lsusb                                                                                                       
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 13d3:3496 IMC Networks 
Bus 001 Device 004: ID 13d3:5a01 IMC Networks USB2.0 VGA UVC WebCam
Bus 001 Device 003: ID 1bcf:08a6 Sunplus Innovation Technology Inc. Gaming Mouse
Bus 001 Device 002: ID 1a2c:2124 China Resource Semico Co., Ltd USB Keyboard
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

red@manjaro ~$ ls /dev
acpi_thermal_rel  cuse         hidraw2    loop-control  ptmx      snd     tty12  tty23  tty34  tty45  tty56  ttyS0    vboxdrvu    vcsa2  vfio
autofs            disk         hidraw3    mapper        pts       sr0     tty13  tty24  tty35  tty46  tty57  ttyS1    vboxnetctl  vcsa3  vga_arbiter
block             dri          hidraw4    media0        random    stderr  tty14  tty25  tty36  tty47  tty58  ttyS2    vboxusb     vcsa4  vhci
bsg               drm_dp_aux0  hpet       mei0          rfkill    stdin   tty15  tty26  tty37  tty48  tty59  ttyS3    vcs         vcsa5  vhost-net
btrfs-control     drm_dp_aux1  hugepages  mem           rtc       stdout  tty16  tty27  tty38  tty49  tty6   ttyUSB0  vcs1        vcsa6  vhost-vsock
bus               fb0          hwrng      mqueue        rtc0      tpm0    tty17  tty28  tty39  tty5   tty60  udmabuf  vcs2        vcsu   video0
cdrom             fd           initctl    net           sda       tpmrm0  tty18  tty29  tty4   tty50  tty61  uhid     vcs3        vcsu1  video1
char              full         input      null          sda1      tty     tty19  tty3   tty40  tty51  tty62  uinput   vcs4        vcsu2  watchdog
console           fuse         kmsg       nvram         sda2      tty0    tty2   tty30  tty41  tty52  tty63  urandom  vcs5        vcsu3  watchdog0
core              gpiochip0    kvm        port          serial    tty1    tty20  tty31  tty42  tty53  tty7   userio   vcs6        vcsu4  zero
cpu               hidraw0      lightnvm   ppp           shm       tty10   tty21  tty32  tty43  tty54  tty8   v4l      vcsa        vcsu5
cpu_dma_latency   hidraw1      log        psaux         snapshot  tty11   tty22  tty33  tty44  tty55  tty9   vboxdrv  vcsa1       vcsu6

Raspberry Pi

OS: Raspbian GNU/Linux 10 (buster) armv7l 
Host: Raspberry Pi 3 Model B Plus Rev 1.3

My cable connection: enter image description here

Raspberry Pi 4G

$
0
0

I have a robot(use raspberry pi 3) outside my home(no internet connection there) and I 'm with my laptop at home and I want to see the graphical environment like this of raspberry pi. How can I do this? I 'm thinking to get this module with a SIM card and put it to raspberry pi to have 3G or 4G connection. Can you tell me more about this (if I can do it with this module) ? I have to give some commands to the terminal of raspberry pi to have 4G ? After these commands ,can I do raspberry pi to connect to 4G automatically ,when I give current to it? After connecting to 4G ,can I have access to raspberry from laptop via VNC? I have these questions and I want your help about this project!!! Thanks a lot!

rasberry pi 3 says it's hot (50*C), but is cool to the touch

$
0
0

My raspberry pi 3 reports a [stable] temperature of 49.5 *C - which is pretty warm. However, when I touch all of the components with my finger, including the CPU, it does not feel hot or even a little warm. I am confused, would have expected the CPU to feel warm/hot if truly running at this temperature.

Open (lx)terminal on startup, run program in it

$
0
0

I have the following service:

[Unit]
Description=Create test directory
After=graphical.target

[Service]
Type=oneshot
RemainAfterExit=yes
User=pi
ExecStart=/home/pi/Desktop/startup-script.sh

[Install]
WantedBy=graphical.target

This service is calling a script "startup-script.sh", located on the /Desktop.

My startup-script is looking like:

#!/bin/bash

sleep 20

sudo mkdir /home/pi/Desktop/test

sleep 5

sudo lxterminal -e /home/pi/Desktop/exe

Now the script is creating a new directory test at startup via the service, but it is not opening a new terminal and running my C++ program exe in it.

Now, when I just run my startup-script like sudo ./startup-script.sh, it is both creating a new directory test and opening a new lxterminal and running my C++ exe program in it, but the terminal is not opening on startup and I want this to happen.

Is it possible to do anything like this in the startup service: (this is not working.)

sudo lxterminal -e ./home/pi/Desktop/startup-script.sh &

Any thoughts on a solution to this?

Is the Raspberry Pi 4 Model B a fast web hosting server for a single website?

$
0
0

I'm thinking of purchasing a Raspberry Pi 4 Model B to host my WordPress website. The website has 4 pages and 2-3 plugins. Will it be fast?

Here are some specs for the Raspberry:

Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz 1GB LPDDR4-2400 SDRAM 2.4GHz and 5.0 GHz IEEE 802.11b/g/n/ac wireless LAN, Bluetooth 5.0, BLE True Gigabit Ethernet


Running x86 Windows app on a Raspberry Pi 3B

$
0
0

I followed this guide to install QEMU in a chroot and I'm able to execute x86 Linux binaries: https://stackoverflow.com/questions/51895452/qemu-debian-x86-on-raspberrypi

Next, I tried installing WINE and Xvfb. However, running Xvfb gives a single error:

Bus error

Checking dmesg, I find the following error every time Bus error happens:

[  374.559845] Unhandled prefetch abort: unknown 1 (0x001) at 0x604e15a6

I'm suspecting this error is due to some sort of memory setting on the host kernel. Is there anything else I need to enable?

As for extra context: the application itself is a Windows app built with Delphi. It takes several images, processes them, and writes some files out. It can be run in batch mode, but it still needs a window to draw to, and I need to manually configure it when installing it for the first time, so I'll need something like x11vnc to access the app the first time.

EDIT: The error also happens when running Wine with no X server - I thought I may be able to run X on the "host" and the app writing to an X socket.

Problems with init=bin/sh working

$
0
0

I followed the below instructions. Putting the init at the end of the sole line in cmdline.

boot=UUID=2311-4211 disk=UUID=69a6af94-e21a-450d-bf5e-fcc08d992566 init=/bin/sh

I return sd card to pi and it boots up like normal. What am I doing wrong?

*Power down and pull the SD card out from your Pi and put it into your computer.

*Open the file 'cmdline.txt' and add 'init=/bin/sh' to the end. This will cause the machine to boot to single user mode.

*Put the SD card back in the Pi and boot.

*When the prompt comes up, type 'su' to log in as root (no password needed).

*Type "passwd pi" and then follow the prompts to enter a new password.

*Shut the machine down, then pull the card again and put the cmdline.txt file back the way it was by removing the 'init=/bin/sh' bit.

RPI 0 W Finding IP headless?

$
0
0

I recently bought a Raspberry Pi Zero W to make a USB computer.

I've flashed an image and it appears to have booted correctly (as seen by the solid green light).

I have a microUSB to USB cable connecting it to my PC through the data and power port in hopes to use SSH to access it. I'm using PuTTY to do this. When I connect via the pi@raspberrypi.local IP address it says that there is no host. I have Bonjour installed too. So, I'm trying to find the IP address of the Pi itself, but I'm not sure how to.

  • I have a RPI 0 W
  • I'm trying to SSH into it
  • It's connect through the data and power port to my PC
  • SSH says there is no host.

Thank you!

Direct reading from i2c

$
0
0

I am attempting to increase the frequency at which I read samples from the I2C dedicated pins. I have attempted this through the wiringPi library (C code), from which I reached just about 900Hz. As well as with python, I was able to reach roughly the same figures. I did some research and was lead to multi-byte reads via ioctl and read(), write() functions which as far as I understand are more low level, direct access of the I2C bus as opposed to the wiringPi library and any other python library I could've used prior. Though after some code testing, I am stagnating at just about 1.1KHz for a 14 byte read (9 seconds for 10K samples). I am unsure what I am missing here or how I can improve this as I would like to hit around 2KHz.

Reason being is I would like to thread in between and around the I2C communication. Also if anyone has any pointers as how this should be approached that would be appreciated.

Code for reading data, file printing adds 2 seconds, without any of the commented out code the time for 10000 samples is roughly 7 seconds.

while(counter<10000){
    buf[0] = 0x3B;
    write(fd,buf,1);
    read(fd,buf,14);

    // if ((write(fd, buf, 1)) != 1){
    // // Send the register to read from
    // fprintf(stderr, "Error writing to MPU6050\n");
    // }

    // if (read(fd, buf, 14) != 14){
    // fprintf(stderr, "Error reading from MPU6050\n");
    // }else{}

    // for(int i=0;i<14;i++){
    //   fprintf(new_file,"%.0f,",(float)buf[i]);
    // }
    // fprintf(new_file, "%s\n","");
    counter++;
  }

Sending Data from Raspi to Windows Remote Desktop

$
0
0

I have a project that uses Raspi3 to collect data via a Temp&Humi Sensor and sends that data over to a http site to allow another software to retrieve the data. I am having trouble due to the fact that my raspi is connected via Ethernet cable to my host machine(connected to the intranet) but I need to retrieve the data from a Remote Desktop on the Intranet. I am not sure how to go about doing this. Any help would be greatly appreciated!

Recover Raspberry Pi 3B+ / Raspbian Stretch powered off during upgrade

$
0
0

My Raspberry Pi 3 B+ was turned off while running sudo apt-get upgrade. The SD card (SD card A) is fine, the PI is fine, but it hangs at the rainbow screen on boot.

I flashed a new card with base Raspbian Buster (SD card B) and booted the Pi using that with SD Card A in a USB reader. Can see SD Card A file systems (rootfs, boot) and open in terminal, read files, etc.

I don't really know what I am doing with fsck but after some reading did the following based on How to recover files from pi SD card which can't boot

# have RPi 3B+ booted with SD B and original SD A card that was powered off during upgrade in USB reader slot

pi@raspberrypi:/media/pi $ mount 
/dev/sdb2 on /media/pi/rootfs type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)
/dev/sdb1 on /media/pi/boot type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)


pi@raspberrypi:/media/pi $ sudo umount /dev/sdb2
pi@raspberrypi:/media/pi $ sudo umount /dev/sdb1

pi@raspberrypi:/media/pi $ sudo e2fsck /dev/sdb2;
e2fsck 1.44.5 (15-Dec-2018)
rootfs: clean, 208916/1903104 files, 4906295/7724160 blocks

pi@raspberrypi:/media/pi $ sudo fsck /dev/sdb1
fsck from util-linux 2.33.1
fsck.fat 4.1 (2017-01-24)
/dev/sdb1: 113 files, 48952/516191 clusters

to me this implies SD A is OK card and filesystem integrity-wise, and I might be able recover it by cleaning up or re-initializing the card with Raspbian Stretch.

I've been searching for a couple hours but Google is just incoherent in terms of how to do this - most of the advice for searches like "repair Raspberry PI SD card after power off during upgrade" just talk about corrupted SD card or not pulling the power while it's running, which isn't this scenario.

I have a number of sensors attached to this Pi and drivers/custom code installed and if there's any way I can recover SD A I'd like to do that. I can just copy the files to SD B but I'm afraid I'll just copy the corrupted to SD B and then it won't work either.

Can I edit files on SD A to reset the in-progress upgrade, or find out what's wrong?

After Power Failure, RPI now just cycles through boot sequence without booting

$
0
0

So some workmen were working at the house switch box which created multiple power failures for the RPI.

Now it is not working.

  1. At first, it was just dead (red power LED, but nothing else) so I restored my most recent IMG file. It will now start to boot (prints two lines, the second of which says something like "not a IO03166 code", but Google is no help.) It then displays a big Raspberry with a symbol in the center saying "shift".) Then starts to printing console output like it is starting to boot Linux but after printing a bunch of lines it resets and starts booting again. Stuff flashes by so fast I cannot see most of it.
  2. When that didn't work, I restored my oldest IMG file to the SD. I choose to do this particular IMG file because this IMG file I previously restored and booted when I first got the system to make sure my backup procedure worked. However, it still does the same two-line, Raspberry, console, reboot sequence as with the other image.
  3. I used SDCardFormatterV5 to completely reformat the SD, then restore an IMG; still reboot cycles.
  4. I connected keyboard and pressed Shift at the Raspberry . . . it flashes some kind of a software display (maybe GRUB menu?), but then instead of coming to the keyboard, it blinks by that to the console output again and then resets as before.

I am beginning to wonder if there is an actual problem with the RPI itself caused by the repeated power failures.

Other than buying a new RPI . . . my bag of tricks is empty . . . any suggestions?

Frank


3B+ fails to boot Ubuntu mate

$
0
0

I have the problem that the bootloader and kernel are too old in the mate image to run the on the new hardware.

Raspian works fine with a noobs install.

I tried the advice in the thread here

https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=208538

Taking the kernel7.img and 3+.dtb file it still doesn't work, the final part of advice is... To copy across

/lib/modules/*-v7+

But I can't find that folder anywhere and using a windows PC none of the img files on the raspian sd mount windows just says they are corrupt.

Can someone please help get mate booting on a 3B+?

TIA

Booting up feh at launch

$
0
0

I am quite new to programming but I have already started a too big project, and thus I got stuck.

The project is mainly meant to replace a pc used for slideshows in a museum. The current pc is way overpowered for this simple job, and tends to crash when the power is cut. My father got the idea to replace this pc with a raspberry as it is more fit, and if it crashes you can just replace the sd card.

After some looking around I found an extension called Feh, wich worked perfectly. But the problem is: the program needs to start when the raspberry boots up. I have tried a few things but none of them worked yet. the only thing that did work was the created .SH file. Furthermore I am scared to change too much in the laun

How to set up the Edimax EW-7611ULB combo Bluetooth WIFI dongle

$
0
0

Although, this dongle works (for awhile), there is a problem with the bluetooth driver. After streaming for about an hour, the driver eats up all the Pi memory and the Pi stops responding. Power cycling is the only fix. This may be related to the flood of messages it puts out on dmesg. I tried clearing dmesg, but that does not recover the lost memory. You can watch the memory slowly decrease by running htop while streaming to a bluetooth speaker. I think the memory problem is with the bluetooth driver, because the problem does not occur when using a different bluetooth dongle.

Maybe someone with driver coding experience could find a solution. Please post any ideas you might have regarding the memory problem.

#the bluetooth driver floods dmesg with about 10 messages per second...
dmesg|tail
[  329.685269] rtk_btcoex: count_pan_packet_timeout: pan_packet_count 0
[  329.765265] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 37
[  330.725279] rtk_btcoex: count_pan_packet_timeout: pan_packet_count 0
[  330.805278] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 38
[  331.765273] rtk_btcoex: count_pan_packet_timeout: pan_packet_count 0
[  331.845278] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 37
[  332.805301] rtk_btcoex: count_pan_packet_timeout: pan_packet_count 0
[  332.885305] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 38
[  333.845301] rtk_btcoex: count_pan_packet_timeout: pan_packet_count 0
[  333.925309] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 37

Steps to compile the bluetooth and wifi drivers for EDIMAX EW-7611ULB on Raspberry Pi

The compile process:

First, install the headers for your OS

sudo apt-get install raspberrypi-kernel-headers

--- the system is now ready to compile ---

BLUETOOTH DRIVER

#get bluetooth driver from the Edimax site
wget http://www.edimax.us/download/drivers/EW-7611ULB/EW-7611ULB_Bluetooth_driver.zip
unzip EW-7611ULB_Bluetooth_driver.zip
cd EW-7611ULB_Bluetooth_driver
cd Linux_BT_USB_v3.1_20150526_8723BU_BTCOEX_20150119-5844_Edimax

Fix source file so will compile with >= 4.9.x kernels

In Section "(II.) Bluetooth Driver Installation", before running "sudo make install -s", you need to edit the file bluetooth_usb_driver/rtk_coex.c At line 448, change:

#if HCI_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
#if HCI_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
    bt_cb(skb)->req.start = true;
#else
    bt_cb(skb)->hci.req_start = true;
#endif
#endif

to:

#if HCI_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
#if HCI_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
    bt_cb(skb)->req.start = true;
#elif HCI_VERSION_CODE >= KERNEL_VERSION(4,9,0)
    bt_cb(skb)->hci.req_flags |= HCI_REQ_START;
#else
    bt_cb(skb)->hci.req_start = true;
#endif
#endif

Fix the Makefile

change depmod line to in TWO places, BOTH the install and uninstall sections:

depmod -a -v                                           

Compile and install the driver

sudo make install -s
sudo reboot

This completes the bluetooth driver install. If you want, you can test by connecting something using bluetoothctl. Read the Bluetooth driver info below to prevent your logfiles from filling up.

If you later want to use a different Bluetooth dongle, you'll need to revert to the stock Bluetooth driver as follows:

cd EW-7611ULB_Bluetooth_driver
cd Linux_BT_USB_v3.1_20150526_8723BU_BTCOEX_20150119-5844_Edimax
sudo make uninstall -s
sudo reboot

WIFI DRIVER

sudo apt update
#get the wifi driver
sudo apt install git
git clone https://github.com/lwfinger/rtl8723bu.git

####   optional    ###################################################
#if you don't want TWO wlan devices (wlan0 and wlan1) in ifconfig    #
#disable concurrent mode, by commenting out the line in the Makefile #
#cd rtl8723bu                                                        #
#nano Makefile                                                       #
#(put # in front of this line):                                      #
#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE                            #
######################################################################

#make the driver
sudo make
sudo make install
sudo modprobe -v 8723bu
#This driver cannot work with the standard driver rtl8xxxu
#so create 50-rtl8xxxu.conf with one line: 
blacklist rtl8xxxu
sudo nano /etc/modprobe.d/50-rtl8xxxu.conf 

This completes the WIFI driver install

Bluetooth Driver Info

The bluetooth driver floods the message log with some info, so to prevent it overloading your logfile, edit /etc/rsyslog.conf and add the following line to discard those messages:

:msg, contains, "rtk_btcoex"    ~

Log file example snip shown below:

...snip from /etc/rsyslog.conf.........................

###############
#### RULES ####
###############

#
# First some standard log files.  Log by facility.
#
auth,authpriv.*         /var/log/auth.log
:msg, contains, "rtk_btcoex"    ~
*.*;auth,authpriv.none      -/var/log/syslog
#cron.*             /var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*              -/var/log/kern.log
lpr.*               -/var/log/lpr.log
mail.*              -/var/log/mail.log
user.*              -/var/log/user.log
#kern.info           -/var/log/kern.info

...snip...............................................

How to add the hfp/hsp profile based speaker for input (speech recognition)and output simultaneously?

$
0
0

I m trying to make kinda type of assistant out of my raspberry pi 3 b+ model and so bought this Speaker . So that I can use it to give audio input as well as get the output at the same time . But I'm totally confused how to connect it !! Even I'm not sure whether I have bought the right speakers or not ? Basically I saw it supports call answering that's why I bought it.

So please guys instruct me how to do it or anyone suggest me the right speaker (if that is not worth suitable) . I'm a beginner , any help is highly regarded !

Raspberry Pi Zero W Finding IP headless?

$
0
0

I recently bought a Raspberry Pi Zero W to make a USB computer.

I've flashed an image and it appears to have booted correctly (as seen by the solid green light).

I have a MicroUSB to USB cable connecting it to my PC through the data and power port in hopes to use SSH to access it. I'm using PuTTY to do this. When I connect via the pi@raspberrypi.local IP address it says that there is no host.

I have Bonjour installed too. So, I'm trying to find the IP address of the Pi itself, but I'm not sure how to.

  • I have a Raspberry Pi Zero W.
  • I'm trying to SSH into it.
  • It's connected through the data and power port to my PC.
  • SSH says there is no host.

Thank you!

Viewing all 50864 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>