Go to advanced search

by n67
Tue Jun 19, 2018 1:08 pm
Forum: Troubleshooting
Topic: Raspberry PI 3 freeze for some hours and afterwards its working (without reboot)
Replies: 8
Views: 592

Re: Raspberry PI 3 freeze for some hours and afterwards its working (without reboot)

Not to put too fine a point on it, but does the problem go away if you re-enable swap?

BTW, I see in your last post that you are running Raspbian. OK, good.
by n67
Mon Jun 18, 2018 5:21 pm
Forum: General discussion
Topic: Shell script won't run just edit
Replies: 5
Views: 713

Re: Shell script won't run just edit

1) To make a clickable icon, you have to create a "something.desktop" file in the ~/Desktop directory. This file is in the typical "INI file" format. For example: [Desktop Entry] Version=1.0 Name=something Comment=Run the something utility Exec=/home/pi/MyUtility Icon= Terminal=true Type=Application...
by n67
Mon Jun 18, 2018 1:25 am
Forum: General discussion
Topic: Password Lost
Replies: 5
Views: 3039

Re: Password Lost

It's probably easier to do the "init=/bin/bash" trick, than to try to edit files on the ext4 partition (unless, of course, you have other Linux systems available and are au courant on how to mount, edit, etc). To the OP: I would suggest Googling for "init=/bin/bash" (or maybe /bin/sh - either or bot...
by n67
Mon Jun 18, 2018 12:39 am
Forum: Advanced users
Topic: Pi Zero as a USB keyboard (HID gadget)
Replies: 34
Views: 24421

Re: Pi Zero as a USB keyboard (HID gadget)

Getting closer... I changed g_ether to libcomposite and rebooted. Note: I am connected to the Pi Zero via serial (that's my only connection to the board now). Now, when I run hidsetup.sh, I get a slew of messages from the kernel, ending with: Message from [email protected] at Jun 17 00:31:46 ... kernel:[...
by n67
Sun Jun 17, 2018 11:13 pm
Forum: Beginners
Topic: Access denied on SHH (password is correct, user is pi)
Replies: 15
Views: 1085

Re: Access denied on SHH (password is correct, user is pi)

And if the user is running their Pi headless? Or there's no internet connection? (about the only way you can do what you're suggesting for locale is geo-ip lookups) Do you block all logins until your magic tool has run? What about non-raspbian OS? This is all b***C*** nonsense. I'm not suggesting a...
by n67
Sun Jun 17, 2018 11:05 pm
Forum: Advanced users
Topic: Pi Zero as a USB keyboard (HID gadget)
Replies: 34
Views: 24421

Re: Pi Zero as a USB keyboard (HID gadget)

OK - that makes sense.

FWIW, there doesn't seem to be any reference to this in the StickIt tut. I just loaded the page and searched for "cmdline" and didn't find any.

Also, how much more complicated is it to do both (both hid and ethernet).

I'm not using Windows, so that is not a consideration.
by n67
Sun Jun 17, 2018 10:19 pm
Forum: Beginners
Topic: Access denied on SHH (password is correct, user is pi)
Replies: 15
Views: 1085

Re: Access denied on SHH (password is correct, user is pi)

No, that would be the (various) Mac machines! ;) Windows (10, at least) makes it very easy for the user to select these options at first boot. That is exactly my point. A basic problem with the way Raspbian is - and has been from the start - is the lack of any kind of "install" program. This is a d...
by n67
Sun Jun 17, 2018 10:08 pm
Forum: Advanced users
Topic: Pi Zero as a USB keyboard (HID gadget)
Replies: 34
Views: 24421

Re: Pi Zero as a USB keyboard (HID gadget)

Well, it still doesn't work. I downloaded your script and ... : # ./hidsetup.sh ls: write error: Device or resource busy # dir /dev/h* /dev/hwrng See also: # grep '^[^#]' /boot/config.txt dtparam=audio=on dtoverlay=dwc2 enable_uart=1 # cat /etc/modules # /etc/modules: kernel modules to load at boot ...
by n67
Sun Jun 17, 2018 5:58 pm
Forum: Beginners
Topic: Access denied on SHH (password is correct, user is pi)
Replies: 15
Views: 1085

Re: Access denied on SHH (password is correct, user is pi)

The last time folks let their software do everything for them we ended up with Windows ... ;) Or Ubuntu (the Linux version of Windows...) I'm not a big fan of Ubuntu, but I did install it on a (not Pi) machine recently, and I'm pretty sure it does exactly what I'm suggesting here. Figures out where...
by n67
Sun Jun 17, 2018 4:32 pm
Forum: Beginners
Topic: Access denied on SHH (password is correct, user is pi)
Replies: 15
Views: 1085

Re: Access denied on SHH (password is correct, user is pi)

What about people who may want to use (e.g.) a UK keyboard (perhaps one which they happen to have around), even though they live in the US, or vice versa? What about countries with more than one 'official language'? How difficult is it really to set up your preferences as you want them during insta...
by n67
Sun Jun 17, 2018 4:29 pm
Forum: Advanced users
Topic: Pi Zero as a USB keyboard (HID gadget)
Replies: 34
Views: 24421

Re: Pi Zero as a USB keyboard (HID gadget)

I've got the isticktoit tutorial working. My code is here: https://github.com/thagrol/pwdgen/blob/master/hidsetup.sh for comparison. Thanks. I'll give it a go at some point, and let you know how it comes out. BTW, do you know what the point of the 'ls' command at the end is? It doesn't seem to be d...
by n67
Sun Jun 17, 2018 3:43 pm
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

[email protected]:~$ ifconfig wlan0 | awk 'sub(/.*inet /,"") { print $1 }' Yeah, that'll do it. You just need something to distinguish the ipv4 line from any possible ipv6 lines. Did we ever determine *why* the OSMC version of ifconfig is different from the Raspbian version? (As I indicated earlier, t...
by n67
Sun Jun 17, 2018 2:27 pm
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

Yeah, yeah, yeah, I know, you solved your problem so you don't get care. Yes, OK. But. This: ifconfig wlan0 | awk 'sub(/.*inet addr:/,"") { print $1 }' absolutely will work. Given your commentary, I have to assume there was some kind of transcription error. What exactly do you get as output when you...
by n67
Sun Jun 17, 2018 12:38 pm
Forum: Beginners
Topic: Access denied on SHH (password is correct, user is pi)
Replies: 15
Views: 1085

Re: Access denied on SHH (password is correct, user is pi)

Somebody should write a Pi utility that does: 1) Uses the Internet to figure out where the user is. This is a little creepy to think about, but the fact is that the data is there and lots of programs use it. Given your IP address, they know where you are to within, I think, a 6 mile radius. 2) Confi...
by n67
Sun Jun 17, 2018 10:57 am
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

Even if I did get the details wrong, which is possible, it is still better/easier to do it with a single AWK (which might not be exactly what I posted - I don't really care about the exact details of the problem), then to do it with grep/sed/awk. I never suggested grep/sed/awk. Mine was a simple on...
by n67
Sun Jun 17, 2018 10:40 am
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

I still don't understand why you are using grep, sed, and awk, when a single awk woudl suffice. Please enlighten me. Because you didn't read the problem fully and your solution wouldn't work. No. Even if I did get the details wrong, which is possible, it is still better/easier to do it with a singl...
by n67
Sun Jun 17, 2018 8:48 am
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

I still don't understand why you are using grep, sed, and awk, when a single awk woudl suffice.

Please enlighten me.
by n67
Sat Jun 16, 2018 11:18 pm
Forum: Advanced users
Topic: Pi Zero as a USB keyboard (HID gadget)
Replies: 34
Views: 24421

Re: Pi Zero as a USB keyboard (HID gadget)

I've also found this tutorial https://www.rmedgar.com/blog/using-rpi-zero-as-keyboard-setup-and-device-definition and https://gist.github.com/gbaman/50b6cca61dd1c3f88f41 and I'm sure everything works, so that the Pi is recognized as keyboard. But how do I send keystrokes or mouse input to the PC? H...
by n67
Sat Jun 16, 2018 11:02 pm
Forum: Raspbian
Topic: Scripting problem extracting IP address
Replies: 23
Views: 1625

Re: Scripting problem extracting IP address

Avoid sed - using sed is for masochists.

Just do this:

Code: Select all

addr=$(ifconfig wlan0 | awk 'sub(/.*inet addr:/,"") { print $1 }')
by n67
Thu Jun 14, 2018 6:15 pm
Forum: General discussion
Topic: Getting RPi. Python script to run 24/7 without laptop turned on
Replies: 70
Views: 4968

Re: Getting RPi. Python script to run 24/7 without laptop turned on

In case it wasn't crystal clear obvious, one of my points is that systemd (like all init systems) makes it hard to debug your programs. And, as everyone knows, debugging is never done.

All init systems have the problem, but systemd seems to take it to new levels.
by n67
Thu Jun 14, 2018 5:16 pm
Forum: General discussion
Topic: Getting RPi. Python script to run 24/7 without laptop turned on
Replies: 70
Views: 4968

Re: Getting RPi. Python script to run 24/7 without laptop turned on

Still no success. I tried to follow the steps here:
See what I mean?
by n67
Thu Jun 14, 2018 2:37 pm
Forum: Beginners
Topic: Cannot mount network share on boot
Replies: 4
Views: 481

Re: Cannot mount network share on boot

I would do this via rc.local and leave fstab alone. (Yes, I know a lot of the hardcores will go apoplectic over this and tell you to do it with some weird systemd thing or something, but ignore them) Note, BTW, that you don't need "sudo" in rc.local, since rc.local runs as root anyway. Next, if you'...
by n67
Thu Jun 14, 2018 1:36 pm
Forum: Beginners
Topic: Cannot mount network share on boot
Replies: 4
Views: 481

Re: Cannot mount network share on boot

This is probably in the category of "The network isn't up yet at the time you try to do the mount".

There are various solutions, some that use "systemd", some that do not.

Before suggesting a solution, it would be good to know what specific method(s) you've employed
by n67
Thu Jun 14, 2018 1:13 pm
Forum: General discussion
Topic: Getting RPi. Python script to run 24/7 without laptop turned on
Replies: 70
Views: 4968

Re: Getting RPi. Python script to run 24/7 without laptop turned on

It is easy enough to defend it, but you are clearly taking a "religious" position w.r.t. it.

That is, we're stuck with it, we might as well make ourselves feel good about it.

Perfectly understandable human reaction. I don't fault you for it.
by n67
Thu Jun 14, 2018 1:11 pm
Forum: Troubleshooting
Topic: Raspberry PI 3 freeze for some hours and afterwards its working (without reboot)
Replies: 8
Views: 592

Re: Raspberry PI 3 freeze for some hours and afterwards its working (without reboot)

It's set to a small value because, as you infer, swapping to an SD card is a slightly bad thing. It can wear the card out quite quickly, and is actually pretty slow due to the way that SD card work (you cannot clear a single byte, you need to clear whole blocks at a time). Best place for a swap is ...

Go to advanced search