* A platform with less legacy crap than x86 is wonderful for learning about OS development. I don't know how the Pi fares for this, with Broadcom's chip and all, but if I had the free time to hack an OS in my spare time, not dealing with all the thirty year-old cruft nor shedding a gazillion EUR on a PowerPC system would be ideal.
* There's a legitimate audience of visual artists, musicians or just tinkerers who, as outrageous as might sound to us, long-bearded bit twiddlers, find learning anything other than Python either hopelessly complicated or just not refreshing enough. Aye, their needs would be better served by a 5-dollar MCU, but when an extra twenty dollars buying you the ability to write the code on the same computer that runs it, it's hard to resist. I find myself breaking the sacred oath of not using even one bit more than I need, too, because it's Saturday and my cat wants some attention too and I derive far more pleasure from seeing the jukebox playing music than from knowing the half-done file loader module that will eventually be part of a jukebox eighteen Saturdays from now on is so optimized that even an optimizing compiler would slash its veins in envy.
* The "cheap webserver" part is generally useful when you actually want one to interface something with the outside world over the Interwebs. I find the idea of using HTTP for much of this rather... repugnant, but there are people to whom it isn't, and a VPS isn't of much use if the requirement is to toggle this relay in response to that HTTP request.
Actually I'd say the x86/PC is probably one of the best-documented and most stable platforms out there to learn on at the moment, precisely because it has been around for so long. Largely due to Broadcom policy the Pi is notoriously closed and proprietary at the hardware level, and unless there is somehow a massive amount of reverse-engineering like what happened with early home computers (which were better documented so the process started more easily), or a datasheet leak, the situation is unlikely to change. Any of the other open ARM devboards in the same price range would also be good candidates for OS development, but not the Pi.
Unfortunately, that also means there's a lot of inconsistency, conflicting advice and outdated code that beginners take for granted. It's quite annoying.
What would you suggest instead? I'm considering just firing up QEMU and it's ARM baseboard target then dealing with porting to real hardware later, but there's something exciting about seeing a real circuit firing up your kernel that makes me smile.
I had to deal with them before, so if you can, stay away from cheap Chinese boards or hackable routers. When you're just learning, it's not worth it, the dollars you save will be more than made up in working around subtle bugs and trying to figure out what the poorly-worded, incomplete documentation is trying to convey.
I also warmly suggest not to bother with anything that says Atheros or Broadcom on the case. Their documentation is hopelessly tucked away behind a gazillion NDAs you have to sign, and working based on leaked material isn't fun. As for their SDKs, if you could get me started (but you can't because I signed that gazillion bazillion NDAs and I don't wanna go to jail), I could talk for days.
Sadly, I haven't worked with it either, but the Beaglebone Black looks like a good option and there's an actual community around it.
I'm setting up QEMU to have a crack at that while I wait for it to arrive. Thanks for the advice! I wish I could get you started, damn NDAs, I reckon you'll have a few stories to tell
I don't know of any documents, but the way you'd generally want to do it is wrap hardware- and board-specific parts of your code in a hardware-agnostic interface which is what you use to write higher-level code in the system. That way, getting the OS to run on another CPU or board is all about writing the relevant callbacks. You can get the general idea from Linux's mach-* and plat-* files. This isn't really OS-specific; I'm pointing at Linux because it will probably be easiest to get documentation about it, though my personal preference is elsewhere.
Here's a huge list of others: http://socialcompare.com/en/comparison/low-cost-arm-boards
There was also a small Pi emulator posted as part of the StarFox project on HN a while back.
It's also an attempt to get right what the OLPC people got wrong (too expensive, too different from all other systems).
It has to have a decent display, which really rules out microcontrollers (an early prototype was indeed an AVR that ran Lua and output composite video). It has to be cheap, and indeed it is cheaper than all the other full-fledged Linux boards with larger processors and more RAM.
> The use case of the Pi is a computer that can be given to small
> children to be theirs,
I completely agree with this part... > to be a counterpart to the BBC Micro of thirty years ago.
But I don't really agree with this part. The BBC Micro was much more expensive in real terms when it launched, and never got down to an equivalent price during its lifespan. Only when it became a hand-me-down, replaced by something more powerful, did it have become the property of a kid. (I saw this happen with several friends.)The Pi is something new --- its the first computer truly designed to be owned by almost all kids, from new. It's so cheap, and uses equipment most people have already (especially the TV), that only the very poorest can't afford one, and it's cheap enough that destroying one whilst tinkering isn't a disaster.
Speaking of "hand-me-down", the pi kind of kills the used/junker PC marketplace for little experimental projects, when you can work on your project instead of debugging old/worn out hardware for only $40 or so. Also it uses about 1/10th the power of a repurposed desktop, so why not.
For an experiment, I could pick up a free, dusty, worn out desktop that draws 100 watts and stick a new small/tiny hard drive in it for about $50 and have a giant paperweight that needs hardware troubleshooting, or spend the same cash on something tiny that draws about as much power as a clock radio and is new so presumably more reliable.
Its hard to justify picking up junker "free" PCs in the era of the pi.
I have another Pi working as a drop-in replacement wifi router that routes data via a USB data dongle in case my main internet connection fails. This too may be too much to ask from a $5 MCU.
That said, I use mine as a simple NAS for backups.
Not to mention that there are plenty of ways to use the rPi that don't require compiling. I myself use an onboard Lua environment, which just plain rocks .. ssh in, open up vim, edit Lua .. run in another terminal. Quite a comfortable environment, and I hardly even care that its on a 'small/slow CPU' (after all, I lost interest in the speed race decades ago. Those of us who grew up building the Linux kernel on MHz-class machines don't feel your pain.)
For pure C/C++ projects, I use cscope+vim+make on the rPi. For Lua projects, just vim .. and a few judicious 'watch ./ make' style sub-cmds in another shell.
GUI editors are not your friend, I accept that. But there is more beneath the hood than such a dilemna as not enough RAM to load bitmaps ..
If you're writing C/C++ you can set up a cross compilation tool chain to write and compile code on any Linux machine. It's a pain but there are lots of blogs posts and guides on it.
- Stick it on the back of your 3D printer and run OctoPrint on it to give a nice web interface for your 3D printer (and a web cam for time lapse capture).
- Connect it to my digital piano to record playing sessions and upload the MIDI files automatically to dropbox without me having to push any buttons except the "on" button on the piano.
There are a thousand other use cases where you want something more than a microcontroller, you just have to use your imagination!
I don't think a $5 microcontroller would have run a tiny web server, tiny email server, or the plotter code that forms the core of the project.
The Pi is a fine budget Linux computer. It's not fast, it's not powerful, it's not expensive.
But it's fast enough and powerful enough for embedded applications you can put online without breaking a sweat.
There are some standard 1-wire temp sensors - docs are easy to find online. The 1-wire protocol allows for really long cabling and doesn't need external power, so it's ideal for this kind of project
There's some incredibly simple Python code controlling the relays and reading the sensors, and GNUPLOT runs off a cron job to plot the temperatures to image files that get served in a web page via lighttpd.
Because I don't have a static IP at home the Pi pings my Linode server with its IP address every minute, and the Pi server web pages are wrapped in an iframe that pulls them off the current home IP.
The whole thing is a total hack, but it works well enough. Bottom line is I can see the indoor/pipe/tank/outdoor temps from anywhere, and the heating turns on if it thinks the pipes are going to freeze, and turns off if the water in the tank and/or room temps are warm enough. I can also turn the heating on and off remotely.
It wasn't quite trivial to do, but it wasn't a hair-tearing challenge either. So far as I can tell, it was easier than it would have been with alternative boards.
Basically anyone who knows beginner-level Linux server set-up and some very basic electronics should be able to build something like this around the Pi. It's perfect for this kind of embedded micro-server/controller project.
From your description saying "relay", I'm presuming this is electric heating?
Do you find that this keeps all the rooms around the right temperature? The usual problem with a normal heating system is that you have parts of the house that regularly are hotter or colder than the rest, so I was wondering if you had managed to solve this.
I'm looking to control radiator valves electronically, which of course relies on someone actually making electronically controlled radiator valves that don't cost a stupid amount of money.
Documentation: http://blog.tafkas.net/2012/10/03/gathering-and-charting-tem...
So, there is one pretty good use for an rPi.
It works fine to stream stuff from YouTube, too. Shows for kids, etc. The XBMC remote on my phone is pretty handy too.
Overall, I'm pretty happy with it.
The Raspberry Pi designers made a bunch of, IMHO, totally bone-headed design decisions early on (e.g., RTC "costs too much", but let's throw on a bunch of expensive ZIF connectors for overpriced peripherals that nobody will use) and the B+ is a move in the right direction to fix that.
My use case is "wifi terminal server." Which is to say that I built a battery-powered RPi system to connect Sky Safari on my iPad to a go-to telescope. The official Sky Safari wifi peripheral is $180 and can't even act as an access point! With the RPi, I have a better uart bridge (in that it runs hostapd) for one third the cost of the official solution. Plus, there is the possibility of adding auto-guiding using the gpio pins and some hacking.
Some projects, such as the weather station, justify the use of a full-fledged OS, but with the cost of buying an existing, proven, weather station being so low ... why bother?
And for a cheap webserver? A $1/month VPS is more powerful than this thing.
Can anyone tell me what is the use case of this?