Go to advanced search

by MrYsLab
Thu Feb 28, 2019 2:22 pm
Forum: Python
Topic: Raspberry Pi Overlay Problems
Replies: 1
Views: 132

Re: Raspberry Pi Overlay Problems

I have found that pyimagesearch is an excellent source for information. Here is an article "Install OpenCV 4 on your Raspberry Pi", https://www.pyimagesearch.com/2018/09/26/install-opencv-4-on-your-raspberry-pi/ , that may provide most of what you are looking for. The author, Adrian Rosebrock, has w...
by MrYsLab
Wed Feb 27, 2019 3:29 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

There may be easier ways to do this, but I here is what I would do. On a spare SD card install the full Raspbian OS. Boot your Pi with the new OS. Place your old SD card (the one with the problems) into an SD reader and then plug the reader into your Raspberry pi. You will probably see an "Error Ope...
by MrYsLab
Tue Feb 26, 2019 10:54 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

Adding or removing that line should not affect how the GUI works. If you install a new OS, you will wipe out everything and you will need to reload your files.
by MrYsLab
Tue Feb 26, 2019 9:45 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

If you are not using tkinter for your application, all you need do to start your program from startup is change xx.py to whatever you are calling your program.

Code: Select all

@lxterminal -e python3 /home/pi/xx.py
If you are using python2, change python3 to python.
by MrYsLab
Tue Feb 26, 2019 9:17 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

Looks like the image you have does not contain tkinter. The image that I know works is " Raspbian Stretch with desktop and recommended software"
https://www.raspberrypi.org/downloads/raspbian/
by MrYsLab
Tue Feb 26, 2019 9:10 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

To make sure you have tkinter installed, open a command window, type python3 and then enter import tkinter in the repl. [email protected]:~ $ python3 Python 3.4.9 (default, Feb 25 2019, 08:31:38) [GCC 6.3.0 20170516] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ...
by MrYsLab
Tue Feb 26, 2019 8:58 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

Are you running the full version of Raspbian? If yes, can you create a simple tk GUI and run it successfully?
by MrYsLab
Tue Feb 26, 2019 8:07 pm
Forum: Python
Topic: Using Nuitka compiler on RPi3B+ Stretch
Replies: 5
Views: 466

Re: Using Nuitka compiler on RPi3B+ Stretch

Without any detail, it is difficult to tell what the OP is actually asking. Does something simple work in their environment or is it their specific application causing their issues? If the simple example works, then without providing any code, answering the question of what went wrong, IMHO is impos...
by MrYsLab
Tue Feb 26, 2019 8:02 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

If you run the xx.py from a terminal, do you see a small Tkinter window? That should be what you should see plus the lxterminal as a result of the autostart. It is a very small GUI window.

When you edited out the lxterminal line from startup, are you sure you saved the file?
by MrYsLab
Tue Feb 26, 2019 5:40 pm
Forum: Python
Topic: Using Nuitka compiler on RPi3B+ Stretch
Replies: 5
Views: 466

Re: Using Nuitka compiler on RPi3B+ Stretch

I just installed by doing the following:
1. sudo apt-get install nuitka
2. sudo pip install nuitka

I then followed the build and run instructions here:http://www.nuitka.net/doc/user-manual.h ... -and-testa

It built and ran for me.
by MrYsLab
Tue Feb 26, 2019 4:45 pm
Forum: Python
Topic: Python GUI application reset-button and run at startup
Replies: 13
Views: 498

Re: Python GUI application reset-button and run at startup

Answering question #2 first, as @B.Goode pointed out in this topic: https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=234038 , you need to be running the full version of Raspbian to for a GUI to work. I am assuming you already are. If you look for my post within that topic I provide a simple w...
by MrYsLab
Mon Feb 25, 2019 7:09 pm
Forum: Python
Topic: mosquitto subscriber -payload prefixed with a 'b'?
Replies: 2
Views: 264

Re: mosquitto subscriber -payload prefixed with a 'b'?

The payload is a byte string when receiving a message. You will need to decode it:

Code: Select all

print(msg.topic+" message payload is {}".format(message.payload.decode("utf-8")))
by MrYsLab
Mon Feb 25, 2019 2:05 pm
Forum: Python
Topic: AdaFruit Ultimate GPS Python Code Error
Replies: 18
Views: 1178

Re: AdaFruit Ultimate GPS Python Code Error

The Adafruit page, IMHO, is a little overwhelming for someone who is new to RPi and Python. I need to compliment you for not giving up. Looking at the Adafruit page here is what is said: If you want to use the built-in UART, you'll need to disable the serial console and enable the serial port hardwa...
by MrYsLab
Mon Feb 25, 2019 1:50 pm
Forum: Python
Topic: Python 3.5 and 3.4 tkinter issue
Replies: 6
Views: 612

Re: Python 3.5 and 3.4 tkinter issue

I should have asked this before - how exactly did you install 3.4? I just installed 3.4 on my Pi using the instructions here: https://mryslab.github.io/pymata-express/python_3_7.install/ - just scroll down the page and look for "Linux Users". For steps 11, 12 and 13 substitute 3.4.9 for 3.7.2. After...
by MrYsLab
Mon Feb 25, 2019 1:04 pm
Forum: Python
Topic: Catch desktop's audio
Replies: 7
Views: 537

Re: Catch desktop's audio

Grabbing the PWM audio is discussed here: https://www.raspberrypi.org/forums/view ... 09#p610955
by MrYsLab
Sun Feb 24, 2019 10:20 pm
Forum: Python
Topic: RFID reader project - need a way to connect to WIFI on start up
Replies: 2
Views: 325

Re: RFID reader project - need a way to connect to WIFI on start up

Rereading my answer, I just realized if you are not connected to the network, you won't be able to ssh into the RPi. You can set the RPi as an AP and instructions are here: https://raspberrypi.stackexchange.com/questions/63411/raspberry-pi-3-model-b-access-point . I never tried doing that myself so ...
by MrYsLab
Sun Feb 24, 2019 10:13 pm
Forum: Python
Topic: RFID reader project - need a way to connect to WIFI on start up
Replies: 2
Views: 325

Re: RFID reader project - need a way to connect to WIFI on start up

Could you simply log into the headless RPi using SSH, then go to raspi-config to set the SSID and password for the network? If you need to wait for wifi to be up and running before your application is auto-started, it appears that raspi-config can help here also. Here is a link that describes that: ...
by MrYsLab
Sun Feb 24, 2019 10:06 pm
Forum: Python
Topic: AdaFruit Ultimate GPS Python Code Error
Replies: 18
Views: 1178

Re: AdaFruit Ultimate GPS Python Code Error

In gps_simpletest.py you can try changing: # Define RX and TX pins for the board's serial port connected to the GPS. # These are the defaults you should use for the GPS FeatherWing. # For other boards set RX = GPS module TX, and TX = GPS module RX pins. RX = board.RX TX = board.TX To # Define RX and...
by MrYsLab
Sun Feb 24, 2019 9:59 pm
Forum: Python
Topic: Catch desktop's audio
Replies: 7
Views: 537

Re: Catch desktop's audio

I may be missing something here, so please forgive my ignorance. Again, you state that you are taking sound out of the RPi and feeding that into an analog input pin of an Arduino. The RPi has no capability to process an analog signal. You need to first feed that analog signal into an external Analog...
by MrYsLab
Sun Feb 24, 2019 9:44 pm
Forum: Python
Topic: AdaFruit Ultimate GPS Python Code Error
Replies: 18
Views: 1178

Re: AdaFruit Ultimate GPS Python Code Error

Glancing at the Adafruit files on Github, I believe board.py is defined here: https://github.com/adafruit/Adafruit_Blinka/blob/master/src/board.py The RPi pinout is imported here: https://github.com/adafruit/Adafruit_Blinka/blob/e54aad88cc8742f94436b9958e10e6bb1258e0f8/src/board.py#L46 Looking at ht...
by MrYsLab
Sun Feb 24, 2019 3:28 pm
Forum: Python
Topic: Catch desktop's audio
Replies: 7
Views: 537

Re: Catch desktop's audio

It appears you are using a device that provides analog data to the Arduino. You can easily add analog support to the RPi. I have used this module https://smile.amazon.com/gp/product/B00BXX4UWC/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 with the example for the device supplied pigpio http://aby...
by MrYsLab
Sun Feb 24, 2019 3:22 pm
Forum: Python
Topic: AdaFruit Ultimate GPS Python Code Error
Replies: 18
Views: 1178

Re: AdaFruit Ultimate GPS Python Code Error

Did you follow the installation instructions? https://learn.adafruit.com/adafruit-ult ... on-parsing

If you are still having issues, I suggest you contact Adafruit customer service.
by MrYsLab
Sun Feb 24, 2019 12:17 am
Forum: Python
Topic: Python 3.5 and 3.4 tkinter issue
Replies: 6
Views: 612

Re: Python 3.5 and 3.4 tkinter issue

To see where python is searching for modules, open a terminal and type: python3 -c "import sys; print('\n'.join(sys.path))" For a specific version of python: python3 .5 -c "import sys; print('\n'.join(sys.path))" or python3.4 -c "import sys; print('\n'.join(sys.path))" You can affect the path by set...
by MrYsLab
Sat Feb 23, 2019 11:53 pm
Forum: Python
Topic: serial
Replies: 2
Views: 319

Re: serial

I may be wrong here, but I think serial0 defaults to 115200 and not 9600 baud. I believe you can set the baud rate in /boot/cmdline.txt

Also, be aware that a read in pyserial returns a byte and not a character, so you will probably have to call .decode().
by MrYsLab
Sat Feb 23, 2019 11:19 pm
Forum: Python
Topic: _tkinter.TclError: no display name and no $DISPLAY environment variable
Replies: 9
Views: 1219

Re: _tkinter.TclError: no display name and no $DISPLAY environment variable

You don't explain how you are doing the autostart. The problem is that whatever you are doing when your program starts, the xwindow system has not yet initialized and you get that error. One way of doing this is to modify the /home/pi/.config/lxsession/LXDE-pi/autostart file to start the program. I ...

Go to advanced search