Go to advanced search

by Paeryn
Mon Aug 20, 2018 6:57 pm
Forum: General discussion
Topic: Why different cout<< data type for serial UART vs pigpio bitbang?
Replies: 2
Views: 72

Re: Why different cout<< data type for serial UART vs pigpio bitbang?

A bit of example code might help, as it is only you know what your code is doing. At a guess one function is giving you integer values and the other is giving you characters, but you should know what type you are getting, C++ is quite strict, if the type of the variable presented to the << operator ...
by Paeryn
Mon Aug 20, 2018 1:41 am
Forum: Python
Topic: Help with RPi.GPIO and Debugging
Replies: 1
Views: 44

Re: Help with RPi.GPIO and Debugging

Have you got a local directory named RPi that is set up as a package? If so Python might be importing that rather than the proper package. You can always ask Python interactively what a package contains, help(RPi.GPIO) should bring up the documentation for RPi.GPIO and a few pages down it should lis...
by Paeryn
Mon Aug 20, 2018 1:09 am
Forum: Other projects
Topic: Charging psp with rpi
Replies: 6
Views: 153

Re: Charging psp with rpi

Imperf3kt wrote:
Mon Aug 20, 2018 12:44 am
The SONY PSP used a barrel jack for recharging.
The PSP can also be charged via USB if you turn the option on so long as it isn't the first model, only the original PSP-1000 can't be charged that way (without a hardware mod).
by Paeryn
Fri Aug 17, 2018 8:11 pm
Forum: Other projects
Topic: Charging psp with rpi
Replies: 6
Views: 153

Re: Charging psp with rpi

It might be one of those Sony things where they don't charge through USB when there isn't a data connection. PS3 controllers were annoying for that.
by Paeryn
Wed Aug 15, 2018 11:19 pm
Forum: C/C++
Topic: Keep a Function Updating Variables While Rest of Program Move Along?
Replies: 2
Views: 105

Re: Keep a Function Updating Variables While Rest of Program Move Along?

Threads are what you want to be looking at, you spawn a new thread to handle the updating whilst the rest of your code carries on. You might need to use mutex es or atomic s to make sure the updating thread can't update whilst another thread is in the middle of reading and to prevent reading whilst...
by Paeryn
Mon Aug 13, 2018 4:14 pm
Forum: OpenGLES
Topic: PBO Support on with Raspberry Pi?
Replies: 2
Views: 77

Re: PBO Support on with Raspberry Pi?

There's no appropriate extension for PBO reported by the driver. GL/glext.h won't tell you anything about GLES2 extensions, for that you need GLES2/gl2ext.h but that still won't tell you if the driver actually implements any of them, for that you need to query the driver with const GLubyte* availabl...
by Paeryn
Sun Aug 12, 2018 5:21 pm
Forum: Advanced users
Topic: PTHREADS libarary on Pi 3 MOdel B+
Replies: 2
Views: 89

Re: PTHREADS libarary on Pi 3 MOdel B+

__PTHREAD_SPINS is defined in bits/pthreadtypes.h which pthread.h should be including. That file is provided by the package libc6-dev
by Paeryn
Thu Aug 09, 2018 4:17 pm
Forum: Bare metal, Assembly language
Topic: Clang question (unwanted memset and memcpy calls in Assembly)
Replies: 16
Views: 470

Re: Clang question (unwanted memset and memcpy calls in Assembly)

no object can exist at NULL That's simply not true. Address 0 in memory is just as any other. Of course address 0 exists, but setting a pointer to 0 is telling the compiler that the pointer is pointing to an invalid address, if that pointer is of type pointer to struct then it makes sense that the ...
by Paeryn
Wed Aug 08, 2018 5:10 pm
Forum: Bare metal, Assembly language
Topic: Clang question (unwanted memset and memcpy calls in Assembly)
Replies: 16
Views: 470

Re: Clang question (unwanted memset and memcpy calls in Assembly)

Now about "ud" and "brk" instruction with -O1: it turned out, that the compiler thinks it is smarter than the programmer, and of course it is not... The issue is quite complex, but in a nutshell: I've mapped a supervisor-only page at 0, so that any user code dereferencing a null pointer would cause...
by Paeryn
Wed Aug 08, 2018 4:11 pm
Forum: Troubleshooting
Topic: very slow login, seems to happen in `su` when it calls pam_chksshpwd.so
Replies: 8
Views: 187

Re: very slow login, seems to happen in `su` when it calls pam_chksshpwd.so

The problem is in here somewhere; https://github.com/raspberrypi-ui/pam/blob/master/modules/pam_chksshpwd/pam_chksshpwd.c strace said it spent 50% of it's time in wait4 in that code. However I don't know enough c to understand why or where... DNS is working fine, and disabling that module makes log...
by Paeryn
Tue Aug 07, 2018 10:37 pm
Forum: Graphics programming
Topic: What is the difference between SDL, OpenGL, and OpenGLES?
Replies: 2
Views: 165

Re: What is the difference between SDL, OpenGL, and OpenGLES?

OpenGL and OpenGL|ES are graphics APIs which primarily deal with rendering 3D triangles (with lighting and texturing) onto a 2D surface. OpenGL|ES is a slimmed down version of OpenGL designed for low power mobile hardware (OpenGL for Embedded Systems). Neither have anything to do with how to display...
by Paeryn
Tue Aug 07, 2018 8:33 pm
Forum: Off topic discussion
Topic: Definition of ironic
Replies: 32
Views: 949

Re: Definition of ironic

How long before there are posts asking how to run pie on a pi?
by Paeryn
Tue Aug 07, 2018 1:16 am
Forum: Other projects
Topic: Power the Pi using NiMH rechargable batteries
Replies: 13
Views: 430

Re: Power the Pi using NiMH rechargable batteries

W. H. Heydt wrote:
Tue Aug 07, 2018 12:35 am
5.6Ah is rather high capacity rating for an AAA NiMH cell. I have some AA NiMH cells on my desk at the moment, and they are bigger than AAA and rated at 2Ah.
I think you misread what XenoBaby wrote, they have five 600mAh AAA batteries.
by Paeryn
Mon Aug 06, 2018 10:59 pm
Forum: Troubleshooting
Topic: very slow login, seems to happen in `su` when it calls pam_chksshpwd.so
Replies: 8
Views: 187

Re: very slow login, seems to happen in `su` when it calls pam_chksshpwd.so

pam_chksshpwd shouldn't be causing big delays, its purpose is to check if the password for the user pi is still the default of raspberry. If you've changed the password then disabling that module should be fine.
by Paeryn
Mon Aug 06, 2018 10:50 am
Forum: Bare metal, Assembly language
Topic: Clang question (unwanted memset and memcpy calls in Assembly)
Replies: 16
Views: 470

Re: Clang question (unwanted memset and memcpy calls in Assembly)

Thank you for your replies! Otherwise the compiler can assume that for example memcpy() does exactly what it is supposed to and could be replaced with an inlined equivalent version even though it never sees the code for the function. @Paeryn: exactly, that's why I'd expect no memset or memcpy optim...
by Paeryn
Sun Aug 05, 2018 1:21 am
Forum: Bare metal, Assembly language
Topic: Clang question (unwanted memset and memcpy calls in Assembly)
Replies: 16
Views: 470

Re: Clang question (unwanted memset and memcpy calls in Assembly)

-ffreestanding doesn't necessarily preclude requiring you to provide certain functions. I'm not sure on clang's handling but gcc expects that memcpy and memset will be provided by you. I wouldn't be surprised if clang has the same reliance. GCC requires the freestanding environment provide memcpy, ...
by Paeryn
Sat Aug 04, 2018 4:58 pm
Forum: Beginners
Topic: Keyboard shortcut doesnt output random numbers
Replies: 5
Views: 142

Re: Keyboard shortcut doesnt output random numbers

The command isn't being run by a shell so ${RANDOM} is being used literally, on the command line bash will replace that with a random number but since bash isn't invovled here it doesn't happen. If you want to use shell features you can run it via bash yourself, something along the lines of <command...
by Paeryn
Sat Aug 04, 2018 12:00 am
Forum: Python
Topic: Python script CPU usage is growing over time
Replies: 2
Views: 129

Re: Python script CPU usage is growing over time

Also in getCPUtemperature() you should really be closing the pipe that you opened when you have finished with it rather than relying on Python to do so. And on os.popen() , it's use was depricated back in Python 2.6, ideally you should be using subprocess.Popen() or (from Python 3.5 onwards) subproc...
by Paeryn
Fri Aug 03, 2018 4:54 pm
Forum: Python
Topic: Calling variables from different functions
Replies: 6
Views: 248

Re: Calling variables from different functions

From your code the variable text is local to the function btn_clk() , how are you expecting the function setupUi() is supposed to get the value when it is a local of a different function and even working around that, I assume that setupUi() is called before btn_clk() . How you initialise the string ...
by Paeryn
Wed Aug 01, 2018 12:52 am
Forum: General discussion
Topic: Gaming emulator
Replies: 2
Views: 121

Re: Gaming emulator

How would you be getting the RPi's display onto the laptop? Chances are your laptop hasn't got a video input. That leaves you with the likes of VNC where at the end of every frame the RPi has to send the framebuffer via the ethernet to the laptop which then displays it. I don't know how fast VNC can...
by Paeryn
Tue Jul 31, 2018 2:05 am
Forum: Python
Topic: Import "filename" to another project
Replies: 5
Views: 196

Re: Import "filename" to another project

You are correct. Monday morning brain! Thought it was a strange mistake you made. I usually have those moments in the early hours. To the OP, I don't think there is a way for Python to let you know when a name is already in use short of checking yourself if the name is in either the dictionaries re...
by Paeryn
Mon Jul 30, 2018 12:21 pm
Forum: Python
Topic: Import "filename" to another project
Replies: 5
Views: 196

Re: Import "filename" to another project

The variable conflict is why using "import <filename>" alone is a bad idea. Variables on the global namespace will just overwrite each other. A better method is to do something like this import <filename> as <someabbreviationoffilename> e.g. import tkinter as tk Then variables/functions from that f...
by Paeryn
Thu Jul 26, 2018 4:02 pm
Forum: Troubleshooting
Topic: debugging "too many files" error
Replies: 16
Views: 372

Re: debugging "too many files" error

I consistently have between 2300 and 2400 files open according to cat /proc/sys/fs/file-nr. Is that a lot? Too many? Normal? I have nothing to compare it to. That's fairly normal. Unless you're running out of memory Linux can happily deal with a lot more than that. Sort out your race condition(s) f...
by Paeryn
Tue Jul 24, 2018 10:10 pm
Forum: Troubleshooting
Topic: debugging "too many files" error
Replies: 16
Views: 372

Re: debugging "too many files" error

Hm. Maybe I don't understand "break." It jumps out of the loop its in, right? Or, does it kill the entire process? That would be embarrassing, but good for coding practices. Yes, break breaks out of the innermost for or while loop that it is in. As to installing lsof , did you do a sudo apt update ...
by Paeryn
Tue Jul 24, 2018 9:12 pm
Forum: Python
Topic: keyboard emulator
Replies: 16
Views: 467

Re: keyboard emulator

When I send the characters the putty application reads them. But they do not appear on the screen where I have the cursor.When I send the characters the putty application reads them. But they do not appear on the screen where I have the cursor. I think you are totally misunderstanding what PuTTY do...

Go to advanced search