Go to advanced search

by ericcooper
Tue Jun 11, 2019 7:54 pm
Forum: Beginners
Topic: Determining how Raspbian was installed?
Replies: 4
Views: 150

Re: Determining how Raspbian was installed?

You can tell the difference between a Raspbian-only install and a NOOBS/PINN install by looking at the partitions on the SD card: sudo parted /dev/mmcblk0 print Raspbian will have a small fat32 partition and a larger ext4 partition; see https://github.com/raspberrypi/noobs/wiki/NOOBS-partitioning-ex...
by ericcooper
Tue Jun 11, 2019 3:48 pm
Forum: General discussion
Topic: Move a headless Pi0W to a new WiFi network - how?
Replies: 4
Views: 169

Re: Move a headless Pi0W to a new WiFi network - how?

I don't know if the boot sequence always picks up /boot/wpa_supplicant.conf and moves it to /etc/wpa_supplicant, or only on first boot, but it can't hurt to try. And yes, you can have multiple "network={" blocks in the file, and the ones with matching SSIDs will be tried. Do "man wpa_supplicant.conf...
by ericcooper
Sat Jun 01, 2019 3:29 pm
Forum: Raspbian
Topic: SSH (iptables): how to allow only one IP
Replies: 4
Views: 163

Re: SSH (iptables): how to allow only one IP

You're filtering on destination IP address (-d). Don't you want source (-s)?
by ericcooper
Tue Apr 30, 2019 3:57 pm
Forum: Troubleshooting
Topic: Power shortage using powerboost 1000c
Replies: 21
Views: 635

Re: Power shortage using powerboost 1000c

It won't be as portable, but an off-the-shelf solution is an external USB battery.
by ericcooper
Sat Mar 23, 2019 5:18 pm
Forum: Python
Topic: Solved: How to avoid that math problem?
Replies: 11
Views: 382

Re: How to avoid that math problem?

You can pass the formatted string to the labelText.set() method instead of the floating point value.
by ericcooper
Sat Mar 23, 2019 4:46 pm
Forum: Python
Topic: Solved: How to avoid that math problem?
Replies: 11
Views: 382

Re: How to avoid that math problem?

It's not the math, but the fact that floating point values are represented in binary. So some values will be different than if they were represented in decimal. You can control how floating point numbers are printed using Python's format operations. For example, to display only one decimal place, yo...
by ericcooper
Thu Jan 31, 2019 4:20 pm
Forum: Troubleshooting
Topic: using Find to remove files older than X number of days
Replies: 18
Views: 498

Re: using Find to remove files older than X number of days

"find" has a built-in action "-delete" that is a little easier to use than "-exec rm '{}'". You can use "-print" while debugging, and when you're sure it's picking the right files, replace "-print" with "-delete".
by ericcooper
Thu Jan 17, 2019 4:54 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: DS3231 I2C RTC and g_ether - cannot use both?
Replies: 3
Views: 242

Re: DS3231 I2C RTC and g_ether - cannot use both?

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial
by ericcooper
Wed Jan 16, 2019 5:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: DS3231 I2C RTC and g_ether - cannot use both?
Replies: 3
Views: 242

Re: DS3231 I2C RTC and g_ether - cannot use both?

I would try more permutations. On my Pi Zeros, I have multiple dtoverlay lines in config.txt: # Enable USB driver dtoverlay=dwc2 # Enable i2c real-time clock dtoverlay=i2c-rtc,m41t62,wakeup-source # Enable i2c accelerometer dtoverlay=i2c-st-accel,lis3dh # Enable i2c ADC dtoverlay=ads1015,cha_enable,...
by ericcooper
Fri Dec 21, 2018 5:02 pm
Forum: Raspbian
Topic: Disk space eaten up by old kernels/modules - remove old kernels
Replies: 6
Views: 1785

Re: Disk space eaten up by old kernels/modules - remove old kernels

The latest version of the raspberrypi-kernel package in stretch ships the 4.14.79{,-v7+} modules directories. I guess the .80 and .81 versions came from pi-update, which as mentioned you don't need to be using, just apt update and upgrade. So you can manually remove (rm -r) modules directories older...
by ericcooper
Thu Dec 06, 2018 6:24 pm
Forum: General discussion
Topic: Could somebody update Bitcoin Electrum in the debs?
Replies: 5
Views: 362

Re: Could somebody update Bitcoin Electrum in the debs?

electrum in sid (unstable) is version 3.2.3
by ericcooper
Wed Dec 05, 2018 2:04 am
Forum: Networking and servers
Topic: Sharing internet by Bluetooth
Replies: 4
Views: 1918

Re: Sharing internet by Bluetooth

network-manager knows how to setup Bluetooth (PAN) network connections. Just discover, pair, and trust your phone from your Pi, using bluetoothctl, and if your phone's BT hotspot is enabled, it should show up as one of network-manager's connection options.
by ericcooper
Fri Oct 19, 2018 5:34 pm
Forum: C/C++
Topic: Double Check - Free`ing the right thing
Replies: 13
Views: 1845

Re: Double Check - Free`ing the right thing

Also, if you find yourself having to cast a variable almost every time you use it, that's a "code smell". You should declare a variable of the correct type, perhaps using a cast once to initialize it.
by ericcooper
Tue Oct 16, 2018 3:28 pm
Forum: C/C++
Topic: I am missing some fundamental understanding of C?
Replies: 13
Views: 2130

Re: I am missing some fundamental understanding of C?

I can't tell what's wrong without seeing more of the code (definition of the Image struct, declaration of the lfb variable), but I'd suggest running your program under the debugger, gdb. (You'll have to compile your code with the -g flag.) Then you can inspect the values of variables when the fault ...
by ericcooper
Thu Oct 11, 2018 10:51 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 11
Views: 1247

Re: Periodically update DS3231 RTC with NTP

If the DTS file for your RTC specifies that it's a "wakeup-source", you should have a /sys/class/rtc/rtc0/wakealarm file to which you can write the desired number of seconds until it generates a wakeup alarm. The rtcwake command from the util-linux package may also be useful.
by ericcooper
Sun Sep 30, 2018 9:58 pm
Forum: Troubleshooting
Topic: Can not update to the latest MPD (raspianStretch)
Replies: 3
Views: 525

Re: Can not update to the latest MPD (raspianStretch)

Just because that version is in the pool doesn't mean it's the latest one for a particular suite (stretch, jessie, etc.). The Packages file determines that. In the case of stretch, 0.19.21-1 is the latest version. The one you found will be in buster. You can try downloading the .deb and installing i...
by ericcooper
Fri Sep 28, 2018 3:40 pm
Forum: Raspbian
Topic: Linux kernel source code and patches for Raspbian Jessie Lite
Replies: 6
Views: 855

Re: Linux kernel source code and patches for Raspbian Jessie Lite

There are git tags on the rpi-4.9.y branch corresponding to the Debian raspberrypi-kernel package versions, including "raspberrypi-kernel_1.20170703-1" which corresponds to the package currently in jessie
by ericcooper
Wed Sep 26, 2018 10:38 pm
Forum: Bare metal, Assembly language
Topic: Why does my Raspberry Pi Zero W report that it has 256MB?
Replies: 7
Views: 1223

Re: Why does my Raspberry Pi Zero W report that it has 256MB?

Boot it with a Raspbian SD card and see how much memory the kernel reports in the log, or the "free" command prints. If it says 512M, there's probably some low-level hardware initialization that you haven't done, or are doing differently.
by ericcooper
Wed Sep 26, 2018 9:20 pm
Forum: General discussion
Topic: terminal on ttyusb
Replies: 1
Views: 119

Re: terminal on ttyusb

On my Pi Zero, I added "modules-load=dwc2,g_serial" to /boot/cmdline.txt, and did "systemctl enable serial-getty@ttyGS0.service".
After rebooting, there should be a getty running on the Pi's /dev/ttyGS0.
by ericcooper
Thu Aug 09, 2018 3:39 pm
Forum: Off topic discussion
Topic: Any NAS chassis reccomendations ?
Replies: 6
Views: 2081

Re: Any NAS chassis reccomendations ?

I bought one of these: https://silverstonetek.com/product.php?pid=452 and put in my own motherboard and disk drives. The fans are a little too noisy to have in the same room, but you could probably mod those if desired.
by ericcooper
Thu Aug 09, 2018 3:34 pm
Forum: Troubleshooting
Topic: DietPi Zero w keeps rebooting
Replies: 10
Views: 812

Re: DietPi Zero w keeps rebooting

I use a minimal Raspbian LIte on the PI Zero W I use as a webcam. It takes just over 1GB on the SD card. Is diet Pi really worth the trouble? I can hardly find SD cards that small any more.
by ericcooper
Wed Jul 25, 2018 3:43 pm
Forum: Advanced users
Topic: Configuration of a RTC-MCP79410 with Raspberry PI 3
Replies: 8
Views: 558

Re: Configuration of a RTC-MCP79410 with Raspberry PI 3

What MCP79410 module are you using? Does it have a battery, and if so have you checked that the battery is good? Without a battery, most RTC chips will lose their settings when the power goes off.
by ericcooper
Mon Jul 16, 2018 3:52 pm
Forum: Python
Topic: RTC management with Raspberry PI 3
Replies: 7
Views: 514

Re: RTC management with Raspberry PI 3

You can check dmesg output to make sure the kernel is detecting the RTC and loading the right driver (also look for it in the output of "lsmod"). But the presence of /dev/rtc0 means it probably is OK. You can use the "hwclock" command to read and set the RTC time. See "man hwclock". And you can use ...
by ericcooper
Tue Jul 03, 2018 8:28 pm
Forum: Python
Topic: Regular expression that turns into a python syntax question
Replies: 11
Views: 697

Re: Regular expression that turns into a python syntax question

Any non-zero / non-empty value is treated as True for "if" statements and other conditionals.
by ericcooper
Tue Jun 19, 2018 4:39 pm
Forum: Python
Topic: Help with some code please
Replies: 4
Views: 434

Re: Help with some code please

This is pretty ambitious, so I'd advise against trying to do it all at once. Try to make one thing work at a time (live video, detecting garage door open/close, etc.) and then combine them. Your Python code seems to have a bunch of shell command lines in it. That won't work (although you can use the...

Go to advanced search