8

If you look in /usr/bin, there are actually only two versions installed: $ ls -la /usr/bin/python* lrwxrwxrwx 1 root root 9 Jun 5 23:08 /usr/bin/python -> python2.7 -rwxr-xr-x 1 root root 2679344 May 6 19:31 /usr/bin/python2.7 lrwxrwxrwx 1 root root 9 Aug 2 18:04 /usr/bin/python3 -> python3.2 lrwxrwxrwx 1 root root 11 Jul 6 09:52 /...


7

The command is: cat /proc/cpuinfo And the list over the different hardware is here: http://elinux.org/RPi_HardwareHistory#Board_Revision_History Table over hardware differences: https://www.element14.com/community/community/raspberry-pi/blog/2016/11/21/how-to-identify-which-model-of-the-raspberry-pi-you-have


6

There is NO NEED to do anything before a reboot. If you issue a sudo reboot command Linux will manage an orderly shutdown of the software. This is, however, a poor way of ensuring a reliable 24/7 system. If it crashes there is no guarantee the reboot itself would happen. The normal solution would be to use a watchdog timer. The Pi has an inbuilt hardware ...


6

Thats because by using 'GPIO.setmode(GPIO.BCM)' you are specifying the BCM numbering convention. GPIO 18 is actual pin number 12.


6

As is typical with crontab issues. The environment is not the same as your user or even a sudo/root shell , and env python3 may not return anything (env simply searches through Instead you should explicitly use the full path of python which can be found either as which python3 or which $(env python3) and use that full path in your crontab (typically /usr/...


5

You have to install the MySQLdb package: sudo apt-get update then sudo apt-get install python3-dev libmysqlclient-dev This took a while and finally: sudo pip3 install mysqlclient now it should work the following command: pi@raspberrypi:~ $ python3.5 Python 3.5.2 (default, Dec 15 2017, 15:32:37) [GCC 4.9.2] on linux Type "help", "copyright", "credits" ...


5

Neither thread is actually started. Instead of threading.Thread(target = thread1()) you should use threading.Thread(target = thread1) At the moment you are calling a function which never returns so subsequent lines of the script are not executed.


5

There are some benchmarks from Henner Zeller's repository on GitHub which claimed that directly outputting data to the GPIO could achieve up to 65.8 MHz on a Raspberry Pi 3 (not B+, mind, but I suspect the figures won't be that far off). The code used is available here in C and the author gives the following pseudocode equivalent: // Pseudocode for (;;) { ...


5

Your script is a typical use of a service. Usually a service is started once and then it is running in background until it is stopped by the service manager. The service manager can restart a script but it isn't made to be used for loops because it is working on system level with logging and dependency checking and all to manage services. So first you ...


4

According to docs.python.org os.popen() is stacked on top of subprocess.Popen() - at least for Python 3.x: This is implemented using subprocess.Popen; see that class’s documentation for more powerful ways to manage and communicate with subprocesses. So other than losing some of the more finegrained controls the underlying subprocess.Popen() provides ...


4

It's worth noting that rc.local is run by root, rather than the pi user which you are likely using at your terminal. It seems likely that your installation for the telepot module is installed only for the pi user, and hence when root runs the script, the module cannot be found. If this is the case, you have two options: Install the telepot module globally ...


4

From the error log, it seems to be an issue with the SSL protocol being used: File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1149, in _raise_ssl_error raise WantReadError() OpenSSL.SSL.WantReadError This seems to be related to the recent blackout in supporting TLS 1.0 and 1.1 for pip. See this answer for details. In summary, upgrade pip as ...


4

This error was resolved when I disconnected and reconnected my camera module. Somehow my camera module must have been wiggled loose when I was working with it and the Pi was not able to detect the camera. I ran the command: vcgencmd get_camera and got Returned supported=1 detected=0 Once the camera was reconnected, I was able to run raspistill -o image....


4

It says "Cannot open shared object". ImportError:libQTtest.so.4:cannot open shared object file:no such file or directory Yes, but it does not say this is because "the library isnt shared with it". What it says is, "no such file or directory". As far as I can tell, libQTtest.so.4 is not actually part of openCV, although it is part of a GUI framework ...


4

python is never Python 3 in Debian, even if you have installed Python 3. Python 3 will install as python3, and the python binary points to Python 2 (see PEP 394) instead. In Python 2, the socketserver module used to be called SocketServer (note the caps). Changing all references from socketserver to SocketServer would address that. You can solve this by ...


4

Building scipy from source takes about 1hr20. Pre-compiled wheels are available from piwheels.org, so you can install it from there without building yourself. Raspbian Stretch is pre-configured to use piwheels. Are you on an older Raspbian version or another distribution? See piwheels.org for info on how to configure your system to use it or try: sudo pip3 ...


4

Your tag says python3. If you are running your code in python3 you need to install speechrecognition with pip3.


4

From Sparkfun website: The three methods covered in this tutorial are: rc.local - Likely the easiest and simplest way to get your program to run on boot. The downside is that tasks started with rc.local happen before the X windows system starts, which means you will not have access to graphical user interface (GUI) elements. autostart - Used to ...


4

You can launch a terminal via a command; this should include an option to execute a command inside the terminal as well. There are various GUI terminal applications available on GNU/Linux. They are usually paired with the DE (desktop environment). The default DE on Raspbian ("the DE formerly known as PIXEL", for lack of a better name1) is derived from ...


3

Arguments given to Python's subprocess and friends are generally not allowed to have spaces. omx = run(["omxplayer", '--win', '1,1,500,400', videoPath]) The above should work. In this instance, single or double quotes don't matter. Make sure to have '--win' and the geometry specification next to each other in the correct order.


3

You have not told us which system you use so it is speculation as to whether you will have problems or not. I believe Debian based systems use Python 2 for system purposes.


3

The code you use has the standard errors for this algorithm. It assumes everything always works perfectly without error. As a programming exercise you need to think about under what conditions the while loops would not terminate. You then need to protect against those conditions. The code you linked has added protection in one loop but not the other. It ...


3

Python 3 is a backward incompatible upgrade of the language. As already mentioned, so much was changed, that most programs won't work on Python 3 without modifications. Even worse, many Python libraries are not compatible with Python 3 yet. This is why at least two versions are needed - legacy Python 2.x and new Python 3.x. This is exactly what you have on ...


3

WIFI Configuration Before Complete Boot-up Of Pi You cannot usefully do anything network related before the Pi boots up properly. I think you have just misconstrued the concept of "booting", and what you really mean is you want the Pi to boot up the first time in a state where the goal is to get a wifi configuration somehow. Kind of like when you buy an ...


3

No, it is not necessary to stop the Pi camera before rebooting.


3

No there is no need to stop the camera before reboot. Also preforming killall python is not doing you any good as the reboot is going to force the program to close anyway. If you are worried about your program needing to shutdown gracefully, you should notify the program to shutdown rather then kill it. A simple way would be to use touch in your crontab ...


3

In Python 3 print is a function. In Python 2 you could do print "hello". In Python 3 you must do print("hello").


3

Python installations generally do not share modules between them. Modules installed for Python 2 will not be shared with the Python 3 installation (they are stored in different locations, etc). At least for now, python and pip refer to the Python 2 versions of the toolchain. As such, most Python tools have a Python 3 equivalent. If you used sudo pip ...


3

If you read the documentation, there are two mistakes in your code. First, just use import l293d. Second, use motor1 = l293d.DC(22, 18, 16) There isn't a motor attribute, but there is a DC attribute for DC motors. This runs on my system. jay@gotham:~/python$ python3 test.py [l293d]: Can't import RPi.GPIO; test mode has been enabled: http://l293d.rtfd.io/...


3

Since this used to work, I suspect that something is wrong with the wiring. My suggestion is that one or more of the wires has an intermittent fault. I would get a new set of wires, and replace the wires one-by-one until things start working again. Please do not reuse any of the old wires for this test. You will have to replace the wires while the Pi is ...


Only top voted, non community-wiki answers of a minimum length are eligible