The link to the tutorial you gave seems to be broken but I'm guessing it's this one while searching for that tutorial I also found this which has some additional information. First you need to determine how many half steps your motor takes to execute a full 360. From the second link you can see that the datasheet for the 288yj-48 stepper seems to indicate ...
this does not works for me but this works
block = bus.read_i2c_block_data(address, 1) #second arg is 'cmd'. It is andatory but not used in this case. It may be used by the higher level protocol
You can also implement an i2c scan with the Adafruit Blinka library:
devices = 
for x in range(0x08, 0x79):
result = bytearray(1)
i2c = busio.I2C(...
Remove your GPIO.cleanup() lines, this would normally only be called before you exit a program.
At the end any program, it is good practice to clean up any resources
you might have used. This is no different with RPi.GPIO. By returning
all channels you have used back to ...
Actually that's cd $PLATYPUSH_SRC_DIR, the $ is significant (used to indicate an environment variable).
But using that is unlikely to make a difference as it is probably not set. It looks like it is referring to the toplevel directory of the source you presumably downloaded or git cloned.
On the Pi, you have to bind the socket to an IP address of one of the Pi's interfaces. You cannot bind it to the PC's IP address.
If you want the socket to accept connections from all of the Pi's interfaces, you can use the IP address 0.0.0.0 (or :: in IPv6).
On the PC, the server IP should be an IP address that the Pi is bound to.
Let's say the Pi is ...
There are some things with output redirection, path environment variable, directory back and forth, which make things a bit confusing. In addition it isn't defined when the cron job is executed. It is possible that it already runs when the WiFi isn't available. To manage all this in a clean way you should use systemd. You can create a new service for it with ...
Well if it’s tight you want:
def begin_time(time = 5):
begin.when_pressed = begin_time
Personally, I find this easier to understand than the more pythonic lambda :-) but have to say the lambda version has more flexibility for changing the value.
You can create a function that takes no parameters:
begin.when_pressed = begin_time_5
This is called "currying".
Alternatively, use a lambda:
begin.when_pressed = lambda: begin_time(5)
If you are using the full resolution and a high frame rate, it is very likely that the processor and/or memory is getting exhausted (depending on what kind of processing you are doing). So, yes, lowering the camera resolution may solve the problem.
You do not say what programming language you are using. In python you can change the resolution like this:
A lot depends on what you want the program to do while waiting for the button to be pressed. Button abilities here
You could try (untested code though):
from gpiozero import Button
begin = Button(27)
# Loop doing nothing till the button is pressed
while being.is_held == False:
How can Rpi python read a SPI MFRC255 RFID/NFC tag?
Part 1 - Introduction to I2C and SPI NFC/RFID Chips and Modules
Part 2 - Setting up SPI MFRC522 Module
Part 3 - Troubleshooting SPI Software and Hardware using Loopback
Part 4 - Using Rpi4B buster Python 3 and Mfrc522 library to read NFC Tag
I have successfully installed ...
One advantage of VNC is that you do not need to open any ports in the firewall to control the Pi. A lot of companies are loathe for Pi boards to be installed on the LAN for this reason and often restrict access to the VNC cloud services because fo this (see NASA for why using a PI like this is a very bad idea).
With the free version of VNC the only way ...
Well, this should be asked into IoT and maybe they'll tell you to ask into Electronics. With rpis being catch-all wizards I guess I'll drop you a line anyway.
Does mac tx and radio tx commands are used for same purpose?
Absolutely not. It's better to start from the raw radio tx.
Look at the example:
radio tx 48656c6C6F
// Transmits a packet of [0x48][...
Nowadays modern Linux distributions, including Raspbian, use systemd instead of old style SysV as init system. For downstream compatibility SysV is only emulated by systemd but will lose support more and more by time so
you should not use SysV anymore, in particular /etc/rc.local!
For more information about this have a look at Compatibility ...
I duplicated what you did using an up-to-date Raspbian Buster in a Pi 4 B. (I wish all questions were as clear and complete as yours!)
Double-clicking the file on my machine brought up the thonny IDE. (Note: The 'any' key doesn't work because input() needs an enter to complete.) On reboot, I observed the same result you did. However, installing xterm ...
If you don't care about execution time, increasing your swap size from 100MB to a couple of GB will triple the amount of available memory. Projecting your current code efficiency (1 GB or RAM needed to process 16 MB of data), you should be able to process up to 48 MB of data at once.
sudo dphys-swapfile swapoff
echo 'CONF_SWAPSIZE=2048'|sudo tee /etc/dphys-...
Without connection details this is unanswerable.
If you are trying to use a single resistor in the common leg it is no wonder it is unreliable as each LED has a different voltage and only the lowest (usually Red) will work.
NOTE coloured LEDs often need >3V so won't work reliably on the Pi - you may need transistors.
PS running without a current limiting ...
Don't continually call the dutycycle function. You are probably resetting its function many times per second.
Try something like
if len(sys.argv) > 3:
# converteer de waarde 255 tot max 100 voor PWM.
roodwaarde = (int(sys.argv) * 100) / 255
groenwaarde = (int(sys.argv) * 100) / 255
blauwwaarde = (int(sys.argv) * ...
In your code, the return command is placed outside the get_distance function. The return command can only be used when it is in a function, so it returns the output of the function you specify. When you use return distance, you should keep it in the function or it won’t make any sense to Python. Right now, it ends with global start.
I'm running on a raspbian buster with Python 3.7.3. I ran into the same issue, "ERROR...no activation script". I tried @Lombax answer but it didn't work.
However, I noticed that the version of virtualenvwrapper I had installed was 5.0.0. I checked on PyPi and it's still at version 4.8.4. So I uninstalled virtualenv and virtualenvwrapper: sudo pip3 uninstall ...
I answered your question according to "what you expect to do".
Honestly, it's not a good idea to show the camera stream over a remote desktop tool like VNC. You should improve your code to stream the camera over the HTTP protocol to create an RTC connection. You could do it with the help of OpenCV on python.
Although, I suggest you install the motion ...
As you wrote in a comment you only want to start the web browser. Wrap it into a python script isn't needed. That's only an additional layer of execution and waste of resources. Just start the browser direct. Because we need a graphical environment try this service:
rpi ~$ sudo systemctl --force --full edit run-browser.service
In the empty editor insert ...
I am using X11 forwarding on the raspberry and putty on windows. This way you can see the display of the raspberry on your laptop. I haven't had issues with it. To set it up you need to enable ssh in raspi-config.
sudo nano /etc/ssh/sshd_config
and uncomment the line
install xming and putty on your laptop and set up putty under ...
You are not allowed to use commands in systemd services.:
The command to execute must be an absolute path name. Source: systemd.service
You should add the exact path of the command. You can find that by this command:
You would get the output as it:
Finally, use the output of which command to your systemd service.
You can do it if the device is the same. The point of a virtual environment is to be able to replicate it everywhere you need it.
Make a script that installs all necessary dependencies from a requirements.txt file and use it.
Use the command bellow to get the list of all python packages installed:
pip freeze > requirements.txt
Then install the ...
Web browsers work very hard to keep what happens within the browser from changing anything else on the computer running the browser. This is essential to maintaining security from malicious web sites.
One way of doing what you want is to run a small server on the Raspberry Pi and have the web page, also running in a browser on the Raspberry Pi, send a ...
I am also facing the same error. You must add these lines on ~/.profile