I have a small problem with the python library of BLYNK: I need to set the properties of an appbutton with
blynk.set_property("G20", "offBackColor", "#000000")
It only works with
blynk.set_property("20", "offBackColor""#000000")
with a virtual pin. I followed some tutorials from github, pypi and their own tutorials but nothing worked.
I use Python3 and a raspberry pi 4
Related
I am working on my first Raspberry Pi project while following a course for creating a line-following robot. This is the course. I followed all the instructions and connected the pins as it describes but when I run the code on the Raspberry Pi OS it throws an error:
gpiozero.exc.PinPWMUnsupported: PWM is not supported on pin GPIO7
This is the code:
from gpiozero import Robot
from time import sleep
my_robot = Robot(left=(7,8), right=(9,10))
my_robot.forward()
sleep(1)
my_robot.stop()
I tried to search for solutions and checked the official documentation but it hasn't been helpful. How can I fix this?
The likely reason for this error is that the user has installed gpiozero into a virtual environment without installing a pin library. gpiozero's built-in pin interface does not support PWM. You need to install RPi.GPIO to get the normal experience:
pip install gpiozero rpi-gpio
This is mentioned in the docs: https://gpiozero.readthedocs.io/en/stable/faq.html#why-do-i-get-pinfactoryfallback-warnings-when-i-import-gpiozero
I had the same problem with gpiozero's CamJamKitRobot and Robot classes when trying to run it in a pipenv (same issue may occur with a virtual env, but I have not tried). Running the script outside of the pipenv (therefore just using the system installed pip packages) resolved the issue for me.
After many checks, it resulted that the GPIO pins and the software were ok. The motors were connected to a L289N Driver Motor module, which wasn't getting enough power from the batteries and this was the cause of the error. In case someone has the same or similar hardware connections and faces this issue, check if the L289N module is powered on (it should turn on the red LED that's on the module).
I was following the guide on https://www.raspberrypi-spy.co.uk/2018/02/basic-servo-use-with-the-raspberry-pi/ with Micro Servo WS-SG90 and Raspberry Pi 3B+ and used the gpiozero Python library and ran into the same exception. In my case this was caused by running the program as non-root user. Running the program with sudo made the servo turn. The other alternative would be to use PiGPIOFactory with pigpiod which does not require to run the program with elevated privileges.
I have created an app that displays rtsp streams in Kivy grid view. It works just fine on my computer, but when I deploy it to another PC everything works up until the video needs to be playing in the grid (i just get white squares in the lower left of the tile). I strongly feel that there is a package I need to download that Kivy Documentation does not mention.
I have pip installed all kivy dependencies, Cython, and Pillow on the other PC.
I would like to see video in each block as I do on the PC that I built the app on
No RTSP Stream Coming Through
***Update: (On the other PC (mini PC)) I uninstalled Python 3.7.3, reinstalled it, installed kivy in the proper order according to their install for windows documentation, and installed Cython. This got it working but now some the text is missing in the app. Also, I am getting multiple .dll errors (libopus-0.dll and libgstopus.dll) I tried removing gstreamer from the python share folder and that got it back to just showing white boxes.
Odroid running Ubuntu Mate 16.04 and ROS Kinetic. I have wiringPi2 installed for accessing the GPIO pins. I am able to use the GPIO pins through a Python script, but they require sudo access. I have a ROS node (written in Python) in which I want to access the GPIO pin data and publish to a topic. But, I am not able to do so, because wiringPi2 required sudo access, and ROS is not defined in root.
I have tried using wiringPiSetupSys() function which does not require sudo access, but that does not work i.e. I am not able to get the GPIO pin data without sudo access.
All the solutions to similar problems for Raspberry Pi platform don't seem to work for Odroid.
Thanks
Unfortunately, I could not find a fix to the problem with the exact specifications mentioned. However, when I tested the same code on a Raspberry Pi 3 with Raspbian, it works correctly.
So, I have concluded that the issue lies in the OS used i.e. Ubuntu Mate 16.04.
So, a solution might be to use Raspbian on Odroid itself. I am yet to test whether that works out.
Update : Raspbian doesn't exist as such for Odroid, so some other work around might be required.
I'm trying to connect raspberry pi with MatLab. I use the toolbox within matlab to configure raspberry pi. It automatically connects through network however it also gives you OS within that setup procedure, you can't connect to raspberry pi without it. Although the system it gives is technically Raspbian Jessie it comes with limited package.
When it launches and I input dir into console it only shows files such as: satkin_ws install ros_indigo.sh install_ros_package.sh and ros_catkin_ws. No other folders or files are pre-loaded onto the system. I tried to install some packages for display manager such as gdm3 and lightdm but I still have a problem with loading desktop environment. Can someone give me suggestions on how to resolve this issue?
Alright after doing some research I found that the system installed by Matlab is Raspbian Jessie Lite which does not come with GUI/Desktop environment by default but you can install it you want. Here is the link to get you going:
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691
I'm really not familiar with make. So I don't understand the meaning of those steps in 2 tutorials ("TensorFlow Makefile" and "TensorFlow Raspberry Pi Examples") to make my project on laptop work on raspberry pi 2
TensorFlow Makefile:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile
TensorFlow Raspberry Pi Examples:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/pi_examples
As far as i know,"TensorFlow Makefile" will convert the tensorflow source,lib to executable file. "TensorFlow Raspberry Pi Examples" means convert your project to executable file then run the file in your_project/gen/bin/your_project
tensorflow/contrib/pi_examples/label_image/gen/bin/label_image
Hence,if I have a project on my laptop and want to load my project into Pi 2 ("TensorFlow Makefile" is already done). I just copy it to my pi 2 and do :
make -f tensorflow/my_project/Makefile
then run :
tensorflow/my_project/gen/bin/my_project
This is how to make your project work on raspberry pi 2, right ?
This will only work for Makefiles which have the option to cross-compile from a (presumably) x86(_64?)-architecture laptop to an ARM-architecture Raspberry Pi.
You're in luck, though: Google's included options in TensorFlow's Makefile to cross-compile between architectures!
If you look at line 123 of the Makefile, you'll see a comment about this.
Default to running on the same system we're compiling on.
You should override TARGET on the command line if you're cross-compiling, e.g.
make -f tensorflow/contrib/makefile/Makefile TARGET=ANDROID
So, simply make the project like so:
$ make -f tensorflow/contrib/makefile/Makefile TARGET=PI
This will compile TensorFlow for the RPi.
Incidentally, if you can, it may be easier to simply compile TensorFlow on the RPi by either pulling the sources from git or transferring it onto the RPi via USB, and building there.