I am trying to boot my raspberry pi and the first light is green, the second red and the other ones are not on.
It was working fine until I unplugged the SD Card from the pi and plugged it in windows, then i deleted the config.txt file.
I tried to put SD card in the pi again but it just doesn't boot, noting happens except the two lights I talked about.
I took another raspberry pi and another SD card and installed a raspbian image (like on the first one). Everything is working on this second SD card and raspberry pi so I copied the boot folder from this one into the boot folder of the other one.
Now both of them are not working !!!!! I would like to get the first pi to boot without re-installing everything because a lot of stuff was configured, do you have any ideas ?
Maybe re-installing the image on the first pi but before that saving the entire pi folder, then after re-installing copying it back would work ?
Thank you for your time and expertise.
Why did you delete the config.txt file?
It's important, put it back, and try booting again.
Here's a copy of my raspian config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=16
#hdmi_mode=9
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
sdtv_aspect=3
#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=700
core_freq=250
sdram_freq=400
over_voltage=0
gpu_mem=64
Alright I found the solution, Windows sucks a LOT less today in my mind. Thanks to chkdsk I restored the first config.txt file, fsck didn't manage. So to everyone doing some stupid deletion like me, you got windows having your back with chkdsk.
To go back in time : open a command prompt (cmd) then type : chkdsk /F.
If your file system is F of course.
Related
Typically I use the basic camera module 2 on my boards but I wanted to up the resolution and purchased the HQ camera module. After I installed the component and executed the
raspistill -o .jpgs command I just end up with these blank images. I've tried just about everything but get the same result and I'm hoping this thing isn't just a lost cause.
I set-up the config file for a camera
sudo raspi-config
Then ran the following command
raspistill -o testing.jpg
This will just output the blank image and I also tried to view the camera by executing
raspistill -t 0
Still no view opens from the camera
I know how to do something similar with Thonny: I could paste my code into the editor, and press the green "Run" button. This would run the program and give me output. But it would require copy pasting my file into Thonny (I want to code in Vim or run pre-existing examples) and pressing GUI buttons which I don't want to do.
Another related approach would be to copy the program as main.py to the pico, e.g. with rshell: How can you make a micropython program on a raspberry pi pico autorun? But this requires plugging and unplugging the USB, and then reconnecting to the UART every time to see the output.
Is it possible to send file contents to a GNU Screen session? would likely also solve or almost solve my problem, but:
I don't want to start a named server and then run another command, it's messy, I just want to run!
I would need to think about how to send Ctrl+D to soft restart. Should not be hard, but lazy to learn
The first way I got it to work was with https://github.com/scientifichackers/ampy That tool is just designed for the job, and does it perfectly with the run command:
python3 -m pip install --user adafruit-ampy
ampy --port /dev/ttyACM0 run blink.py
Outcome:
stops execution of current program
starts execution of blink.py
shows UART output on my shell
I can then quit ampty with Ctrl + C to get back to my shell, and the program continues to run.
Tested on adafruit-ampy==1.1.0, Ubuntu 22.04 host, Raspberry Pi Pico W, MicroPython rp2-pico-w-20221014-unstable-v1.19.1-544-g89b320737.uf2.
I've a sd card on my phone, it's some type of freez , I could not do any thing on it , when I remove files , it removes and then come back to what it was , it's not formatting.
it freeze and nothing works on it .
What I've tried so fa :
1- tried diskpart in cmd and change readonly and it's not write protected I think .
What should I do ? How can I save this sd card ?
two possibilities, first is that being a hardware thing, as micro SDHC have a little notch you can easily notice which matches another notch in the reader and that basically just enables it in read-only mode. That you can't change, just try to use another reader or you could put a piece of silicon or tape on notch, easiest thing is to use another reader.
Second possibility is that being a file permission issue, in which case you can do the following : In terminal, use these commands:
gksudo nautilus
This will launch nautilus in root shell and bypass all permissions. OR:
sudo fdisk -l
This will give you a list of the drives on your system, figure out which drive it is in the list, easiest way is to look for the blocks as this is the space. It will probably be /dev/sdb or /dev/sdc, then
sudo chown -hR <your username> <the SDHC drive, /dev/sdb for example>
this will change ownership of the drive to you. OR:
sudo chmod -R 777 <the SDHC drive, /dev/sdb for example>
Though if you just execute the first command sudo nautilus it will save you all this trouble, but you'll have to do it every time you use the SDHC.
If all of this doesn't work, use this command :
sudo mount --options remount,rw
If you have a Linux computer with an SD/MMC card reader, try running
sudo sdtool /dev/mmcblk0 unlock
Note that you need an MCC device (not a USB mass storage device) for this to work.
sdtool can be found here.
I'm currently playing with my brand-new raspberry with adafruit's touch-tft and raspberry Cam.
I noticed, if I run raspivid -p, it displays the preview in a frame on top of the bash.
How can I create an application (java, python, c++(preferred)) to display a GUI without having to startx?
I'd love to use adafruit's touch-tft for a project, but startx needs a lot of resources. Of course it would be cool to have the touch-functionality too.
Edit:
Maybe I expressed myself a little bit confusing: I would like to create an application that doesn't need startx but has some kind of GUI.
The answers below aren't 100% ready to go but they pointed me to the right direction. Since I saw many similar questions I will try to give a step-by-step solution:
Setup your raspberry with adafruit's TFT: https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/overview
(you don't have to replace the TFT with HDMI as standart display)
be sure FRAMEBUFFER=/dev/fb1 startx is running correctly on the TFT screen, I have my TV plugged in the HDMI port, this way I can use the bash on the TV screen and run x on the TFT
Follow this tutorial to create your first pygame: http://www.pygame-doku.laymaxx.de/tut/intro/intro.html
(you can just copy&paste, wget ball.gif)
Insert this 2 lines at the beggining: (github.com/notro/fbtft/wiki/Pygame)
import os
os.environ["SDL_FBDEV"] = "/dev/fb1"
If you want to test the touch-screen to, you can change Line 15:
From:
if event.type == pygame.QUIT: sys.exit()
To:
if event.type == pygame.MOUSEBUTTONDOWN: sys.exit()
This will exit the application if you touch the screen
Save file e.g. pygame1.py and execute with $python pygame1.py
You should now see a bouncing ball on your TFT while the HDMI output still displays the BASH on your TV (but it isn't active of course) touching the screen will exit the game if you completed step 6
Why I'm doing this? This way you can display a simple GUI with e.g. buttons to do some action, like turn your lights on/off if you use your RPI for home-control.
You can use for example pygame library! check this tutorial http://archive.furtherfield.org/rp-resources/RP-workshop-handout.pdf pg. 17
Below, you will find a detailed description of how to be a minimal window manager to start a graphics program of your choice.
-Install Required Packages:
apt-get update
apt-get install xorg - no-install-recommends gdm3 matchbox-window-manager Iceweasel rsync-y
-The system in question, select Add a new user interface gdm3. The terminal is the default name will be used.
adduser kiosk
-Create-Xsession. This script will be executed when the user logs on.
xset s off
xset -dpms
matchbox-window-manager &
while true; do
rsync -qr --delete --exclude='.Xauthority’ /opt/kiosk/ $HOME/
firefox http://www.google.com (Replace your application!!!)
done
Save Ctrl + O; Exit: Ctrl + X
chmod a + x. xsession
cp / opt / kiosk / .xsession / home / kiosk
Set Auto-Login. Kiosk user will enter automatically after boot.
nano / etc/gdm3/daemon.conf
[Daemon]
AutomaticLoginEnable = true
AutomaticLogin = kiosk
We have chosen to configure, program, if necessary
-Screen calibration when not loaded up the whole screen:
/ Boot / config.txt file, clear the comment:
disable_overscan = 1
I hope I helped
Check out Urwid, a text-based ui that can run in a terminal, or, I assume, on a Raspberry Pi started up without startx.
In short you can't, applications like gedit are built atop of a desktop environment (e.g. Gnome, Kde).
Modern OpenSolaris is configured to disallow root logins during normal boots. It is only possible in single-user mode. However, many instructions online simply say to add "-s" to the end of the default grub boot arguments, which leaves a graphical boot progress display in an endless loop and never enters the single-user mode console.
The key point left out of many OpenSolaris single-user boot instructions is that you must modify a text boot grub entry, and not the default graphical entry. Booting in graphical mode with the single-user switch leaves the boot progress graphic overlayed atop the console forever, never allowing the maintenance console to be visible.
Reboot.
At the grub prompt, highlight the most recent text boot entry and press 'e'.
Highlight the line beginning with kernel$ and press 'e'.
Add '-s' to the end of the line.
e.g. change:
kernel$ /platform/i86pc/kernel/$ISADIR/unix -Bv$ZFS-BOOTFS
to
kernel$ /platform/i86pc/kernel/$ISADIR/unix -Bv$ZFS-BOOTFS -s
Press 'enter'.
Press 'b' to boot.
The system should boot without a graphical overlay, and should promptly arrive at the system maintenance console.
Full solution of OpenIndiana 157:
Reboot
At the grub prompt, highlight the most recent text boot entry and press 'e'.
Remove three lines (pressing d with cursor on the line to be deleted):
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
Press e with cursor on the line beginning with kernel$
Remove portion " ,console=graphics" from this line
Add ' -s' to the end of this line
Press 'enter'.
Press 'b' to boot.