Go to advanced search

by jojopi
Sun Feb 02, 2020 8:22 am
Forum: Python
Topic: Python code not able to turn on GPIO
Replies: 3
Views: 647

Re: Python code not able to turn on GPIO

I can turn my PI zero w GPIO pins on and off by using "gpio write 17 1", Are you sure? The "gpio write" that I am familiar with is part of WiringPi, and it defaults to WiringPi numbering, unless you pass the -g or -1 options. But 17 in WiringPi numbering was on the extra P5 header, present only on ...
by jojopi
Sun Feb 02, 2020 7:30 am
Forum: C/C++
Topic: how to set and read register value in C for raspberry pi in linux enviroment?
Replies: 7
Views: 1077

Re: how to set and read register value in C for raspberry pi in linux enviroment?

Read the rest of the page you linked. The SET register at +7 is for setting pins high (assuming they have already been configured as outputs). To read, you need the LEVEL register at +13. By the way, 0x6770696f are the ASCII codes for the letters "gpio", in big-endian byte order. That seems to be wh...
by jojopi
Mon Jan 27, 2020 6:03 pm
Forum: C/C++
Topic: How to Handle Multiple USB Devices of the Same Type
Replies: 2
Views: 469

Re: How to Handle Multiple USB Devices of the Same Type

There should already be symlinks in /dev/serial/by-path/ that are stable according to which ports the devices are plugged into. The path names are pretty cumbersome, but you can make permanent symlinks with your own names to them from anywhere outside of /dev, if you need to refer to them often. Thi...
by jojopi
Sun Jan 26, 2020 4:29 pm
Forum: Troubleshooting
Topic: FIXED: man <command> exits with code 1
Replies: 11
Views: 672

Re: man <command> exits with code 1

:~ $ ls -l /proc/$$/fd lrwx------ 1 pi pi 64 Jan 25 09:58 0 -> /dev/pts/1 lrwx------ 1 pi pi 64 Jan 25 09:59 1 -> /dev/pts/1 l-wx------ 1 pi pi 64 Jan 25 09:59 2 -> 'pipe:[5880175]' l-wx------ 1 pi pi 64 Jan 25 09:59 255 -> 'pipe:[5880175]' So, standard input and output (0 and 1) are connected to a...
by jojopi
Fri Jan 24, 2020 5:56 pm
Forum: Troubleshooting
Topic: [Fixed] Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used
Replies: 17
Views: 940

Re: Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used

Then I got to thinking maybe your pulling software from a bad mirror since it could be possible they would use different ones. Repository data is cryptographically signed to guard against tampering. apt will not install anything unless it can verify that the exact package file was approved by one o...
by jojopi
Fri Jan 24, 2020 8:00 am
Forum: Troubleshooting
Topic: [Fixed] Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used
Replies: 17
Views: 940

Re: Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used

'badblocks" is not as relevant as it was decades ago. Operating systems used to need facilities to find and work around defects in the media. All modern storage devices do this internally, and hide problems from the OS until they lose data. The fact that you can read the whole card is not a bad sign...
by jojopi
Fri Jan 24, 2020 6:04 am
Forum: Troubleshooting
Topic: FIXED: man <command> exits with code 1
Replies: 11
Views: 672

Re: man <command> exits with code 1

su -c '/bin/bash -i' pi In another thread I said that a "tcsetattr" error meant that bash thought it was interactive but had no terminal. Here, you are passing the -i flag to bash, forcing it to be interactive when it presumably does not want to be. According to the man page, bash should be interac...
by jojopi
Thu Jan 23, 2020 11:31 am
Forum: Troubleshooting
Topic: [Fixed] Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used
Replies: 17
Views: 940

Re: Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used

Curl uses many shared libraries, so it is possible the segfault occurs inside one of them. See "ldd /usr/bin/curl". You can reinstall a package without purging it first: sudo apt install --reinstall PACKAGE However, if our working theory is that the SD card is experiencing corruption issues, then I ...
by jojopi
Wed Jan 22, 2020 2:26 pm
Forum: Troubleshooting
Topic: [Fixed] Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used
Replies: 17
Views: 940

Re: Issue "tcsetattr: Inappropriate ioctl for device" in script where curl used

The error message is from bash. It does not mention curl, nor give a script name or line number. Somehow bash thinks it is interactive at that point; it tries to set terminal attributes and finds it has no terminal. I am not sure what could cause that, but suspect it may involve command substitution...
by jojopi
Tue Jan 21, 2020 1:22 pm
Forum: C/C++
Topic: Mouse position in C++ Not with X11 but DispmanX
Replies: 45
Views: 2571

Re: Mouse position in C++ Not with X11 but DispmanX

i can comfortably intercept the event and use the delta values to move my own cursor/objects in project but I need in this very specific instance to get hold of the position of the cursor displayed by Raspbian. It sounds like your application is taking over the whole screen with 3d graphics, readin...
by jojopi
Mon Jan 20, 2020 10:54 pm
Forum: Troubleshooting
Topic: [Resolved] Permission Denied, please try again.
Replies: 11
Views: 601

Re: Permission Denied, please try again.

sollazzo08 wrote:
Mon Jan 20, 2020 10:50 pm
One for a computer that runs Ubuntu and one for my Raspberry Pi. Hopefully that answers the question!
Have you checked the auth.log on the Ubuntu machine to see why it does not like the "pi" username?
by jojopi
Mon Jan 20, 2020 7:47 pm
Forum: Troubleshooting
Topic: [Resolved] Permission Denied, please try again.
Replies: 11
Views: 601

Re: Permission Denied, please try again.

OpenSSH should not be branding itself as Ubuntu unless it is running on Ubuntu, or you somehow downloaded it from an Ubuntu-specific repository. You are trying to log in to an Ubuntu machine. Check /var/log/auth.log on the Ubuntu machine, which may (or more likely may not) be the Pi, to see why the ...
by jojopi
Mon Jan 20, 2020 8:59 am
Forum: Troubleshooting
Topic: [Resolved] Permission Denied, please try again.
Replies: 11
Views: 601

Re: Permission Denied, please try again.

sollazzo08 wrote:
Mon Jan 20, 2020 6:27 am
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
Is the Pi running Ubuntu, or are you connecting to the wrong machine?
by jojopi
Sun Jan 19, 2020 11:04 am
Forum: Arch
Topic: Arch Linux ARM "startx" failing to work
Replies: 9
Views: 1095

Re: Arch Linux ARM "startx" failing to work

Suddenly, while I was almost finished setting Arch Linux ARM (arch2 port for RPi), "startx" returned error (1) with more actions from Xinit. I remember a line that said "Connection Refused". Is it possible you simply ran out of disk space? Otherwise, you are going to have to pay more attention to t...
by jojopi
Thu Jan 16, 2020 2:58 pm
Forum: Raspberry Pi OS
Topic: Move Directory?
Replies: 28
Views: 1968

Re: Move Directory?

or add the user to the www-data group and they should have permissions to move/copy the files there anyway without needing sudo. No. By default, /var/www/ is only writable by root. This is a rare case where the default permissions are wrong, of course. The Debian developers cannot know which users ...
by jojopi
Mon Jan 13, 2020 9:32 am
Forum: Troubleshooting
Topic: First time soldering and I think I broke my Pi Zero
Replies: 4
Views: 286

Re: First time soldering and I think I broke my Pi Zero

The soldering of the header pins does not really look bad enough to cause a serious issue. The joints might even all be making contact. However, there appears to be some stray solder bridging together two of the test pads under the SD card. It is advisable to check for that kind of problem before po...
by jojopi
Thu Jan 09, 2020 7:07 pm
Forum: C/C++
Topic: Possible to block part of the terminal
Replies: 6
Views: 535

Re: Possible to block part of the terminal

So are you drawing into the top section using framebuffer methods, and leaving other programs running normally in the scrolling area? In that case I think you want to enable Origin Mode, which makes most other sequences count relative to the scrolling region instead of the top of screen. printf("\x1...
by jojopi
Thu Jan 09, 2020 4:20 am
Forum: Python
Topic: Classes and For Loops
Replies: 9
Views: 618

Re: Classes and For Loops

No, you really should not.

Code: Select all

numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for number in numbers:
    if 4 <= number <= 6:
        numbers.remove(number)

print(numbers)
[0, 1, 2, 3, 5, 7, 8, 9]
Pesky five!
by jojopi
Wed Jan 08, 2020 1:56 pm
Forum: Python
Topic: Classes and For Loops
Replies: 9
Views: 618

Re: Classes and For Loops

The error message is because the loops try to check the rest of the bullets against the thing even after we have done "del thing", so thing is now undefined. This is easily fixed by adding a "break" statement after "del thing". That terminates the inner loop early, skipping the rest of the bullets a...
by jojopi
Tue Jan 07, 2020 3:20 pm
Forum: C/C++
Topic: Possible to block part of the terminal
Replies: 6
Views: 535

Re: Possible to block part of the terminal

Most terminal emulators support an escape sequence to set the scrolling region: ESC [ top ; bottom r . Example in C: printf("\x1b[5;20r"); You can omit top and/or bottom to mean the first or last line of the screen. The existing screen contents are left intact, but the cursor is moved back to 1;1. Y...
by jojopi
Fri Jan 03, 2020 6:27 am
Forum: Troubleshooting
Topic: Clearing the known_hosts SSH File
Replies: 1
Views: 294

Re: Clearing the known_hosts SSH File

There is no file for SimonTatham to be found… (Today I realized that PuTTY is from the author of "Simon Tatham's Portable Puzzle Collection" — "apt install sgt-puzzles" in Raspbian.) However, I do not think you are using PuTTY. I think you are using Cygwin, or some other port of command-line OpenSS...
by jojopi
Thu Jan 02, 2020 6:16 am
Forum: Off topic discussion
Topic: Linux on a Business Card.
Replies: 16
Views: 1969

Re: Linux on a Business Card.

0000000: 1b72 1b5b 317e 1b5b 3477 7777 2e62 757a .r.[1~.[4www.buz 0000010: 7a63 6172 642e 7573 2f73 6365 2d32 3230 zcard.us/sce-220 0000020: 0a . I struggled to make sense of that. The first keystroke should have been Win+R (open Run dialog), but the fact that your terminal produced ESC-r suggests ...
by jojopi
Wed Jan 01, 2020 8:46 pm
Forum: Troubleshooting
Topic: LXTerminal ?
Replies: 9
Views: 584

Re: LXTerminal ?

^[[3~, where ^[ represents the escape character, is the sequence sent by the Delete key in a text terminal. ^[[3;5~ is Ctrl+Delete, and ^C represents Ctrl+C. It looks like you typed the ssh command, it did not prompt for a password within a reasonable time, so you mashed the keyboard for a bit and e...
by jojopi
Tue Dec 31, 2019 5:01 am
Forum: Troubleshooting
Topic: Config.txt deleted
Replies: 4
Views: 297

Re: Config.txt deleted

I believe this is the file that RPF/T currently build into their images:
https://github.com/RPi-Distro/pi-gen/bl ... config.txt
by jojopi
Tue Dec 31, 2019 4:43 am
Forum: Python
Topic: precision in time.time
Replies: 3
Views: 345

Re: precision in time.time

You should get six or seven decimals: >>> import time >>> time.time() 1577765297.1833355 Internally, Python is using double-precision binary floating-point. The seventh decimal digit is not stored exactly, and in the distant future when more digits are required to the left of the point, the sixth de...

Go to advanced search