Go to advanced search

by Paeryn
Fri Dec 13, 2019 8:21 pm
Forum: General discussion
Topic: xdotool and Buster errors
Replies: 5
Views: 101

Re: xdotool and Buster errors

It looks like a bug somewhere, when lxterminal is first opened the window hints aren't fully populated, especially width_inc and height_inc which are supposed to be the character width and height that are used as multipliers to lock the resize dimensions to whole characters. With these set a zero, w...
by Paeryn
Fri Dec 13, 2019 2:53 pm
Forum: General discussion
Topic: crontab not working on pi zero
Replies: 10
Views: 221

Re: crontab not working on pi zero

I got it working. I had to add the timezone to the crontab. TZ=America/New_York thanks, Putting that line inside a crontab just sets the TZ environment variable for the jobs it runs, it has no effect on the timezone used by cron when scheduling jobs. IIRC cron relies on /etc/localtime being a symli...
by Paeryn
Thu Dec 12, 2019 1:27 am
Forum: Python
Topic: GPIO switch doesn't issue command properly (Buster lite)
Replies: 7
Views: 242

Re: GPIO switch doesn't issue command properly (Buster lite)

the main concern is the command working correctly; I have programs set to run from the /home/pi/.bashrc at startup and i want to stop that process in the terminal (like ctrl+c would) then restart the .bashrc (like "exit" "logout" or "exec bash" will do) when the switch is pressed. My goal is for th...
by Paeryn
Wed Dec 11, 2019 6:21 pm
Forum: General discussion
Topic: [Solved] Annoying feature of 'apt-get uprgade'
Replies: 42
Views: 1122

Re: Annoying feature of 'apt-get uprgade'

Using read -e tells it to use readlne to get the input with has editing facilities, without -e it takes raw input exactly as it is given.
by Paeryn
Tue Dec 10, 2019 11:44 pm
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

Recently, I studied the pygame FAQ. The first question is the question of why in IDLE the Pygame window does not close correctly? The answer was that it was called by the Python IDLE interpreter, which seems to somehow store links. Make sure you call "pygame.quit ()" when you exit the application o...
by Paeryn
Mon Dec 09, 2019 5:16 am
Forum: Bare metal, Assembly language
Topic: Hello world gdb dump questions
Replies: 4
Views: 171

Re: Hello world gdb dump questions

Here is the dumped code for the hello_world.c program. It's a lot better to post code as text (and inbetween code tags) rather than images as images make life hard to point out sections, we can't copy-paste text out of an image. I just have a couple of questions about what I am seeing. For address ...
by Paeryn
Sun Dec 08, 2019 7:01 pm
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

To be fair, in your first reply you were pretty explicit about the OP needing to put the functionality in the imported file into functions, then importing the file only once and calling the functions in the parent program (at the point where the OP was trying to do repeated imports). Ah yes, the su...
by Paeryn
Sun Dec 08, 2019 5:04 pm
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

I would reiterate scotty101 here you should not be attempting to use subprocess or to "execute" a child python script for this. Possibly so, I took it from the OP that the child script was a separate program being that they imported it but never referenced anything from it in a manner that appeared...
by Paeryn
Sun Dec 08, 2019 2:29 am
Forum: Other programming languages
Topic: Dart Native on Raspberry Pi
Replies: 14
Views: 696

Re: Dart Native on Raspberry Pi

I thought you'd accidentally swapped them or something. I might have to download it and trace it.
by Paeryn
Sun Dec 08, 2019 12:44 am
Forum: Other programming languages
Topic: Dart Native on Raspberry Pi
Replies: 14
Views: 696

Re: Dart Native on Raspberry Pi

What is Dart doing in the interpreted version that makes it twice as fast as the compiled version for Fibo(42)?
hippy wrote:
Sat Dec 07, 2019 10:19 pm

Code: Select all

                         Fibo(24)    Fibo(42)

Dart         compiled :    0.064s     31.169s
Dart      interpreted :    4.298s     15.599s
by Paeryn
Sun Dec 08, 2019 12:28 am
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

Apparently, the whole point is that the script runs in version 2.x of python, and not in 3.x. ... I also tried to run the child script through python3, as Paeryn advised. For this, I adjusted the line: def start (): subprocess.run ('child_script.py', shell = True) On such a line: def start (): subp...
by Paeryn
Sat Dec 07, 2019 4:10 am
Forum: Bare metal, Assembly language
Topic: [Solved] System calls
Replies: 9
Views: 303

Re: System calls

In AARCH32 using EABI all syscalls are made with svc #0, put the syscall number in r7 and the arguments in r0 to r6, the result (if any) will be in r0.

If you are using AARCH64 then the syscall goes in x8 and arguments in x0 to x5, result in x0.
by Paeryn
Sat Dec 07, 2019 3:35 am
Forum: Bare metal, Assembly language
Topic: [Solved] System calls
Replies: 9
Views: 303

Re: System calls

If you look in /usr/include/arm-linux-gnueabihf/asm/unistd-common.h you'll see all the C #defines (well most, there are a few extra in unistd.h) naming the syscalls for ARM.
by Paeryn
Sat Dec 07, 2019 3:20 am
Forum: Beginners
Topic: ANSI escape code do not work in Python 3.7.3?
Replies: 4
Views: 205

Re: ANSI escape code do not work in Python 3.7.3?

Interpreting ANSI escape sequences is the job of whatever is displaying the output, Python itself doesn't interpret escape sequences. When running from the command line then it is the terminal emulator's job to interpret any text printed, which in Raspbian the default terminal emulator is lxterminal...
by Paeryn
Thu Dec 05, 2019 6:00 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 501

Re: Threading problems

From your code the three threads t1 , t2 and t3 which run the functions digitalna_ura() , aktivnosti_po_uri() and watch_dog_pulse() respectively are one-shot deals as the functions do one thing and end (I'm not totally sure about the third thread as it just calls another function which I presume is ...
by Paeryn
Thu Dec 05, 2019 3:30 am
Forum: Python
Topic: Difficulties with first python script (user input yes/no)
Replies: 19
Views: 475

Re: Difficulties with first python script (user input yes/no)

Hmm... I changed the autostart file to include this line @lxterminal -e python /home/pi/fbcp-ili9341/build/startup_script.py but no luck. Although, the autostart file also includes the line emulationstation #auto to start the retropie GUI, so im not sure if maybe this is conflicting somehow I've no...
by Paeryn
Mon Dec 02, 2019 5:49 pm
Forum: Beginners
Topic: crontab question...
Replies: 6
Views: 166

Re: crontab question...

I have a simple shell script I would like run every minute. I use crontab with the following entry: */1 * * * * /home/pi/MOTION/Datatrans.sh It does nothing however if I run the script from a treminal with ./Datatrans.sh it runs fine? in fact there are two or three other shell scripts in the cronta...
by Paeryn
Mon Dec 02, 2019 3:24 pm
Forum: Troubleshooting
Topic: Autostart works on Pi 2, but not Pi zero
Replies: 9
Views: 173

Re: Autostart works on Pi 2, but not Pi zero

Hi. Go back to the first way you ware calling your python program and add the redirect of output to the end of it then try running it on your pi zero and see if there are any error messages captured @/usr/bin/python3 /home/pi/Documents/myfile.py >> /home/pi/error.txt 2>&1 That won't work in autosta...
by Paeryn
Mon Dec 02, 2019 4:40 am
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

To Paeryn, that is also how I start a new python program running, do you have any other ideas on how to start a new program besides "import"? Python's import module_name does not, has never and never will "start a new program module_name running". If you want your Python program to start another pr...
by Paeryn
Mon Dec 02, 2019 2:49 am
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

Your understanding of import is flawed and using import like that is not going to do what you want. Import loads a module and makes the definitions available to your program, it isn't supposed to be used to run code directly. Python manual for import When your program reaches import child_script it ...
by Paeryn
Sat Nov 30, 2019 11:58 pm
Forum: C/C++
Topic: MMAL Decode JPEG and get frame back immediately
Replies: 6
Views: 212

Re: MMAL Decode JPEG and get frame back immediately

What model RPi? An RPi4 and maybe RPi3 would possibly be faster decoding on the ARM (I don't know the overheads or inner workings of the VC hardware blocks), especially if you are going to sit waiting for the result rather than doing other things. With a 2, 3 or 4 you could always arrange to run the...
by Paeryn
Sat Nov 30, 2019 11:34 pm
Forum: Off topic discussion
Topic: Jetson Nano or RPI4
Replies: 10
Views: 705

Re: Jetson Nano or RPI4

A headset will likely work so long as you only want sound out, none of the RPis have any analogue inputs. Composite out used to be on a separate connector on the original RPi with sound on a 3-pole jack but (I assume for space) they replaced the 3-pole with a 4-pole and moved the video on to there. ...
by Paeryn
Sat Nov 30, 2019 10:27 pm
Forum: C/C++
Topic: MMAL Decode JPEG and get frame back immediately
Replies: 6
Views: 212

Re: MMAL Decode JPEG and get frame back immediately

Do you oknow that the callback is sometimes definitely not happening? I don't know how the callbacks are implemented but I'd be looking closely at waitForDecoder . In the top function you have while(waitForDecoder) msleep(1); If you have a callback that sets that variable from another thread then th...
by Paeryn
Sat Nov 30, 2019 9:24 pm
Forum: Troubleshooting
Topic: Problem with LXDE-pi/autostart
Replies: 2
Views: 83

Re: Problem with LXDE-pi/autostart

and I add this line: bash myScript.sh to "sudo nano ~/.config/lxsession/LXDE-pi/autostart" that was empty. Now i can not access the desktop enviroment!!! :shock: You have basically just replaced the normal autostart programs (which starts the desktop and such) with your one program. What you should...
by Paeryn
Sat Nov 30, 2019 9:05 pm
Forum: Off topic discussion
Topic: Jetson Nano or RPI4
Replies: 10
Views: 705

Re: Jetson Nano or RPI4

I think there's a slight error in there Raspberry Pi 4 is small, lighter than the Nano developer kit, has audio (headphones output and microphone input). The RPi4 has audio out (though it can drive headphones I don't think it is meant as a headphone socket, more line-level) but there isn't a microph...

Go to advanced search