Go to advanced search

by MrYsLab
Tue Nov 05, 2019 12:17 am
Forum: Python
Topic: Permanent Arduino usb address on RPi!
Replies: 3
Views: 564

Re: Permanent Arduino usb address on RPi!

I don't think you can assign a fixed device id, but what you can do is get a list of ports. The list will show the device manufacturer's name, and items such as the device's serial number. Here is a quick example of some code and its output. I have an Arduino Uno connected to ttyACM1: from serial.to...
by MrYsLab
Thu Oct 17, 2019 7:50 pm
Forum: Scratch
Topic: Scratch 3 For Arduino, RPi and ESP-8266 Released
Replies: 0
Views: 1129

Scratch 3 For Arduino, RPi and ESP-8266 Released

Find out how you can control your Raspberry Pi locally or remotely from your PC using Scratch 3. The User's Guide may be found here: https://mryslab.github.io/s3-extend/#. You can also control an Arduino Uno and ESP-8266 and have one microcontroller interacting with another.
by MrYsLab
Wed Oct 16, 2019 6:15 pm
Forum: Python
Topic: Thonny Options: Problem with Alternative interpreter or virtual environment
Replies: 3
Views: 641

Re: Thonny Options: Problem with Alternative interpreter or virtual environment

I am not sure why you are having problems. I created a directory called .python-virtual-environments and a virtual environment called .env. Here is part of its directory tree after activation: (.env) pi@RPi3BPlus:~ $ tree -a .python-virtual-environments .python-virtual-environments └── .env ├── bin ...
by MrYsLab
Tue Oct 15, 2019 9:52 pm
Forum: Python
Topic: Thonny Options: Problem with Alternative interpreter or virtual environment
Replies: 3
Views: 641

Re: Thonny Options: Problem with Alternative interpreter or virtual environment

Take a look at this article, I believe it provides what you are seeking. https://www.techcoil.com/blog/how-to-associate-a-python-3-virtual-environment-with-thonny/ I just tried it both with virtualenv and pyenv and it works for both. If you are interested in pyenv which allows you to manage and run ...
by MrYsLab
Thu Sep 26, 2019 3:25 pm
Forum: Python
Topic: VLC Get Frame For OpenCV
Replies: 1
Views: 200

Re: VLC Get Frame For OpenCV

by MrYsLab
Tue Sep 17, 2019 8:29 pm
Forum: Python
Topic: Problem Using Telnet and PIGPIO at the Same Time
Replies: 7
Views: 343

Re: Problem Using Telnet and PIGPIO at the Same Time

If you can, you need to find out the true cause of your issue. Are you entering a single command or entering a command immediately followed by another? If it is a single command, I have no clue. I sincerely doubt that it is an interaction between telnet and pigpiod, since they are using totally diff...
by MrYsLab
Mon Sep 16, 2019 12:46 pm
Forum: Python
Topic: Problem Using Telnet and PIGPIO at the Same Time
Replies: 7
Views: 343

Re: Problem Using Telnet and PIGPIO at the Same Time

Looking at the documentation for the Pi-Somfy project, I am assuming you are putting together the transmitter/oscillator as described. Are you able to use the original Pi-Somfy code with your hardware? If that works, then the radio/oscillator is not the problem. I did not check but are you using the...
by MrYsLab
Thu Sep 12, 2019 8:02 pm
Forum: Python
Topic: Problem Using Telnet and PIGPIO at the Same Time
Replies: 7
Views: 343

Re: Problem Using Telnet and PIGPIO at the Same Time

Have you tried using piscope http://abyz.me.uk/rpi/pigpio/piscope.html to monitor the gpio for output? If you are seeing the waveforms generated when you execute LutronInputSomPi.py, are the waveforms and timing correct? BTW here is a link in the forum on using piscope https://www.raspberrypi.org/fo...
by MrYsLab
Tue Sep 10, 2019 4:36 pm
Forum: Python
Topic: Problem Using Telnet and PIGPIO at the Same Time
Replies: 7
Views: 343

Re: Problem Using Telnet and PIGPIO at the Same Time

Sharing the code sounds like a good idea. If you are going to post it here, please use the "Code" tag as described on this link: https://www.raspberrypi.org/forums/view ... 32&t=84477
by MrYsLab
Wed Sep 04, 2019 6:31 pm
Forum: Python
Topic: How do I make this GUI button run 100 times?
Replies: 2
Views: 162

Re: How do I make this GUI button run 100 times?

Your document does not have public viewing permissions.
by MrYsLab
Mon Sep 02, 2019 10:26 pm
Forum: Python
Topic: Is this right? (accomodating a code)
Replies: 3
Views: 231

Re: Is this right? (accomodating a code)

Sorry, but I gave you a bad link. Here is the correct link: https://learn.adafruit.com/using-mcp23008-mcp23017-with-circuitpython/python-circuitpython#circuitpython-and-python-usage-2-12 The Adafruit library being used by the maxnox file seems to have been deprecated. https://github.com/adafruit/Ada...
by MrYsLab
Mon Sep 02, 2019 2:35 pm
Forum: Python
Topic: PyQt5 on Raspbian: Background color of QWidgets is not displayed
Replies: 7
Views: 605

Re: PyQt5 on Raspbian: Background color of QWidgets is not displayed

I am not sure if this will solve your issue or not, but take a look here: https://raspberrypi.stackexchange.com/ ... -to-libegl
by MrYsLab
Mon Sep 02, 2019 2:31 pm
Forum: Python
Topic: Is this right? (accomodating a code)
Replies: 3
Views: 231

Re: Is this right? (accomodating a code)

With just partial snippets of code, it is difficult to understand what your code actually does. Electing to use an i2c device for digital input instead of using simple GPIO input adds several levels of complexity to your code. If you really need to use mcp23017, take a look at this link: mcp23017
by MrYsLab
Mon Sep 02, 2019 2:20 pm
Forum: Python
Topic: PMS5003 Sensor Coding - second opinion please
Replies: 2
Views: 245

Re: PMS5003 Sensor Coding - second opinion please

I can't verify if your output is correct or not, but if you have an Arduino and can verify that its output is correct, you can do an A/B test with the RPi and compare results. I googled "PMS5003 python" and came up with lots of hits and one specifically for the RPi from Pimoroni: https://github.com/...
by MrYsLab
Fri Aug 30, 2019 2:45 pm
Forum: Python
Topic: Problem with closing the terminal processes
Replies: 19
Views: 1558

Re: Problem with closing the terminal processes

If you want an easy way to see all the process names mapped to pids, psutil can help. Here is an example: import psutil for proc in psutil.process_iter(attrs=['pid', 'name', 'username']): print(proc.info) It will place each entry into a dictionary. Here is a sample: {'username': 'afy', 'pid': 8950, ...
by MrYsLab
Fri Aug 30, 2019 1:59 pm
Forum: Python
Topic: Problem with closing the terminal processes
Replies: 19
Views: 1558

Re: Problem with closing the terminal processes

Try : ps -ft pts/0 Here is the output after opening several windows using Popen on my system pi@BanyanBot:~ $ ps -ft pts/0 UID PID PPID C STIME TTY TIME CMD pi 942 890 0 09:52 pts/0 00:00:00 bash pi 1028 942 2 09:53 pts/0 00:00:11 /usr/bin/python3 /usr/local/bin/bls -f exp1.csv pi 1029 1028 0 09:53 ...
by MrYsLab
Fri Aug 30, 2019 12:30 pm
Forum: Python
Topic: Python script crashes if it can't connect
Replies: 4
Views: 241

Re: Python script crashes if it can't connect

Take a look at this article on exceptions https://realpython.com/python-exceptions/ , especially the "The try and except Block: Handling Exceptions" section. Also, I do not see a signal handler or where you are setting up which signals to trap. This article may help with this https://pymotw.com/3/si...
by MrYsLab
Fri Aug 30, 2019 12:24 pm
Forum: Python
Topic: Problem with closing the terminal processes
Replies: 19
Views: 1558

Re: Problem with closing the terminal processes

Take a look at psutils https://psutil.readthedocs.io/en/latest/#processes. Perhaps there is something there that will help you solve your problem.
by MrYsLab
Fri Aug 30, 2019 7:59 am
Forum: Python
Topic: Problem with closing the terminal processes
Replies: 19
Views: 1558

Re: Problem with closing the terminal processes

This is long shot, but try adding an ampersand to each os.system call. Here is an example:

Code: Select all

                        os.system("mpg321 welcome.mp3 &")
This will put each job in the background.
by MrYsLab
Thu Aug 29, 2019 11:44 pm
Forum: Python
Topic: Problem with closing the terminal processes
Replies: 19
Views: 1558

Re: Problem with closing the terminal processes

Looking at the posted code, the first iteration of the while loop will set val to False and execute the os.system commands. Then for the next iteration, assuming that the user did not enter bye , the code finds the valid name, and since val is False, the next iteration of the while loop is started. ...
by MrYsLab
Wed Aug 28, 2019 6:49 pm
Forum: Python
Topic: Python development cycle
Replies: 1
Views: 462

Re: Python development cycle

If you are running a Buster version with GUI capabilities, you can run VNC to remotely access your RPi from your PC and then use something like Thonny or Mu as your IDE. If you are using a version of Buster without GUI capabilities, then PyCharm Pro https://www.jetbrains.com/pycharm/?fromMenu will a...
by MrYsLab
Wed Aug 28, 2019 12:41 pm
Forum: Python
Topic: Python Bluetooth module isnt functioning correctly
Replies: 1
Views: 441

Re: Python Bluetooth module isnt functioning correctly

Pairing is only half of the story, your phone also needs an application to connect to the RPi. If you would like to see an example of configuring the RPi for Bluetooth operation, please take a look at: https://mryslab.github.io/bots-in-pieces/banyan-bot-blue/bluetooth/bluetooth-test-server/2019/06/1...
by MrYsLab
Tue Aug 27, 2019 11:10 pm
Forum: Python
Topic: line follower using raspberry pi
Replies: 1
Views: 465

Re: line follower using raspberry pi

Please post the errors that you are getting. Without that information, it will be impossible to help. If you are simply asking how to run a program within thonny, click on the green RUN button.
by MrYsLab
Thu Aug 22, 2019 6:18 pm
Forum: Python
Topic: Confused by Global?
Replies: 4
Views: 598

Re: Confused by Global?

If you use a class instead of a collection of individual procedures, you can avoid the whole global mess. Here is a great turorial: https://realpython.com/python3-object-oriented-programming/ I took the liberty to convert your program using a class: class PlayTime: # a class variable x = 33 def __in...
by MrYsLab
Thu Aug 22, 2019 5:22 pm
Forum: Python
Topic: control a GPIO from bluetooth
Replies: 2
Views: 375

Re: control a GPIO from bluetooth

Your question is very broad. It is not clear if you are asking how an Android app automatically connects to a Bluetooth device in range, how do you use Bluetooth to control a GPIO pin or both. For the GPIO and Bluetooth question, you can check out my blog https://mryslab.github.io/bots-in-pieces/ind...

Go to advanced search