Problems are often occuring when using both bluetooth and wifi at the same time with both rpi 3 and zero.
In order to solve problem concerning the bluetooth (used for me to share audio content), I've found two solutions :
disabling wifi when bluetooth is used (which can disconnect you from the pi if you use ssh)
using a specific bluetooth adapter instead ...
You need to pull the GPIO to either 3V3 or ground in each switch position.
If you connect one end of the switch to ground it would be normal to connect the other end of the switch to a GPIO with a pull-up to 3V3.
If you connect one end of the switch to 3V3 it would be normal to connect the other end of the switch to a GPIO with a pull-down to ground.
The example you used at systemd is a bad example. It states to Restart=always. That doesn't help to "fix" a buggy service that failed to run stable. It will only spam your system with starting attempts until it will give up after some minutes.
In particular for your case it doesn't fit because you need to run your service only one time at start up and do ...
playsound uses Gstreamer library for playback, which should normally rely on PulseAudio (although other plugins do exist) using the default audio sink. I would start by running pavucontrol and check that the A/V port is selected as default audio sink, and set it as default if it isn't.
This question has an answer with a much more detailed troubleshooting ...
Now you have your script running as a systemd daemon, you can review its status using journalctl. You don't even really need to write your startup message to a file as journalctl will show you every time the service starts...
But of course you can see startup by inspecting the contents of /var/log/syslog , and dmesg will also be useful.
As noted in a comment on your question, the error suggests that a Python module is not found, which is controlled in part by environment variables such as (but not limited to) PYTHONPATH. (See, for a full description, the documentation for Python modules.)
Note that this is different than saying your script runs before MySQL starts. That may or may not be ...
/etc/profile is NOT for starting user code. It is:-
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
i.e. it is for configuring your shell (even if you wanted to do this you should probably use ~/.bash_profile or ~/.profile)
There are many ways of running a script on boot (depending on what you want to do).
Often rc.local is used, ...
The value 1437495737 is in hex 55ae71b9, or in little endian notation b9 71 ae 55 while the integers 185 113 174 85 are in hex also b9 71 ae 55.
So you get the same value, just in different representation.
You should switch to Ubuntu Mate for Raspberry Pi
I used the recommended version for ARMv7, though Raspi3 has actually a ARMv8 processor. Ubuntu has, compared to Raspbian, a newer version of Python3 as part of the system.
I had to fiddle with the config file a little bit, offset and stuff. Make sure you have the right keyboard layout before changing the ...
My guess is the init level may not be set high enough yet for an X session. You might add a sleep 120 to the cron and possibly a nohup:
@reboot sleep 120;nohup /bin/sh /home/pi/bbt/launcher.sh >/home/pi/logs/cronlog 2>&1
(edit: I also fully qualified the /bin/sh but I doubt that's the issue)
You can't run something at startup that should open a window, because the X Server is not yet available.
Additionally, cron jobs don't normally have access to the X Server.
However, it is possible to connect to the X Server if you prepare the correct environment.
Normally, what you need are the DISPLAY, XAUTHORITY and XAUTHLOCALHOSTNAME variables. To ...
So im not sure how i die it i dltried all the answers but then suddently found the Damm fplder n the USB flasgdrivwle without ever moving it there cause i never fpund it somewhere else idk Programms ngbis magic but THX for all the help
manage 50 Raspberry Pis remotely, The RPis are behind a router, so I can't access them by IP.
I manage less them 50, and wouldn't go the VNC route. 50x the whole process you described above just seems daunting, and lots of work/lost time, and then you haven't even started doing what you came for.....
Look into automatisation. Chef would be a nice solution ...
There are several ways to wait until the system clock is synchronized with time servers after boot up. You can prepend a check in a loop to your script that will test with timedatectl and sleep if the the clock is synchronized. If you do that it is important to run the script in the background as service until it terminates successful.
You can also try to ...
As I understand you just want want a remote controllable Raspberry Pi via screen without port forwarding or any other stuff to setup. (Correct me if I am wrong or something is missing!)
Personally I am using Anydesk for remote controlling my RPI 3b+ it is free for personal use and you can set your own restrictions on who can connect and or set a password.
Convert linux C++ printer program to Rpi python
The slightly tricky part is that Rpi has no write 8 bit port function.
So we need to DIY our own virtual 8 bit port by abstracting 8 GPIO
pins as one fake 8 bit port. We can then write a fake write fake 8
bit port function, ...
Centronics/Parallel Port Printer Cable - ...
Run [bash/python] automatically at startup, timestamp is wrong, ...
Or you can try the python datetime thing.
The OP says the following:
It works fine if I run the bash script manually through the command
line, but if I allow it to run automatically at startup, the
timestamps for files and archives are ...
When the Pi boots it has no time reference.
Raspbian (default installation) will restore the time from the last saved by fake-hwclock, which should be within 1 hour of the time os shutdown.
Depending on how you run the script it should use this saved time until synchronised by NTP.
You could install a RTC or write a systemd service which waits for ...
You are aware the Pi has no built-in real time clock?
You either have to buy an RTC module for the Pi (DS3232 based preferred) or have to start your script after the Pi has got a valid time through NTP, from your Internet router for example.
I would use Python, basically loop continually, checking for button press and time to display information. If the button is pressed record the 'lastPress' datetime. If the 'timeToDisplay' is reached then calculate the days.
import RPi.GPIO as GPIO
buttonBCMPin = 16
Finally I was able to find a solution. I used the example 2 from this post posted in Arduino forum https://forum.arduino.cc/index.php?topic=396450.0. I have edited python code also.
// Example 2 - Receive with an end-marker
const byte numChars = 32;
char receivedChars[numChars]; // an array to store the received data
boolean newData = ...
I still had this problem today.
I've found an easy way to change the swap size:
Stop the swap using sudo dphys-swapfile swapoff
Edit /etc/dphys-swapfile as root using sudo nano /etc/dphys-swapfile
Find in the file the row containing CONF_SWAPSIZE and change the swap size to what you prefer, I have used CONF_SWAPSIZE=1024
Start the swap again using sudo ...
No, it's not possible to install PyCharm on a Raspberry Pi. The armhf error means that the RPi hardware (processor) is not supported by PyCharm.
However: PyCharm does support remote development (after a fashion) on the RPi, but you will have to install PyCharm on a system that runs on supported hardware (e.g. Intel). PyCharm/JetBrains has a tutorial (...
As shown in the error log there seems to be a general problem with updates. Before trying anything else with python you should fix your update. You only do an sudo apt-get upgrade. Before doing it you should update the packages lists. So first try to do:
rpi ~$ sudo apt update
rpi ~$ sudo apt full-upgrade
and reboot. You should now have an up to date ...
Another way i do it is with OpenCv, you can also modify images with OpenCv such as draw images,
import numpy as np
from PIL import Image
def cv2_to_pil(img): #Since you want to be able to use Pillow (PIL)
return Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
return cv2.cvtColor(np.array(img), cv2....
Read 2 thermal couples and 1 pressure gauge using Rpi
Record data and send it to server
A better way to do this?
I skimmed the datasheet of your thermal sensor, pressure sensor, and current loop receiver module. My first impression is that they are all mission critical, industrial equipment.
Electrical characteristics of 3 ...
If you look at e.g. 4 min 27s on the video you will see he is using Remote Desktop Connection to an IP address.
You need to set up Remote Desktop Protocol (RDP) on the Pi, then use an RDP client on the computer - not sure if he's using Windows or Mac. Other types of remote desktop software with other protocols are available. This guide discusses first VNC (...
With systemd you can check the state of a service, e.g. with:
rpi ~$ systemctl is-active minecraft.service
Of course, I don't have Minecraft installed on my RasPi. You can call this command within your Python3 script. But this will waste resources because you have to poll the state in an endless loop. I would suggest to let the service itself ...
You didn't tell us if you'd tried anything, and so I'll assume that you haven't. If that's the case, I'd suggest you take a look at this answer from Stack Overflow SE. In a nutshell, it suggests that you use David Beazley's Generator Tricks for Python, but the code is actually on Beazley's GitHub page. I think the specific code you'll need is this one
Found the answer following this tutorial.
It worked after removing the line: 'console=serial0,115200', in the cmdline.txt like bellow:
$ sudo nano /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes root wait
You can't use 5 V relay with signal from Raspberry Pi while Raspberry Pi signal is 3.3 V.
So if you used Logic level converter to convert 3.3 V from Raspberry to 5 V then to relay in I think it may solve this issue.
I don't know why most distributors say it should work with raspberry pi while the ideal one for Raspberry Pi is 3.3 ...
Why are you calling
os.system("sudo systemctl stop serial-getty@ttyS0.service")
os.system("sudo systemctl stop email@example.com")
These are the same interface, and if you aren't using serial console it is better to disable (using raspi-config) then there is no need for sudo.
There is no need to use sudo with /dev/serial0 provided the user is a ...
It worked with the following steps:
DigiMeshDevice instead of XBeeDevice
from digi.xbee.devices import DigiMeshDevice, RemoteXBeeDevice
from digi.xbee.models.address import XBee64BitAddress
os.system("sudo systemctl stop serial-getty@ttyS0.service")
# Instantiane an XBee device object
device = DigiMeshDevice('/dev/ttyS0',...