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
TheLastManStanding
Jan 14, 2008
Mash Buttons!
I'm not sure where you're getting 5 mHz from; servos are typically run at 50 Hz. You can only get them up to around 400 Hz before the pulses start running into each other. From your code I think you're running at 200 Hz, which should be fine.

Edit: I'm guessing you're confusing the units. That 5000000 is the period in ns, not the frequency, which equates to 5 ms, or 200 Hz.

TheLastManStanding fucked around with this message at 02:42 on May 12, 2014

Adbot
ADBOT LOVES YOU

Hadlock
Nov 9, 2004

TheLastManStanding posted:

That 5000000 is the period in ns, not the frequency, which equates to 5 ms

:smithicide: Warning to others, always check your units. There went four hours of my life. That fixed it, thanks.

sub supau
Aug 28, 2007

G-Prime posted:

When the cron job to play the music runs, write the PID that it starts to a file. After x minutes, read the PID back and kill it.
Thanks. While I was out trying to figure out how to do that, I ended up hitting on a way easier solution though - a second job x minutes later calling a script that just says "mpc stop". I doubt it's the best or most efficient way, but with my knowledge of Linux not going much beyond the parts where it's basically DOS it was certainly the easiest.

Mantle
May 15, 2004

I finally thought of a project to build with the pi but I have never done anything like this before. I want to build an input lag testing tool similar to this one: http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=89&products_id=212

Is this something suitable to use the pi for? I need to measure the delay between video output over HDMI and a photo resistor sensing that output ideally within 1 ms accuracy.

I would also like to know if there is a way for the pi to output VGA natively? All I can find are articles saying to use a dongle but I need native output so I can eliminate the dongle as a source of input lag when testing a display.

Mantle fucked around with this message at 16:53 on May 13, 2014

BrainDance
May 8, 2007

Disco all night long!

YouTuber posted:

Yeah now I'm getting it as well. The thing freezes up but when I ssh in it runs like dogshit and I can barely issue a reboot command.

I jumped ship and downgraded instead of sitting there troubleshooting. But, openelec 4.0.1 is out and they say;

openelec.tv posted:

We included fixes for reported issues like crashing or freeze issues on RaspberryPi and non working calibration setup on RaspberryPi.

So, we'll see. Gonna give it a shot when I get home.

A c E
Jun 18, 2007

Is this weird? Is this too weird? Do you need to sit down?

BrainDance posted:

I jumped ship and downgraded instead of sitting there troubleshooting. But, openelec 4.0.1 is out and they say;


So, we'll see. Gonna give it a shot when I get home.

I'll likely upgrade mine tonight as well.

Dolemite
Jun 30, 2005
Alright, so I finally have the Pi at a point where it's usable. Although getting the overscan settings just right was a massive bitch!

Anyways, I want to get access to those GPIO pins, but I don't want to pony up the cash for Adafruit's Pi Cobbler thingee. Then it hit me, my girlfriend hoards a bunch of old computer stuff and had a 40-pin IDE cable sitting around. Now, there's only 26 pins on the Pi, so I was thing of doing along the lines of:

1) Adding white out or some nail polish to the ribbon cable. Then, snapping the cable on top of the GPIO pins.

2) Once I've seen what part of the IDE cable connector had the nail polish punched through by the GPIO pins, I can mark that section off on the other end of the cable.

3) Run jumper wires from the holes on the end of the IDE cable running from the Pi to a bread board

4) Go nuts!

Has anyone tried that and not fried their Pi? I'm a little confused because of the almost overwhelming about of information out there. One thing I really worry about is that basically, there's a common theme of if you feed the GPIO pins anything about 3.3v, you'll kill the Pi.

I REALLY don't want to have to buy another one and have to set it up again.

teamdest
Jul 1, 2007

Dolemite posted:

Alright, so I finally have the Pi at a point where it's usable. Although getting the overscan settings just right was a massive bitch!

Anyways, I want to get access to those GPIO pins, but I don't want to pony up the cash for Adafruit's Pi Cobbler thingee. Then it hit me, my girlfriend hoards a bunch of old computer stuff and had a 40-pin IDE cable sitting around. Now, there's only 26 pins on the Pi, so I was thing of doing along the lines of:

1) Adding white out or some nail polish to the ribbon cable. Then, snapping the cable on top of the GPIO pins.

2) Once I've seen what part of the IDE cable connector had the nail polish punched through by the GPIO pins, I can mark that section off on the other end of the cable.

3) Run jumper wires from the holes on the end of the IDE cable running from the Pi to a bread board

4) Go nuts!

Has anyone tried that and not fried their Pi? I'm a little confused because of the almost overwhelming about of information out there. One thing I really worry about is that basically, there's a common theme of if you feed the GPIO pins anything about 3.3v, you'll kill the Pi.

I REALLY don't want to have to buy another one and have to set it up again.

Some old IDE cables had a pin blocked off. I used to know why, but I can't remember anymore and it was probably a stupid reason anyway. Either way, make sure you get a 40 pin cable that isn't blocked or you could accidentally bend and then snap one of the gpio pins on your pi. Ask how I know this.

I decided eventually that the t-cobbler would fit into my breadboard more cleanly and was basically worth the cost of the part, especially since it's adafruit and I like them.

Nintendo Kid
Aug 4, 2011

by Smythe
Blocking the one pin makes sure people plug in the IDE cable in the right orientation, even with drives that didn't have the plastic shroud with a space for the keying bump around their pins.

PS. Love the cabin
Dec 30, 2011
Bee Lincoln
It's the worst thing when you have an old controller which has all of the pins intact and all your cables have the blocked pin.

Dolemite
Jun 30, 2005

teamdest posted:

Some old IDE cables had a pin blocked off. I used to know why, but I can't remember anymore and it was probably a stupid reason anyway. Either way, make sure you get a 40 pin cable that isn't blocked or you could accidentally bend and then snap one of the gpio pins on your pi. Ask how I know this.

I decided eventually that the t-cobbler would fit into my breadboard more cleanly and was basically worth the cost of the part, especially since it's adafruit and I like them.

Yep, her cable does indeed have one pin hole blocked off. I was looking through some DIY sites of people that already tried this. Meh, I might just pony up for the Adafruit thing because, well, :effort:.

mfny
Aug 17, 2008
Just received my first Raspi along with some stuff for it including a preloaded SD card,case etc from ModMyPi. I have a few issues/questions so far hopefuly someone here can address/answer..

During writeing of the Raspian image in NOOBs I got an write protect error near the end of the process. I powered off the Pi and checked the write protect tab on the micro to SD adapter and it was not locked I did however slide it from locked to unlocked a few times just to be sure. Put it back in the SD slot and powered up the Pi again and redid the Raspian install and no such error this time. Not sure what is up with this/should I be concerned about the SD card or slot ?

Does the expand filesystem option in the text based config overwrite the NOOBs/Recovery partition on the SD card ?

The monitor set up tool in Raspian will not work. Gives a can not get monitor info error so am unable to set resolution. There a fix/workaround for this ?

Amberskin
Dec 22, 2013

We come in peace! Legit!

mfny posted:

Just received my first Raspi along with some stuff for it including a preloaded SD card,case etc from ModMyPi. I have a few issues/questions so far hopefuly someone here can address/answer..

During writeing of the Raspian image in NOOBs I got an write protect error near the end of the process. I powered off the Pi and checked the write protect tab on the micro to SD adapter and it was not locked I did however slide it from locked to unlocked a few times just to be sure. Put it back in the SD slot and powered up the Pi again and redid the Raspian install and no such error this time. Not sure what is up with this/should I be concerned about the SD card or slot ?

Does the expand filesystem option in the text based config overwrite the NOOBs/Recovery partition on the SD card ?

The monitor set up tool in Raspian will not work. Gives a can not get monitor info error so am unable to set resolution. There a fix/workaround for this ?

That write protect glitch sounds like the SD slot is faulty. That thing is probably the raspi ugliest thing. I'd recommend you to get a microSD to SD adapter, pull the adapter into the raspi (and leave it in forever) and use microSDs instead.

I don't use NOOBS so I can't answer your second question. I don't use the video output either (my raspies are all headless, excepting the one I use with RASPBMC).

mfny
Aug 17, 2008

Amberskin posted:

That write protect glitch sounds like the SD slot is faulty. That thing is probably the raspi ugliest thing. I'd recommend you to get a microSD to SD adapter, pull the adapter into the raspi (and leave it in forever) and use microSDs instead.

I don't use NOOBS so I can't answer your second question. I don't use the video output either (my raspies are all headless, excepting the one I use with RASPBMC).

So should I be contacting retailer I bought the Pi from in the case of the SD card issue ?

Have followed the instuctions here http://weblogs.asp.net/bleroy/archive/2013/04/10/getting-your-raspberry-pi-to-output-the-right-resolution.aspx and my display still looks wrong, visible area is about 2 inches smaller then monitor.

To make all this more of a pain the wireless keyboard/trackpad thing I bought for the Pi misses keystrokes and other odd behaviour which makes makeing changes to config files on the Pi all kinds of fun...

TheLastManStanding
Jan 14, 2008
Mash Buttons!
The Pi ignores the sd lock switch so any write problems stem from either a faulty card, but more likely the image on it was bad. If you don't have any more problems with it I wouldn't worry about it. For the missed keystrokes it's probably a power issue; make sure your power supply can supply over an amp or try a different keyboard. Expanding the filesystem doesn't overwrite anything. The original image on the sd card doesn't take up all of the space; expanding it increases the partition to fill the entire sd card. For the monitor issue you can find the solution on google; there is a file where you can manually set the timing and overscan settings.

NecroBob
Jul 29, 2003

mfny posted:

To make all this more of a pain the wireless keyboard/trackpad thing I bought for the Pi misses keystrokes and other odd behaviour which makes makeing changes to config files on the Pi all kinds of fun...

Have you tried putting them on a powered hub? I have a wireless keyboard that does what you're describing, but as soon as I gave it more power, it worked fine.

mfny
Aug 17, 2008

TheLastManStanding posted:

The Pi ignores the sd lock switch so any write problems stem from either a faulty card, but more likely the image on it was bad. If you don't have any more problems with it I wouldn't worry about it. For the missed keystrokes it's probably a power issue; make sure your power supply can supply over an amp or try a different keyboard. Expanding the filesystem doesn't overwrite anything. The original image on the sd card doesn't take up all of the space; expanding it increases the partition to fill the entire sd card. For the monitor issue you can find the solution on google; there is a file where you can manually set the timing and overscan settings.

I have had it apears had to reseat the SD card twice to get the Pi to boot today but cant be totaly sure on this though. Guess that ups the chances of an SD slot issue. Also due to the Measy RC12 issues ive had to cut power to the Pi without a proper shutdown.. though I should say the read only error happened out of the box before the RC12 started to become a real problem. But I believe this can cause SD card reliability problems down the line so that has me worried.

PSU is 2amp and ive tested the RC12 keyboard/ mouse on a PC, same issues so its likely its faulty I guess.

Monitor apears on further looking into it to be overscan issues indeed as monitor reports correct resolution in info on OSD but I figure I should be looking at the SD card problems and the Measy not working right before I do to much more on this.

So my first Pi experience, not going to well so far. Im going to contact Modmypi about the SD card issues and the RC12..

Sackmo
Oct 13, 2004
I had a lot of weird SD card issues with my first pi as well. In the end I found out that it was a bad micro SD adapter. I also had a bunch of networking problems, but it ended up that my switch decided to start dying as soon as I plugged my pi in. :biotruths::arghfist:

Paco de Suave
Sep 13, 2004
photographs of the best time you had
window smudged by the speed


I think I'm in love. Got my pi in the mail along with some assorted parts and an $8 strip of LEDs today, and within a few hours I had my entire apartment wired up with lights that are all computer controlled. Where was this thing when I was 15 and stuck in the garage with a "300 in one" electronics kit?

Vordhosbn
Aug 7, 2008

Can anyone weigh in on what would be the best solution for streaming Netflix to my Pi, preferably for free or cheap?

I know there is an open-source Silverlight implementation for Linux called Moonlight out there as well as RasPlex (uses the Plex Media Server), which would need to be run on my home computer and re-streamed to the Pi. Would any of these options work or am I out of luck?

SYSV Fanfic
Sep 9, 2003

by Pragmatica

Vordhosbn posted:

Can anyone weigh in on what would be the best solution for streaming Netflix to my Pi, preferably for free or cheap?

I know there is an open-source Silverlight implementation for Linux called Moonlight out there as well as RasPlex (uses the Plex Media Server), which would need to be run on my home computer and re-streamed to the Pi. Would any of these options work or am I out of luck?

I have no idea about the Pi, but have you ever looked at a chromecast?

Vordhosbn
Aug 7, 2008

keyvin posted:

I have no idea about the Pi, but have you ever looked at a chromecast?

I've read a little bit about the Chromecast, but maybe it's time to take another look. I've just been running an HDMI cable between my laptop and TV for the past few years for all my Netflix needs, which can be a pain. The fact that it's wireless definitely interests me, especially now that I've started working with my Pi – the tangle of cords in front of the TV has begun to take over.

eddiewalker
Apr 28, 2004

Arrrr ye landlubber
Is there really any point to futzing with a Pi as an HTPC now that so many small, polished streaming devices exist?

Even if you really want emulators, can't you side load those on a FireTV?

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass
I'm yet to find a streaming player other than the (horribly buggy and slow) Western Digital TV live that lets you just browse SMB, NSF, etc. shares and play AVIs. If you don't have a lot of ripped or downloaded content then yeah any streaming box should work fine.

Vordhosbn
Aug 7, 2008

Thanks for the input, guys. I'm mostly interested in using my Pi as a fun way to learn Python and tinker around with some physical computing, but I figured it was worth looking into its media playing capabilities while I was at it and see what I could get it to do. If streaming videos is more trouble than its worth, though, I will set that idea aside.

One more question about video, though: I know that you need to buy a MPEG-2 license in order to play AVIs on the Pi. No problem, I can do that. But is there another file format that works better and doesn't need the license?

madlobster
Aug 12, 2003

Vordhosbn posted:

One more question about video, though: I know that you need to buy a MPEG-2 license in order to play AVIs on the Pi. No problem, I can do that. But is there another file format that works better and doesn't need the license?

AVI is a container which may or may not contain MPEG-2 video. Your AVIs could contain MPEG-4 video, which don't require the MPEG-2 license.

Vordhosbn
Aug 7, 2008

madlobster posted:

AVI is a container which may or may not contain MPEG-2 video. Your AVIs could contain MPEG-4 video, which don't require the MPEG-2 license.

Good to know, but I think the AVI files I'm dealing with do contain MPEG-2 video. When I try loading them in RaspBMC, the audio comes through just fine but the video doesn't. Is there another video format I could convert them to that would allow them to run?

madlobster
Aug 12, 2003

Vordhosbn posted:

Good to know, but I think the AVI files I'm dealing with do contain MPEG-2 video. When I try loading them in RaspBMC, the audio comes through just fine but the video doesn't. Is there another video format I could convert them to that would allow them to run?

Convert to H.264 with Handbrake using High Profile preset.

Naffer
Oct 26, 2004

Not a good chemist
This isn't exactly an Rpi question, but this thread seems like the best place to ask it. I've got a little Ubuntu server running from a microsd card on an arm stick and I've noticed that it writes to the SDcard a TON. If I check the number of written sectors since boot (/sys/block/mmcblk0/stat) it says I'm essentially writing over the entire card twice a day. I imagine this is going to torch my SDcard sooner rather than later, is there a particular brand card that I should get that will handle this? Is anyone running a server on their RPi that is doing something similar to their card?

Sackmo
Oct 13, 2004
I really don't think you're going to find an SD card that's made for that kind of activity. They're simply not designed for it. But there's a lot of things you can do to limit the number of writes that's happening. I found this page to be useful when I was setting up my pi.

http://www.ideaheap.com/2013/07/stopping-sd-card-corruption-on-a-raspberry-pi/

ExcessBLarg!
Sep 1, 2001

Naffer posted:

I imagine this is going to torch my SDcard sooner rather than later, is there a particular brand card that I should get that will handle this?
Most (micro)SD cards have terrible random-write (and generally random-IO) IOPS. I've found SanDisk Ultras to be passable while within the same price range as other cards, but it still doesn't compare to the eMMCs used on smartphones/tablets, which themselves underperform considerably compared to SSDs. If you did need something a bit better, I'd try a SanDisk Extreme, but otherwise it's really just best to avoid write loads on SD cards.

Anyways, the low hanging fruit is to mount noatime and use a tmpfs for /var/log. Beyond that I'd check to see where the other writes are going and whether I care about them, or if the write rates are low enough as to be acceptable. You probably also want to use the discard mount option also as it will help keep the SD card as performant as possible once a write-cycle is near completion.

Amberskin
Dec 22, 2013

We come in peace! Legit!

Naffer posted:

This isn't exactly an Rpi question, but this thread seems like the best place to ask it. I've got a little Ubuntu server running from a microsd card on an arm stick and I've noticed that it writes to the SDcard a TON. If I check the number of written sectors since boot (/sys/block/mmcblk0/stat) it says I'm essentially writing over the entire card twice a day. I imagine this is going to torch my SDcard sooner rather than later, is there a particular brand card that I should get that will handle this? Is anyone running a server on their RPi that is doing something similar to their card?

You are not swapping, are you? Check if the swapfile is actually used (if you actually have a swapfile/swap partition). If you have, and it is used, there is not really anything to fix. Your gizmo is simply not big enough (memory wise) to run what you are actually running.

Also, check if you mount everything noatime, and if you are using a tmpfs to hold the system logs, as somebody has already written.

Naffer
Oct 26, 2004

Not a good chemist

Amberskin posted:

You are not swapping, are you? Check if the swapfile is actually used (if you actually have a swapfile/swap partition). If you have, and it is used, there is not really anything to fix. Your gizmo is simply not big enough (memory wise) to run what you are actually running.

Also, check if you mount everything noatime, and if you are using a tmpfs to hold the system logs, as somebody has already written.

Thanks for the responses. I started digging to figure out what was actually going on, which is fun because my kernel doesn't have per-process IO data. I suspect that it may be related to a web app I'm running (TTRSS) that uses a php updater script and MySQL. My root drive is already set up with noatime and swap is disabled.

Naffer fucked around with this message at 19:09 on Jun 2, 2014

Amberskin
Dec 22, 2013

We come in peace! Legit!

Naffer posted:

Thanks for the responses. I started digging to figure out what was actually going on, which is fun because my kernel doesn't have per-process IO data. I suspect that it may be related to a web app I'm running (TTRSS) that uses a php updater script and MySQL. My root drive is already set up with noatime and swap is disabled.

You could try to install the iotop package to try to find the culprit.

Also this recipe I have found googling a little bit can tell you which of the "live" processes has done more I/O:

code:
cut -d" " -f 1,2,42 /proc/*/stat | sort -n -k +3
e: I have just seen you stated clearly that your kernel does not report the live I/O data. Sorry for the retardation :negative:

Amberskin fucked around with this message at 19:44 on Jun 2, 2014

Naffer
Oct 26, 2004

Not a good chemist

Amberskin posted:

You could try to install the iotop package to try to find the culprit.

e: I have just seen you stated clearly that your kernel does not report the live I/O data. Sorry for the retardation :negative:

Yea, unfortunately iotop appears to need kernel support. Iostat says I was off by a factor of two in my estimation, but that still means that if I extrapolate back from the sdcard use over the last couple days, I've put in the neighborhood of 350-400 write cycles onto this SD card. I think I might just back it up periodically and keep a spare card because I'm probably on borrowed time.

John Capslocke
Jun 5, 2007
Is RetroPie still one of the better out of the box images for emulation?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
So I've had the SD card in my Pi die. And of course in the year I had it chugging along nicely as a wireless AP come ssh server, I never once stopped to take a backup....

Mantle
May 15, 2004

How does one access the data on the SD card without being able to boot into Linux? I ran into an issue recently where running an OpenELEC update script corrupted my Linux installation. I wasn't able to boot into Linux again, so the data was irrecoverable and I just reimaged the SD card.

Or was there another option?

Guy Axlerod
Dec 29, 2008

Mantle posted:

How does one access the data on the SD card without being able to boot into Linux? I ran into an issue recently where running an OpenELEC update script corrupted my Linux installation. I wasn't able to boot into Linux again, so the data was irrecoverable and I just reimaged the SD card.

Or was there another option?

Take the card out of the PI and put it into a card reader. You might need to boot your computer with a linux live CD.

Adbot
ADBOT LOVES YOU

Qwertycoatl
Dec 31, 2008

Guy Axlerod posted:

Take the card out of the PI and put it into a card reader. You might need to boot your computer with a linux live CD.

Or run a virtual machine with linux on it.

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