Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
priznat
Jul 7, 2009

Let's get drunk and kiss each other all night.

thehustler posted:

Finally finished this:



Cabling is a bit messy and my soldering needs a tad more work but I’m enjoying this a lot.

Not got time to do the code yet. Are there libraries to help with this kind of matrix? I’m going to 12 GPIO puns, no I2C or any kind of MC.

That’s really cool!

Setting up 2D arrays in python or something would probably be a good start point, and could use NumPy to perform matrix math if required.

I am also curious if there would be a library that would help with that now.

Adbot
ADBOT LOVES YOU

Dren
Jan 5, 2001

Pillbug
I found this a while back for doing something similar with RGB LED strips

https://www.adafruit.com/product/1689

This video shows how the software works

https://www.youtube.com/watch?v=8ZBFGBQq6zw

It's pretty slick, it maps a 2D drawing surface straight onto the LEDs for you. I believe there are other, similar projects.

TheKingofSprings
Oct 9, 2012
I’m using a Pi 3B+ to stream video using GStreamer for some research work and I’m playing around with MJPEG and H264 for the delivery format.

Both are software encoding from raw RGB right now and I found H264 had a loving 2 second latency when I was trying it yesterday. Anyone know why that might be?

KICK BAMA KICK
Mar 2, 2009

hambeet posted:

I just checked mine and it's working. I noticed the update changed some settings in the openvpn app, but they didn't cause me any issues (eg. Compression and fallback to google DNS).
Thanks for checking -- I wound up reinstalling everything, and that still wasn't working until I looked at the OpenVPN log on the Pi, saw something about a tls-cipher disagreement, went looking for the solution to that and after poking around in the server.conf -- I'm pretty sure without actually changing anything -- it started working again.

Then I tried to set back up the Cloudflared DNS-over-HTTPS I had going before and hosed everything up again so just got it back to working and am gonna leave it at that.

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass

TheKingofSprings posted:

I’m using a Pi 3B+ to stream video using GStreamer for some research work and I’m playing around with MJPEG and H264 for the delivery format.

Both are software encoding from raw RGB right now and I found H264 had a loving 2 second latency when I was trying it yesterday. Anyone know why that might be?

Latency is the nature of a highly compressed format like H264--it needs to buffer data for some time to figure out how to best compress the motion between scenes. There are options to tweak the latency of H264 you might explore, but IMHO stick with MJPEG. It sucks a lot of bandwidth but is fast and nearly zero latency. I've never gotten H264 streams to be as low latency as MJPEG.

edit: Also if you have the bandwidth, maybe just consider sending video entirely uncompressed.

TheKingofSprings
Oct 9, 2012

mod sassinator posted:

Latency is the nature of a highly compressed format like H264--it needs to buffer data for some time to figure out how to best compress the motion between scenes. There are options to tweak the latency of H264 you might explore, but IMHO stick with MJPEG. It sucks a lot of bandwidth but is fast and nearly zero latency. I've never gotten H264 streams to be as low latency as MJPEG.

edit: Also if you have the bandwidth, maybe just consider sending video entirely uncompressed.

I absolutely do not have bandwidth, this will be getting sent in a remote-rear end field in the middle of nowhere

E: Understanding these compression issues helps me greatly though and I can try to set up caps filters to stream raw and see how it goes, thank you!

Dren
Jan 5, 2001

Pillbug
Doesn't the pi have hw accelerated h264 encoding?

SlowBloke
Aug 14, 2017

Dren posted:

Doesn't the pi have hw accelerated h264 encoding?

hw accelerated means it skips the cpu, it doesn't mean it won't take time to encode the video feed.

Dren
Jan 5, 2001

Pillbug

SlowBloke posted:

hw accelerated means it skips the cpu, it doesn't mean it won't take time to encode the video feed.

I would guess the hw accelerated encode would be able to do lower latency than the cpu. If he’s using cpu he should be sure to set the low latency mode in libx264.

General_Failure
Apr 17, 2005
I'm doing the beginners AI jetson nano course thing that nVidia is offering. To do it a whole new SD image needs to be downloaded which weighs in at about 5gb compressed. What this gets me is some python notebooks saved in the premade home directory, most of the poo poo that's installed with the normal developer image besides a few libs and a jupyter widget, and ??? on a clunky heavyweight image which has some weird bogging down issue.
I chucked the notebooks over to my normal image. Happy now. Having fun messing with live image classification examples.

Ive only tried out some native and arduino examples on the Grove AI HAT. it seems a good idea in theory, but useful explanations on how to do things like utilise the KPU are kind of thin. I spent far too long trying to get it to talk to a pi via GPIO UART until I did a loopback jumper and realised that the rx and tx were the same on both. Duh.
I guess one neat thing is that because it is the same size as a Pi3 and has the same PCB holes it kind of fits in a pi case. Yeah, I don't know.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

TheKingofSprings posted:

I’m using a Pi 3B+ to stream video using GStreamer for some research work and I’m playing around with MJPEG and H264 for the delivery format.

Both are software encoding from raw RGB right now and I found H264 had a loving 2 second latency when I was trying it yesterday. Anyone know why that might be?
What software are you using to playback? For example VLC by default uses a 1 second buffer/cache on network streams to improve robustness.

eddiewalker
Apr 28, 2004

Arrrr ye landlubber
I have a Pi3b attached to a Meanwell PSU along with a bunch of other things, and I’d like to be able to just flip off the mains regularly without the Pi eating it’s SD card.

Is there anything like a “2 minute battery, graceful shutdown pi-hat” I can throw on?

wolrah
May 8, 2006
what?

eddiewalker posted:

I have a Pi3b attached to a Meanwell PSU along with a bunch of other things, and I’d like to be able to just flip off the mains regularly without the Pi eating it’s SD card.

Is there anything like a “2 minute battery, graceful shutdown pi-hat” I can throw on?

For pure "safe shutdown" purposes one of these things seems cool: https://juice4halt.com/

Supercapacitor based, so no battery maintenance but they only have 30-60 seconds of runtime. There are also a variety of options that use LiPo or LiFePo cells or packs if you want to be able to survive longer.

Skarsnik
Oct 21, 2008

I...AM...RUUUDE!




I feel like I say this on a fairly regular basis but I have 3 pi's on the go of various generations and haven't had a corrupt card despite not giving a gently caress about yanking the power on a regular basis in about 5/6 years now. It was certainly a thing in the early years but nothing since

It just doesn't seem to happen with good quality sd cards, i.e not kingston or sandisk ones that are probably fake

wolrah
May 8, 2006
what?
To add to the anecdotes, I've never had a card failure either and I use plenty of cheap-rear end Microcenter store brand cards. I have Pis running LibreELEC and OctiPi running 24/7 with no power protection, when I have an outage they just drop, and so far they all have always come back. These are of course mostly running appliance distros where writes are limited, and it seems like actively writing to the card at the time of power failure is strongly correlated with problems, but I mean how many cases do Pis make sense in where you're constantly writing? If you really need that, plug in a USB stick.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I have had so many problems, but am also often writing a lot, and mostly use lovely cards

Raygereio
Nov 12, 2012

eddiewalker posted:

I have a Pi3b attached to a Meanwell PSU along with a bunch of other things, and I’d like to be able to just flip off the mains regularly without the Pi eating it’s SD card.
Is there anything like a “2 minute battery, graceful shutdown pi-hat” I can throw on?
Add a button connected to two GPIO pins that shuts down the Pi when it's pressed. If you search for something "raspberry pi shutdown button" you'll find plenty of examples.

Hadlock
Nov 9, 2004

Also never had an SD card problem in like what, almost 10 years. Pulling the USB cable is how I power cycle my devices zero zero problems

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
The only issue I've had is when the sd card was just straight up dying and getting corruption through that.

eddiewalker
Apr 28, 2004

Arrrr ye landlubber
My PiHole ruins its card nearly every time it loses power, and I’ve been running name-brand cards bought at physical stores, so I don’t know.

I don’t care about reflashing the pihole occasionally, but I’ve put so many hours into configuring the 3D printer this new Pi is running, I don’t want to risk it. I intend to do regular backups, but still.

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Have you considered running whatever command it is that enables USB booting (assuming it's an older Pi, Pi3 supports it out of the box) so you don't have to have an SD card at all.

Schadenboner
Aug 15, 2011

by Shine

Cojawfee posted:

Have you considered running whatever command it is that enables USB booting (assuming it's an older Pi, Pi3 supports it out of the box) so you don't have to have an SD card at all.

Wait, what?

TVs Ian
Jun 1, 2000

Such graceful, delicate creatures.

Yeah, you can enable booting off a USB device, then flash the image to something like a flash drive or USB SSD (SSD would probably be the better choice if you'll be writing a lot), and supposedly it doesn't corrupt itself if the Pi powers off.

I forget the command, I think you basically have to edit the boot config on a MicroSD card, then once you boot it stays so you can remove the card and plug in the USB. I'm positive the 3B+ is preset that way.

CatHorse
Jan 5, 2008

TVs Ian posted:

I forget the command, I think you basically have to edit the boot config on a MicroSD card, then once you boot it stays so you can remove the card and plug in the USB. I'm positive the 3B+ is preset that way.

Some raspberrys can boot even without sd card (rpi4 is getting support some time later, brobably next year) but you can follow this: https://www.raspberrypi.org/forums/viewtopic.php?t=44177 (works for all raspberrys)

That way you can use smallest/cheapest sd card (for example 1gb) to boot. And the only time writes to it happen is kernel updates.

brains
May 12, 2004

eddiewalker posted:

I have a Pi3b attached to a Meanwell PSU along with a bunch of other things, and I’d like to be able to just flip off the mains regularly without the Pi eating it’s SD card.

Is there anything like a “2 minute battery, graceful shutdown pi-hat” I can throw on?

I had a lot of issues with this originally so i tried USB boot with no SD card and that didn't quite solve it either- occasionally it refused to boot back up off the USB drive.

i ended up with a blank SD card with nothing but a good bootcode.bin on it, and a full install on the USB drive. it has gone through many unattended power cycles since then and reboots itself without any issue. since the SD card has nothing being written to it, it never corrupts, and the USB bootcode.bin is unused so it won't corrupt either.

doctorfrog
Mar 14, 2007

Great.

I had a card go corrupt, it’s my pi-hole install now. Maybe someday it’ll be unusable.

SpaceAceJase
Nov 8, 2008

and you
have proved
to be...

a real shitty poster,
and a real james
What's a good cheap way to connect passive speaker wires to an old B+ or Pi Zero?

EDIT: This is just one audio project I've got. Some speakers on my deck.

Also looking for the latest recommendation for SPDIF hat for a Pi 3B+/4

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
'Good enough' would be plugging the 3.5mm audio output into a stereo receiver or amplifier. You can't just plug speakers into the Pi directly. For the very early Pi models (Pi 1, 2) the audio output is pretty bad but still good enough for most uses. Later Pi's improved its quality quite a bit.

If you care about audio quality get a USB DAC that connects through the USB port and becomes the 'sound card' completely replacing the Pi's audio output. You'll get a little higher quality sound without a ton of extra complexity.

Beyond that you can look at little I2S-based boards that add a DAC directly to the Pi through its GPIO pins. IMHO I'd avoid them--other than smaller size/form factor there's no benefit vs. a USB DAC, and the potential for a lot of negatives. There are even some hats that have speaker amplifiers in them, but again it's a tradeoff to get a smaller size at the expense of quality (those hats are designed for low cost and ease of use vs. trying to isolate the analog circuitry and reduce noise).

Alucard
Mar 11, 2002
Pillbug
Anyone here have problems with the 5GHz band on their RPi 3B+? I'm running OSMC and my iw list for my wifi device won't even list the 5GHz band. I've tried the bulk updates and searching various troubleshooting sites to no avail, but wasn't certain if anyone had suggestions for how to kick my device in the rear and get it to start using the 5GHz band again...

klosterdev
Oct 10, 2006

Na na na na na na na na Batman!

Alucard posted:

Anyone here have problems with the 5GHz band on their RPi 3B+? I'm running OSMC and my iw list for my wifi device won't even list the 5GHz band. I've tried the bulk updates and searching various troubleshooting sites to no avail, but wasn't certain if anyone had suggestions for how to kick my device in the rear and get it to start using the 5GHz band again...

Can you see the 5GHz SSID when your Pi is right next to the router? 5GHz has significantly shorter range than 2.4GHz.

General_Failure
Apr 17, 2005
I lost a few new SanDisk cards from new out of the blister card. I mean they just outright died when I went to write a disk image to them. Besides that never had a problem with them. Yes they were legitimate ones. I just wish I could find a card reader that supports low level operations. I'd like to see if those cards can be salvaged.

I'm not sold on 5GHz WiFi. Even with the router a little over 2m away with no obstructions the signal is a couple of bars down. A couple of rooms away, forget it.
Even my Jetson Nano which has aerials as long as my hand isn't great with 5GHz.

Progressive JPEG
Feb 19, 2003

5GHz is mainly useful in situations like an apartment building where 2.4GHz is saturated and would involve lots of retries on every packet. It is more sensitive to obstructions that would not be a problem for 2.4 GHZ, but this can work in your favor when it comes to avoiding the interference caused by 5 GHz APs run by your neighbors.

If you would like to know more, get an amateur radio license and/or visit the ham radio thread

Alucard
Mar 11, 2002
Pillbug
Sorry, maybe my original post wasn't clear. I suspect my problem is something configuration-wise in having the 5GHz band on the Pi active. I can't see any 5GHz spots because the ranges it appears to scan only focus on 2.4 GHz. It used to work fine when I was running a retropie image but when I switched to osmc things got borked.

Maybe I'm missing the point of iw list, but my impression is that if I'm missing any 5GHz bands on that list, then I can't scan for 5GHz points. Since it's different than trying to scan for ssids, I suspect a missing band on phy0 means that I have some configuration or driver messed up for my onboard wifi, or am I talking nonsense?

Head Bee Guy
Jun 12, 2011

Retarded for Busting
Grimey Drawer
hey, no idea where to post this, but i wanna make some gloves that are wired to play “FALCON PUNCH” through speakers when buttons sewed into the knuckles are activated.

Is this something a raspberry pi would be useful for?

Sagebrush
Feb 26, 2012

Sure. A Raspberry Pi is also really large and power-hungry and kind of overkill for that. Here is a little MP3 player board that costs $4 and which can do what you want.

https://www.amazon.com/HiLetgo-Arduino-Player-Module-DFPlayer/dp/B01D1D0E7Q/

If it's literally just a button that triggers a single sound file, all you need is that board, a microSD card, a battery, and the speakers (plus an amplifier if needed). If you want more advanced functionality you hook it up to an Arduino Nano which also costs $4 and then you can do all sorts of stuff like wiring it to an accelerometer or playing multiple sound files for different events etc.

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Yeah, that application is what an arduino nano is made for. Power it up and it automatically loads up the code burned into it and just loops forever waiting for input. You could run it off a one of those phone charging power packs for several hours. Whereas a raspberry pi would suck up a lot of power, and you better hope that it doesn't goof something up when booting up and it ends up not running your python script and you have no way to troubleshoot it because you don't have a monitor or a keyboard.

TheKingofSprings
Oct 9, 2012
I’ve run into a major issue backing up my Pi 3B+ for the first time where it no longer starts up properly.

I downloaded Win32 Disk Imager and made a backup using the image file of the kernel and now the Pi won’t do anything past the Raspberry logo. The screen goes black, the ACT light stops blinking and while it’s clear the HDMI connection is still active it’s not doing anything.

I still have the backup but it’s apparently too big to fit into a different SD card despite the file sizes both being 32 GB. I have some important files I want to extract from it or preserve and I’m strongly considering trying to run the backup but I have no idea what the outcome of that will be.

If anyone has some suggestions or advice it would be extremely welcome. :(

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
Flash a separate card with a stock Rasbian image. Boot up that image, then use a SD card to USB adapter to read the backup card filesystem and pull out the files you need to save. Or if you're handy with Virtual Box then spin up a Linux VM and pass through the USB SD card adapter to the VM. Then I'd just nuke the backup card and start over, or if you really want you could try troubleshooting further.

I have a feeling it's a power or card connection issue, if you really did just make a backup and not accidentally change the state of the card (try not to muck with Linux formatted SD cards from Windows, it's easy to accidentally write stuff that confuses or breaks the Linux FS). But it's really hard to say for sure without more info. And ultimately you won't learn anything useful trying to janitor partitions and filesystems--it's easier to just save the files and start over.

mod sassinator fucked around with this message at 20:49 on Sep 9, 2019

TheKingofSprings
Oct 9, 2012
Crisis semi-averted! After recovering everything I decided to copy the contents of the working boot folder to the not working boot folder on the original SD and lo-and-behold it works! It looks like I need to tinker with resolutions but the stuff that I want to work works!

Adbot
ADBOT LOVES YOU

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
Whatever tool or app you used to do the backup, don't use it anymore. Modifying the boot partition should never happen with a backup. Perhaps it thought it was being clever storing some backup state there--who knows. If it's a regular thing you might look at tools like rsync or rclone to periodically sync and backup folders on the Pi to cloud storage or other servers. If you're paranoid pop the disk out and use another Pi (or another Raspbian install on a separate card) to dd copy the entire SD card to a backup image--that's the most reliable way to ensure you get everything (including the boot partition and any partitions your host OS like Windows might not see).

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply