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.
Related
I am aware it is possible to install PySide2 on Raspbian using the following command:
sudo apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic
However, this doesn't include QtWebEngine and I cannot seem to find a package like python3-pyside2.qtwebengine either. Same goes for PyQt5 which I could use alternatively, but it does not exist there either.
So my question is: Is there any way to run my Python application, which uses QtWebEngine, on my Raspberry Pi (Raspbian 10 "Buster")? Also I have 6 Pi's which need to run the application. So if the only solution is to build from source, is there a way to build on one machine and then distribute it to the others without recompiling?
Another consideration is to use QWebView instead of QWebEngineView because that seems to be available through QtWebKit at least for PyQt5 (package python3-pyqt5.qtwebkit). Would that work? Is it okay to work-around the issue despite the fact that QtWebKit is deprecated? Also I have the problem, that on my windows machine QtWebKit is NOT included within the PyQt5 package, nor does the seperate PyQtWebKit PyPl package work, so it would be hard to code/debug the tool as I would always have to move it to the raspi first... So however I put it, there is always something which is inconvinient...
So I finally found the solution myself. From what I understand, the reason you cannot find QtWebEngine in the Raspberry Pi OS repositories, is that the Pi OS is made to run on all Raspberry Pi's, including Pi 1 and Pi 2, which have an ARMv6 and ARMv7 CPU architecture respectively. The WebEngine module however is platform dependend and not tested, compiled and distributed for ARMv6/7 anymore, so they won't release it in the repositories for Raspberry Pi OS. Luckily though, the Raspberry Pi 3 that I use has ARMv8, so it is possible to install QtWebEngine from Debian repositories, which offer QtWebEngine for exactly that architecture. Here is how:
Open your sources.list file
sudo nano /etc/apt/source.list
Add the following line and save/close:
deb http://deb.debian.org/debian/ buster main
Now update your package list
sudo apt update
It is possible that you encounter some errors concerning missing public keys, which we will now validate through a keyserver:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
Note that the key 648ACFD622F3D138 was the first one to be shown in the error message from the previous step. It actually told me there were 3 missing keys, but dealing with the first one was sufficient to now update the package list once again and then being able to install the module finally.
sudo apt update
sudo apt-get install python3-pyside2.qtwebengine
I apparently don't have enough rep to comment. but editing the sources file above should be
sudo nano /etc/apt/sources.list
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
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'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
When I try to run a python script I get Illegal instruction and that's it, it doesn't give any more details so I have no idea what's going on, is there a way to find out what is causing the Illegal instruction error?
Also, I run the code using sudo I don't get any output, the program just exits.
UPDATE:
The script I'm running is the simple-agent script from bluez:
https://github.com/pauloborges/bluez/blob/master/test/simple-agent
Also, I ran line by line like #buratino said and I got the error in the second line:
from gi.repository import GObject
Like #Notlikethat said, the Illegal instruction error happens when the code being executed was compiled for a different architecture, Raspberry Pi uses ARM.
That said, I found out that GObject seemed to be causing the problem. Anyway, I uninstalled every bluetooth related package I had installed and reinstall them using the raspbian repository and now the Illegal instruction is gone and the script executes correctly.
Why did this happen? Well, I have a Raspberry Pi Zero which means I don't have an Ethernet port, before I bought a WiFi dongle I installed a few packages by downloading them on my computer and storing the .deb in the SD card, of course this means I have to manually check that I'm downloading the right version of the package, I must've messed up in one of them.
Lesson learned, never try to manually install packages, let apt-get do all the work!