I have Raspberry Pi Zero W and this hat.
I did the following things:
disabled login shell through serial in rasp-config
enabled serial port hardware in rasp-config
removed console=serial0 in /boot/cmdline.txt
added lines to /boot/config.txt:
enable_uart=1
dtoverlay=pi-miniuart-bt
Then I restart the RPI.
Problem...
But when I do sudo minicom -D /dev/serial0 (serial1, ttyS0, and ttyAMA0 doesnt work either), it says its offline...
Am I missing something?
Here are all the files that might be interesting:
cmdline.txt
config.txt
To switch the bluetooth controller to the mini-UART so you can use the PL011 UART to communicate with your HAT, you should specify
dtoverlay=miniuart-bt
Alternatively you can use
dtoverlay=pi3-miniuart-bt
which was kept around for backwards compatibility.
Related
I have a raspberry pi but no external keyboard, mouse or ethernet cable to set it up - but I do have micro-sd card reader. Is there a way for me to just write my wireless internet config straight to the micro-sd card so the raspberry pi will be able to connect to the wifi, and then allow me to ssh in?
The micro-sd card already has Raspbian installed on it.
Sure.
Put the card in a drive and mount it.
Go to the partition called boot.
Create an empty file called ssh just using:
touch ssh # Works in Linux/macOS
type NUL >> ssh # Works in Windows
Create a file called wpa_supplicant.conf with your WiFi settings - be very sure that Windows hasn't added any .txt extension:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}
Once it works, and you can ssh successfully into the Raspberry Pi, be sure to run:
sudo raspi-config
and permanently enable ssh for subsequent reboots.
I'm trying to set up a FONA 808 to connect to the internet to a Raspberry Pi 3, but when I run the serial console "sudo screen / dev / serial0 115200" I'm sometimes answered with "OK" and in others the console displays the message as if it were electromagnetic noise, and at other times the console simply crashes Is this normal? How can I solve that?
I am using a Fona 808 Arduino Shield connected to 5V and the TX and RX ports pass through a level logic shifter to convert the logic of 5V of the fona to logic of 3.3V of the raspberry
I am following this tutorial:
https://learn.adafruit.com/fona-tethering-to-raspberry-pi-or-beaglebone-black/setup
Blocked console:
Electric noise display:
Check your /boot/cmdline.txt file.
This is how I solve my pi with the same error.
nano /boot/cmdline.txt or sudo nano /boot/cmdline.txt
copy the script below and paste this in your cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
make sure "console=ttyAMA0,115200" is not on the script.
Make sure you have your original script. Test your pi if it reboot correctly. If it doesn't you can change back the cmdline.txt directly on your sd card and paste your original script.
This command should work with the response back
sudo screen /dev/serial0 115200
AT
ok
This should be a comment but I don't have the reputation to comment so...
Couple of things to try that might help.
1) You shouldn't need the level logic shifter. I don't know exactly what FOAN board you are using but they normally have a Vio pin that sets the voltage of the logic. So in this case you just connect the Vio pin to 3.3V on the Raspberry Pi and the RX and TX will be working at 3.3V.
2) Check your wire connections. Might just be a case of a bad connection.
3) I had better luck with minicom than screen So a command like this should work to connect the bard. sudo minicom -b 115200 -o -D /dev/ttyS0
I face a problem that I can ping to correct IP address, it have no loss. And also I use nmap ping the pi address, and I get it correctly. Then I using VNC viewer to try access to pi, but it always show up "The connection was refused by the host computer"
Did u all have any idea ?
Your problem indicates that your Raspberry Pi was reached by the connection attempt, but that no service was running on the relevant port and hence the connection was refused. I think, this is because the VNC service is not running on your Raspberry Pi.
Update 1
Raspbian now comes with the server by default thanks to a partnership with RealVNC, it just needs to be enabled.
Original
You must enable VNC Server on your Raspberry Pi using terminal
sudo apt-get update
sudo apt-get install realvnc-vnc-server
or you can also enable VNC Server on the command line using the sudo raspi-config command.
Advanced Options->VNC:Yes
Now you can connect to the VNC Server using a application such as VNC Viewer.
I have been having this issue with my Raspberry Pi Zero W even though it worked perfectly beforehand. This page https://www.realvnc.com/en/connect/docs/raspberry-pi.html should help.
I ran vncserver in a ssh window after verifying the interface settings in raspi-config.
It started the VNC Server and gave me the VNC Server catchphrase and the IP address with Port Number as shown in the photo linked below.
vncserver output
After running that command I was able to get the VNC Viewer on my windows machine to connect to the pi.
I then ran sudo systemctl enable vncserver-x11-serviced.service in the ssh window so that it would start automatically on subsequent reboots.
I've had this same problem but found a different reason. I found three ways to get around this error message.
Plug a mouse or keyboard into the Raspberry Pi zero, waking up the screen and the VNC connection.
Wait about 5 - 10 minutes which is the amount of time for the screen saver to kick in which seems to wake up VNC connection. but don't wait to long other wise run this command to get things going via ssh "systemctl start vncserver-x11-serviced.service".
I am hoping the new update they just published will fix this problem. I don't see this as much with the Raspi B3+ as with the Zero H.
The last was plug in both monitor and mouse and that for sure fixes the VNC issues but defeats the headless connection. It seems that running headless and the screen/saver are somehow related but just not smart enough to figure it out.
For people using newer version of Raspberry, VNC option is found under:
Config>Interface Options
pinging to any service will only tells us that whether the server is currently listening on that port or not. It will not tell you the possible result to connection request asked by client.
It seems that, you have installed VNC server but not started it properly. Use this command to start it...
# vncserver start
Also recheck the port number is correct or not.
With the Rasp Pi 4 - had connecting fail after rebooting both the server and client (both Rasp Pi 4s).
Took a while to realize that I have two clients: One named "VNC Client", the other "VNC Viewer for Google Chrome".
The former works, the latter doesn't.
i have just bought a raspberry pi 2 . i manged to set up a headless setup by setting up an ip in the commandline.txt file and then connect to it via putty.
In the /etc/network/interfaces i set up a static ip for the wifi connection along with the connection name and password. and the wifi works fine...
But the problem is the raspberry pi wont connect to wifi unless i connect the ethernet cable and make one ssh connection using putty..
If i boot using wifi only the green light will not turn up and i am not sure if the raspberry is booting or no...but when the ethernet is connected the gren light starts blinking and i can make an ssh connection.
can anyone help me with this.
I've dealt with a lot of pi wifi issues.
Adding "auto wlan0" to /etc/network/interfaces helped, but there were still instances where it didn't start up. I have the edimax ew-7811un usb wifi adapter. Can't remember where I took this script from to give credit.
I have cron running this script (wifi_check.sh) every five minutes:
keepalive_host='ip to ping here'
ping -q -c1 $keepalive_host >> /dev/null
if [ "$?" -ne "0" ]; then
ifdown wlan0
rmmod 8192cu
modprobe 8192cu
ifup wlan0
fi
You could repurpose the script and have something like this in crontab
#reboot /bin/sleep 30 ; /path/to/wifi_check.sh
Which should wait 30 seconds after boot, try to ping the server you specify, if it can: do nothing, if it can't: bring the wifi connection down and then try to bring it back up. I don't think the lines with 8192cu in them are necessary for your purposes unless that driver is also used by your wifi adapter.
I am trying to establish a communication b/w raspberrypi(Raspbian) and PC(Microsoft XP) through GPIO PINS 14(Tx) and 15(Rx) for sending/receiving data... , RS-232 level converter is using for connection of GPIO to PC serial COM port and Voltage conversion from 3.3V to 12V...
I install minicom (Echo ON) at raspberry side and install Teraterm(ECHO OFF) at PC side.
Whatever I typed on minicom, it successfully appear on Minicom and Teraterm but when I tried same thing on Teraterm, it only appears on Teraterm not on minicom and also blocked by minicom (/dev/ttyAMA0). After that I am not able to send data from minicom to Teraterm.
But I just check one thing more and very surprise that, when shorting GPIO PIN 14& 15 together and starting typing on minicom... it just show me one character and stop after that...
Again I repeat whole process by closing/opening minicom, again it just show character and then stop.
Can you plz guide me why it happening and how do I resolve it?
I just read from this link that someone was also facing your kind of problem but not exactly what you are facing.
It is happened because Kernel takeover the control on console so It is good and very important to disconnect the connect of console and kernal from the startup.
Now you can follow these step, I am sure you will get rid from this trouble...
Start editing this file by this command
sudo vi /boot/cmdline.txt
Originally it contained:
dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
deleted the two parameters involving the serial port (ttyAMA0) to get the following:
dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
rebooted (sudo reboot) to confirm that kernel output was no longer going to the serial port. But the serial console was still available. So edited /etc/inittab:
sudo vi /etc/inittab
commented out the following line:
2:23:respawn:/sbin/getty -L ttyAMA0 9600 vt100
Finally, rebooted again and confirmed that nothing was touching the serial port anymore. Then, to test it out installed minicom on the Raspberry Pi:
sudo apt-get install minicom
And ran it:
minicom -b 9600 -o -D /dev/ttyAMA0
After, it is able to send data in both directions!