Go to advanced search

by Paeryn
Fri Jul 10, 2020 2:42 pm
Forum: Beginners
Topic: How to check Rpi4 memory available
Replies: 19
Views: 2044

Re: How to check Rpi4 memory available

Because you run a 32 bit OS perhaps? The 32-bit RPiOS should still see there is 8GB, the limitation is that only 4GB can be addressed by a process (3GB user accessible when you take in to account that the upper 1GB of the address space is reserved for the kernel). I haven't an 8GB to check if free ...
by Paeryn
Fri Jul 10, 2020 10:42 am
Forum: Python
Topic: Loop in guizero
Replies: 3
Views: 87

Re: Loop in guizero

I have added a screen and thought to take my python code across to a guy using guizero as I'm a beginner at python. Not sure how to convert my loop of the main function def main(): if writing == 1: twocolorled(1) now = datetime.now() id = recCounter() tempn = temp() mag = magnet() rad = readserial(...
by Paeryn
Fri Jul 10, 2020 9:51 am
Forum: OpenGLES
Topic: Clarification about glTexSubImage2D on legacy-driver
Replies: 4
Views: 136

Re: Clarification about glTexSubImage2D on legacy-driver

Yes you can use that, but your original post asked about doing a partial texture update with data from non-gpu allocated memory (which is what glTexSubImage2D() does). As far as I'm aware all EGL_images are gpu allocated and the texture will be the whole EGL_image.
by Paeryn
Thu Jul 09, 2020 10:56 pm
Forum: Beginners
Topic: How do I print a Python Program
Replies: 33
Views: 705

Re: How do I print a Python Program

Its not as if the pi cannot send colour because the Test Page that it did print out, has a colour logo on it. IDLE doesn't support printing in colour natively, it just sends the raw text file to the printer. There is an extension for it called idle2html that will "print" to an HTML file complete wi...
by Paeryn
Thu Jul 09, 2020 9:37 pm
Forum: Python
Topic: python how to stop getch() ?
Replies: 4
Views: 177

Re: python how to stop getch() ?

Hello everybody. I have wrote a program in python using getch() function to recieve inputs from user and I want to stop this input in specific times How can I achieve that? example => key_passwrd = getch.getch() Also , curses.endwin() works fine ,if I use this one: control = curses.initscr() curses...
by Paeryn
Thu Jul 09, 2020 7:35 pm
Forum: Beginners
Topic: How do I print a Python Program
Replies: 33
Views: 705

Re: How do I print a Python Program

I am trying unsuccessfully to print out the code of a Python3 program. I have followed the set up instructions for my Printer and I can print out the test page. I can also type some text into Libre Office and print that without problems. However, when I try to print a Python Program (which I think ...
by Paeryn
Thu Jul 09, 2020 11:54 am
Forum: OpenGLES
Topic: Clarification about glTexSubImage2D on legacy-driver
Replies: 4
Views: 136

Re: Clarification about glTexSubImage2D on legacy-driver

Hi, A question about glTexSubImage2D implementation: Is it possible that the raspberry pi 0 gpu legacy driver implementation performs a copy only of the pointer data (instead of an entire copy)? It seems reasonable since the memory is unified. Thanks, Alessandro I can't see any way of being able to...
by Paeryn
Wed Jul 08, 2020 6:07 pm
Forum: Python
Topic: Python loop help and if statement? help PLEASE
Replies: 21
Views: 375

Re: Python loop help and if statement? help PLEASE

It depends on how long these pulses last for, if they can appear and disappear too quickly then the code could easily miss them (especially when using Python to read them). Having some way to break out if they aren't detected in a reasonable time frame is wise. Also noticed a typo in pcmanbob's code...
by Paeryn
Wed Jul 08, 2020 5:47 pm
Forum: Python
Topic: Python loop help and if statement? help PLEASE
Replies: 21
Views: 375

Re: Python loop help and if statement? help PLEASE

I've never had a problem with this when using similar code with an HC-SR04, just about any code examples you will find online will use a version of the shown code and you don't see people complaining about the pi locking up. You have no code in the while GPIO.input... loops which is invalid, if you...
by Paeryn
Tue Jul 07, 2020 10:46 pm
Forum: Python
Topic: How sub thread change widget in main thread
Replies: 7
Views: 246

Re: How sub thread change widget in main thread

Whilst doing this may work, guizero uses Tkinter for the gui and with Tkinter only the main thread should really interact with the gui elements in any way. In your example you have a secondary thread (the one running doit() ) re-enabling a button. Really that thread should be sending a message back ...
by Paeryn
Sun Jul 05, 2020 4:08 pm
Forum: Python
Topic: Asteroids Infinity Game - Error message
Replies: 12
Views: 237

Re: Asteroids Infinity Game - Error message

There is another difference that could cause miscalculations when running Python 2 code with Python 3. In Python 2 an integer divided by an integer results in an integer so 5 / 2 = 2 , whereas in Python 3 it will give the correct floating point number 5 / 2 = 2.5 . This only happens if both the nume...
by Paeryn
Sun Jul 05, 2020 3:18 pm
Forum: Python
Topic: Asteroids Infinity Game - Error message
Replies: 12
Views: 237

Re: Asteroids Infinity Game - Error message

Thank you, there were approx 12 lines of code with the same <> these were all changed, there were also a couple of print errors where no brackets were used (). The code was definately written for Python 2, print bring used without brackets is probably the most visible difference between 2 and 3. In...
by Paeryn
Sun Jul 05, 2020 2:41 pm
Forum: Python
Topic: Asteroids Infinity Game - Error message
Replies: 12
Views: 237

Re: Asteroids Infinity Game - Error message

Where have you downloaded this from? Without knowing that we can't check it. It's likely an error on the previous line which is causing the if to be a syntax error (python is expecting something else). Or it might be a case where the program is written for python 2 and you are running it with python...
by Paeryn
Wed Jul 01, 2020 5:42 pm
Forum: C/C++
Topic: [Solved] How do I prove I am generating ARMv6 code ?
Replies: 18
Views: 635

Re: [Solved] How do I prove I am generating ARMv6 code ?

2) If you compile stuff yourself (on a regular Pi), it will probably be compiled with v7. (And thus won't run on the Zero). No, gcc supplied with RPiOS defaults to ARMv6 no matter which model you compile on, you have to specifically tell it to use ARMv7 if you want it. The last thing RPF want is fo...
by Paeryn
Wed Jul 01, 2020 4:55 pm
Forum: Troubleshooting
Topic: Raspberry Pi 3 Throttling every 3 seconds
Replies: 11
Views: 344

Re: Raspberry Pi 3 Throttling every 3 seconds

I Would be very surprised if the issue is with the power supply. I use an OnePlus adapter which is rated for 5V 4A. Is that a phone charger (I suspect it is)? If so it might not be capable of maintaining 5V at high loads, batteries don't care about voltage drops as much as the RPi does. Also is the...
by Paeryn
Wed Jul 01, 2020 1:22 am
Forum: Python
Topic: Tkinter Entry Boxes wont work!
Replies: 3
Views: 176

Re: Tkinter Entry Boxes wont work!

Right, the problem will be with overrideredirect(True). When you set that Tcl/Tk won't allow the window to take focus so you won't receive key events for it.
by Paeryn
Tue Jun 30, 2020 11:50 pm
Forum: Troubleshooting
Topic: invalid command name “1987269416show_frame” while executing “1987269416show_frame” (“after” script) in raspberry pi
Replies: 3
Views: 204

Re: invalid command name “1987269416show_frame” while executing “1987269416show_frame” (“after” script) in raspberry pi

Usually that sort of error comes from the callback being called (or attempted to be called) after the underlying object has been deleted (that is the tcl/tk object, not python's). I'd expect that to happen the moment you close the window, the after is still pending and triggers. If that's the case t...
by Paeryn
Tue Jun 30, 2020 9:04 pm
Forum: Python
Topic: Tkinter Entry Boxes wont work!
Replies: 3
Views: 176

Re: Tkinter Entry Boxes wont work!

Struggling to get a simple form to work in a tkinter instance. Is there a known issue with not being able to click on tk.Entry boxes? I'll take the key parts of the code out to see if anyone can spot something i'm doing wrong? class CreateWindow(): def __init__(self): self.root = tk.root() self.roo...
by Paeryn
Tue Jun 30, 2020 3:34 am
Forum: Python
Topic: update_command method for textbox
Replies: 4
Views: 182

Re: update_command method for textbox

The callback just tells you what key was added so as you type the callback function is called with each letter. If you want to know the contents of the textbox at any time just read its value . I added a PushButton that when pressed will print the contents of the textbox to the console. The lambda e...
by Paeryn
Mon Jun 29, 2020 1:59 am
Forum: Troubleshooting
Topic: Permission denied (publickey,password)
Replies: 1
Views: 116

Re: Permission denied (publickey,password)

OSMC is an operating system in its own right, it won't have been "installed" onto an SD card alongside an existing Raspbian/RPiOS. What you did was overwrite the contents of the SD card with the OSMC image, unfortunately everything from your previous OS is now gone.
by Paeryn
Mon Jun 29, 2020 12:26 am
Forum: General programming discussion
Topic: Unable to install games from .tgz files
Replies: 5
Views: 269

Re: I need guidence

$ gunzip fileName.tar.gz $ tar -xvf fileName.tar Or do it in one go, saves having the decompressed tar file lingering around (and keeps the original compressed file) $ tar xavf filename.tar.gz The a option passes the file through an appropriate decompresser based on file suffix (supports bzip2, gzi...
by Paeryn
Sun Jun 28, 2020 11:30 pm
Forum: General discussion
Topic: python3 can't use normal input and curses at the same time - problem
Replies: 3
Views: 146

Re: python3 can't use normal input and curses at the same time - problem

You could turn nodelay off, echo on and then use getstr() control.nodelay(False) control.echo(True) text_string = curses.getstr() getstr() has limited editing, just backspace I think. You don't want to mix ncurses and regular input/output, you can get away with using ncurses for just input but if yo...
by Paeryn
Sun Jun 28, 2020 9:20 pm
Forum: Troubleshooting
Topic: My first ever project and I'm stuck can you help?
Replies: 10
Views: 337

Re: My first ever project and I'm stuck can you help?

I don't know about how good any tutorials are, it depends on whether you have any programming experience in other languages. First place to go would probably be Python's own tutorial on their website here . (Note that link is relevant for Python 3.7 which is what RPiOS (Buster) has by default. Thoug...
by Paeryn
Sun Jun 28, 2020 6:28 pm
Forum: Troubleshooting
Topic: Unable to delete files or access chrome
Replies: 12
Views: 356

Re: Unable to delete files or access chrome

The OP's screenshot does show they tried apt-get clean but it fails because it needs to create files first. Adam_48529, strange that you say you can't empty your Trash as that should just delete files. Deleting files from the file manager (moving them to the Trash) would be blocked because that actu...
by Paeryn
Sun Jun 28, 2020 2:24 am
Forum: Troubleshooting
Topic: Raspberry Pi 3 Throttling every 3 seconds
Replies: 11
Views: 344

Re: Raspberry Pi 3 Throttling every 3 seconds

From the output in your screenshot your RPi is experiencing periods of under-voltage. I'm not sure but I wouldn't be surprised if it throttles when it detects under-voltage in an effort to reduce the load on your inadequate power supply.

Go to advanced search