Go to advanced search

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

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: 214

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: 214

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: 214

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: 119

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: 184

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: 241

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: 184

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: 96

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: 548

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: 548

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: 154

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: 548

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: 548

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: 548

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: 191

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: 126

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: 128

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: 251

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: 161

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...
by MrYsLab
Thu Aug 08, 2019 2:13 pm
Forum: Python
Topic: How to using a value from spinbox
Replies: 3
Views: 125

Re: How to using a value from spinbox

The value returned from spinbox is a string. To convert the string to an integer use int(). For example if the value returned is "4", and stored in a variable called x to convert :

Code: Select all

value = int(x)
by MrYsLab
Wed Aug 07, 2019 4:20 pm
Forum: Python
Topic: How to using a value from spinbox
Replies: 4
Views: 165

Re: How to using a value from spinbox

In general, one of the main reasons to use a class is that allows one to avoid using globals and organizes the code so that it is easier to read and debug. Therefore, I have reformatted your script as follows. It should now function properly. from tkinter import * import tkinter as tk import time cl...
by MrYsLab
Tue Aug 06, 2019 9:57 pm
Forum: Python
Topic: Pygame event type
Replies: 2
Views: 109

Re: Pygame event type

In the future, please use code tags to maintain formatting. I am not sure this is what you tried to post or not, but the code definitely had some issues. import pygame pygame.init() continuer = True while continuer: for event in pygame.event.get(): if event.type == pygame.QUIT: continuer = False pyg...

Go to advanced search