
Hands-on with the PocketBeagle: a $25 Linux computer with lots of I/O pins - kens
http://www.righto.com/2017/12/hands-on-with-pocketbeagle-tiny-25.html
======
ubercow
For me, the biggest thing with these small linux boards is the toolchain and
major distro support. I prefer making my own custom images for "production"
projects.

With Raspberry Pis, you can debootstrap with raspbian, but mainline debian
still requires some work [1][2] to make it function 100%.

1: [https://github.com/drtyhlpr/rpi23-gen-
image](https://github.com/drtyhlpr/rpi23-gen-image) 2:
[https://wiki.debian.org/RaspberryPi](https://wiki.debian.org/RaspberryPi)

Does anyone have any information about building custom images for the
Beaglebone line of boards? Is it easier or better supported? Are there any
boards out there HNers prefer for their toolchain?

~~~
elcritch
My preferred route is the Nerves project ([http://nerves-
project.org](http://nerves-project.org)). It has had support for BeagleBone’s
for a long while ([https://github.com/nerves-
project/nerves_system_bbb](https://github.com/nerves-
project/nerves_system_bbb)).

I haven’t had a chance to try Nerves with the new BeagleBone Pocket yet. There
may be an issue with using the EEPROM and the nerves flash utility fwup,
though if so I’ll likely work on adding support for it myself as the Octeva
SoC is pretty awesome for a lot of applications. Especially since it has
support for the onboard PRU’s which come in handy for critical timing.

As for the buildchain, Nerves has a Docker based build image (on OS X) or
native Linux builds both based on buildroot which you can easily customize to
include the PRU build tool chain. You can include a custome make package in
buildroot or Elixir dependencies. Though this route would require writing some
amount of Elixir.

So if Nerves is not your cup of tea, you could checkout Yocto or even raw
Buildroot or the new Ubuntu core stuff. For buildroot it’s a matter of
configuring it and putting it all in a Docker image (or similar) and using
`make` and it builds the firmware blobs for you.

~~~
hinkley
Your first link is to an elixir project by the same name

~~~
elcritch
Yes, Nerves is an Elixir project. Essentially it’s a wrapper around Buildroot
+ Elixir based runtime stack + Firmware management. Extremely convenient and
could be helpful for the OP as there’s good support for Beaglebone’s, but you
do need to know/write some Elixir to use it.

Though it’s entirely possible to have Elixir run say python or any other
scripting language via ports. Perhaps one day someone will make a general
purpose runtime image from it.

------
magnat
> In addition, its processor includes two 200-MHz microcontrollers that allow
> you to implement low-latency, real-time functions while still having the
> capabilities of a Linux system.

This is brilliant. Inter-processor communication [1] feels quite like
programming GPGPU. I wish there was a way to allow one of RPi's VideoCore unit
to access external IO.

[1] [http://processors.wiki.ti.com/index.php/PRU-
ICSS_Remoteproc_...](http://processors.wiki.ti.com/index.php/PRU-
ICSS_Remoteproc_and_RPMsg)

~~~
leggomylibro
It really is a great addition; there have been a few SoCs that packed an ARM
Cortex-M core or two alongside the big Application processor, and some FPGAs
come with small MCU sister cores. But gee, if I could produce BGA boards, I
would be making one tomorrow with:

\- ARM Cortex-A SoC, preferably one with networking built-in to minimize
layout hell like with the newer Raspberry Pis, but an ESP32 module could serve
that purpose.

\- A nice ARM Cortex-M7 core @~200-400MHz, for realtime functionality and
honestly, teaching. MCUs have huge potential for teaching about
electronics/code with minimal overhead or required prior knowledge, imo. If
your cheap laptop could also use successful educational tools like the Arduino
IDE and Adafruit's libraries for things like sensors/I2C-SPI displays/etc out-
of-the-box without requiring any boards or dongles...well, that would be
absolutely terrific.

\- FPGA core with as many LUTs as I could get at a similar ~$20 price point of
the Cortex-M, for ultra-realtime tasks like signal processing or video
encoding.

Then it would just be a fairly large software problem to make a nice GUI
interface to program and debug the peripheral cores from a generic Linux/BSD
environment.

Unfortunately I can't even do QFN reliably, so a board like that would really
limit my options with parts, and it would be huge with all the QFP-100+ parts.
Also, the idea of juggling three large processing platforms' enormous
documentation makes me shudder.

But it would be a really cool idea for an open platform dedicated to handheld
multimedia :/

~~~
leggomylibro
(Late edit) Okay, about the small onboard MCUs, I looked a bit more into it,
and these 'co-processors' actually look very limited and built into the
Cortex-A8 silicon. They only support like, a single UART peripheral and very
little else, and appear to be a custom RISC architecture.

Still, it's a promising step. The ESP8266 used a bullshit processor core and
still became really popular.

~~~
tyingq
They don't have a ton of software support, but you can do some neat things
with them:

Mac video driver: [https://trmm.net/Mac-SE_video](https://trmm.net/Mac-
SE_video)

Led matrix: [https://trmm.net/Octoscroller](https://trmm.net/Octoscroller)

More, including audio: [http://bela.io](http://bela.io)

------
peatmoss
I wonder if Minix 3 will run on the PocketBeagle? It runs on the Black and
White BeagleBones:
[http://wiki.minix3.org/doku.php?id=www:download:start](http://wiki.minix3.org/doku.php?id=www:download:start)

Also, OpenBSD is another potential option (assuming the BBB and the Pocket are
similar enough):
[https://www.openbsd.org/armv7.html](https://www.openbsd.org/armv7.html)

This has always made the BeagleBone systems relatively attractive to me... my
litmus test for "open" includes running more than just Linux.

------
ChuckMcM
Thanks kens! I had puzzled out some of that but putting it all together was
really helpful. I have a mobile robot base that has evolved over the years
with a 68HC11 (miniboad) brain, then an AtMega (Arduino) brain, and now a
Cortex A-8 (pocketbeagle) brain. The most challenging thing has been how the
same functions are different kernel to kernel in Linux (I would expect that
from OS to OS but the changes from 3.x to 4.x in Linux were fairly wide
ranging (I know, major numbers are for that but still it slows me down to have
what I know get invalidated :-)).

I used a couple of opamps to increase the voltage range for the A/D's to 5V to
be compatible with the sensors on the robot base. That is pretty straight
forward but the 'reverse' of what I normally do with an opamp (trying to go
small signal to large vs a 5v swing to small.)

------
TheAceOfHearts
What kinds of use-cases do people have in mind for this board? The 1GHz
processor and 512MB RAM seem a bit like overkill for everything I can come up
with. Although I think I'd still consider hopping on it if it included
wireless.

I probably waste way more power at home by keeping the lights on, but I always
get a bit frustrated with how much power some of these boards use. It adds up!
My college professors probably drilled power management way too hard into my
head.

~~~
DannyB2
Problem: when a certain alarm condition occurs, an LED on the control panel
needs to blink.

Dimwit #1: Ah, use a 555 timer.

Dimwit #2: Use an Arduino with the Blink sketch.

Senior Software Developer: I'll use a Linux board with a blink program running
on Node.js. The blink program will watch for the alarm condition and blink the
LED in response. The program will also provide a web based configuration
interface. What if marketing changes the requirements from a simple blink
pattern to:

blink blink (pause) blink blink (pause) etc...

The simple 555 timer approach would be too inflexible.

The arduino approach would require altering, recompiling and re-flashing the
firmware.

The senior software developer approach would be sufficiently flexible that you
could connect a web browser and reconfigure the blink pattern.

Each blink pattern can be given a name and saved. Such as the slow-blink,
fast-blink, double-blink, etc. Each pattern consists of a list of on/off
states associated with a duration in milliseconds. Anyone can point their
browser to this and reconfigure new blink patterns that become popular.

What could possibly go wrong?

~~~
cr0sh
Dimwit #0: A couple of transistors, some resistors, a cap or two - instant
flip-flop...

~~~
CamperBob2
Dimwit #-1: Specify a flashing LED

~~~
kees99
Dimwit #-2: Hey, we already have a microcontroller on this board, and it
happens to have plenty of free flash/ram/10mA-sink-gpio. Specify a regular LED
and an extra timer in RTOS.

------
komali2
I love reading about projects like these, but most of the language and what's
happening goes _right_ over my head!

Anybody have any recommendations for how I can finally start get into, I don't
even know what to call this - generalized IoT hardware hacking? Hobbyist
hardware? Arduino/RasperryPi tooling? No idea, but it's on my list of 2018
goals to build some at least basic projects on these platforms.

(Ironically I do work at an IoT company, but our platform is a little more
simplistic - plug in some component to one of the dev boards, then just write
squirrel code. I want to learn the juicy stuff!)

~~~
cr0sh
Knowing the terminology will help you to find resources.

Devices like this "Pocket Beagle" (and the BeagleBone, Raspberry Pi, and
others) all use something called an "SoC" \- otherwise known as "System on
Chip".

This is where all the essential components of an entire computer are put on a
single chip - cpu, ram, peripheral controllers, etc; generally, the cpu and
ram are large enough to implement a full OS on (like Linux). Smartphones and
tablets use similar (if not the same in many cases) SoC devices; by putting
everything on one chip, size is shrunk dramatically (at the cost of
upgradability and other things).

The Arduino (Uno, Mega) is something different - it is what's known as a
"carrier" or "development" board; what it serves is an easy way to gain access
to the pins and functionality of a device known as a "microcontroller".
Microcontrollers are somewhat different than an SoC - although there can be
and is overlap (particularly as you move into the 32 bit microcontrollers -
some have enough functionality to almost be an SoC in all but name).

The biggest difference tends to be in CPU power and amount of memory; usually
you have much, much less CPU available (sub-100 MHz and 8/16 bit is common),
and much less RAM (some microcontrollers have under 1K of memory!). They also
tend to be very inexpensive compared to SoC devices, and in many cases come in
thru-hole versions as well as 5V TTL compatibility (though both of these are
rapidly becoming less of an option).

The Arduino Uno and the Arduino Mega use two different, but compatible (in the
same family) of microcontroller chips. For the Uno it uses the venerable
ATMega328, while the Mega uses the ATMega2560. The difference between the two
is great - 32K vs 256K of flash RAM, 2K vs 8K of SRAM, number of pins, number
of hardware serial ports, number of PWM pins available, etc. Don't worry about
all this now, just know there are differences. Which you select will of course
depend on the needs of your project.

The ATMega family of microcontrollers is made by a company named Atmel; which
is now a subsidiary (I may be wrong here) of what used to be their competitor,
Microchip Technology Inc, which also manufacturers their own line of
microcontrollers known as PIC microcontrollers (they are not compatible with
each other, but who knows what the future holds now that they are owned by the
same company).

There is another company I should mention here, called Parallax. They are
really the ones that got this whole "maker thing" ball rolling, when they
introduced what could arguably be called the first hobbyist-level
microcontroller, called the BASIC Stamp. It was based on a particular PIC
microcontroller (from Microchip), with a small amount of extra EEPROM flash
memory tacked on, which would load in an interpreter for BASIC, and could be
loaded with compiled (tokenized) BASIC code to run. It essentially made the
PIC line easier to program for hobbyists (that isn't to say there weren't
hobbyists hacking on PICs - it was a big thing back in the early 90s).
Introducing the BASIC Stamp, though, opened up a new world for a lot of
people, and made microcontrollers for electronics interfacing much easier.
Before, you either had to hack in assembler on a PIC, or you had to have
access to some form of the 8051 microcontroller/processor line plus toolchain
($$), which was the other big hobbyist platform at the time.

Anyhow - back to Parallax: While they continued with the BASIC Stamp lineup
(and IIRC, they still offer it, but it isn't as popular any longer) - they
eventually went on to develop their own microcontroller in-house, called the
Propeller. It is actually an interesting device, and works in a way unlike
virtually every other microcontroller; it can almost be thought of as 7
individual small microcontrollers, each with access to a common memory area,
working in a "round robin" fashion (in essence, multi-processing in a manner
of speaking). At any rate, it's another option.

Finally, one of the other options you are likely to run into in the wild is
known as the ESP8266 (which itself comes in a variety of configurations). This
device is closer to an SoC than it is to a microcontroller - but there is a
lot of overlap. It was originally developed, IIRC, somewhere in China
(probably Shenzhen) and has been cloned out the wazoo all over (hence the vast
number of configs available). Originally it was meant as a very simple means
to give 802.11 WiFi capability to microcontrollers and other similar devices
using a serial port and a modified AT command set. You essentially interacted
with it over its serial port, and could send/receive data via WiFi - very
simply.

Initially, it was very undocumented, and the little documentation that did
exist was in Chinese. Eventually, much of this was translated, and almost
overnight it became a hardware hacker's sensation. It was cheap ($5.00 USD or
less in even small quantities - still is very inexpensive), it did it's stated
job very well, and it was small - it kinda boosted the whole IoT buzz. But
there was a ton of power lurking under the hood, and people sought to exploit
that.

...and they did! One of the first things to come out of it was something
called the "NodeMCU", which was essentially an ESP8266 running Python (hence
why it seems to have an overlap between a microcontroller and an SoC) - which
made working with it much easier.

Ok - so this is getting kinda long, but hopefully my explanations will help
you out. For googling this stuff, use keywords of "microcontrollers",
"embedded development", "system on chip", etc. Be sure to check out the
official forums for the Arduino and for the Raspberry Pi (and check out the
various sub-Reddits and blogs).

For starting out, you've already been given some good advice; just start with
an Uno (I would caution about going with a Chinese clone on first time out -
please, purchase one of the official boards, to help support the Arduino
community and company, then look into the clones - and learn the difference
between what a clone is and what a counterfeit is - and go from there).
Starting small may seem boring, but it is very easy to be overwhelmed in the
embedded and microcontroller space. With only the board, there's only so much
you can do with it, so after get your first LED blinking (on pin 13), look
into getting a cheap parts and sensors kit (so you can get a breadboard, LEDs,
resistors, and other parts to play and learn with).

Good luck!

~~~
komali2
Woah, thanks for the detailed response and mini-history!

Out of curiosity, is there something special about pin13 that everyone
recommends using it specifically for blinking a light (assuming other pins can
do the same thing?) I ask because on the dev boards I've stolen from my
company there's only "pin 2" and "pin 5" for uh, "doing stuff" on (like all
our example code is based off that, and they got grove connectors stuck on
them).

~~~
kens
The Arduino board comes with an LED attached to pin 13. So you can play around
with blinking it without wiring up an external LED.

------
Animats
It's nice that it's little and cheap. Since it's useless without things
plugged into it, it needs good ways to mount other stuff to it. Please, when
you design things like this, think of that. There are boards out there with
connectors on all four faces and no mounting holes.

(I wish the free version of QNX was still available. Linux is the wrong tool
for the job for embedded.)

~~~
HeyLaughingBoy
Urgh!

You just nailed one of my pet peeves. This is what I like about Adafruit's
Arduino interfaces and I'm willing to pay a bit extra for: MOUNTING HOLES!
Some of us build stuff that moves or vibrates and needs to be held down.

Connectors are not mechanical restraints!

------
feelin_googley
"The PocketBeagle is a tiny but powerful key-fob-sized open source Linux
computer for $25. It has 44 digital I/O pins, 8 analog inputs, and supports
multiple serial I/O protocols, making it very useful as a controller."

s/open source Linux computer/computer than can run Linux and other open source
kernels/

[https://mail-index.netbsd.org/port-
arm/2017/10/23/msg004423....](https://mail-index.netbsd.org/port-
arm/2017/10/23/msg004423.html)

------
lsllc
While I love the BeagleBone Black (and have built a number of boards for it),
the SIP (Octavo OSD335x-SM) in these is just too expensive. The SIP currently
sells for $43.73 on Digikey (it only gets down to around $25 at volumes >1K).

Given the lack of ethernet, Wifi/BT/BLE this really ought to be below or at
$10 mark (at most!) to make it cost effective for designs.

~~~
wl
Digikey has the AM3358 for $13.51@Q500. I'm sure Octavo gets a much better
price with their volumes, but this was never going to be a $10 part,
especially considering all the other stuff that goes on the package.

~~~
lsllc
The CHIP-Pro is $16 and includes a _whole lot more_ than the OSD335x-SM (sure,
the R8 is a bit less capable, but it's plenty fast for IoT type stuff).

------
digi_owl
Just wish Beaglebone and its variant were as accessible as RPi. I can right
now pick up an RPi B3 from any number of regional stores, yet i have to order
Beaglebone from abroad (and deal with all the customs and whatsnot that comes
with that).

~~~
bluGill
Beaglebone is not nearly as well supported as raspberry pi, but it is second.
There are enough interesting things that I think more people should be using
it instead of defaulting to raspberry pi. Depending on what you want to do the
beaglebone is better supported than the raspberry pi (your are more likely to
find kernel support for example)

------
amq
I wish the day came sooner when we could use linux for power-constrained
devices, leaving the classical embedded approach behind. I imagine it for
about $20, with BT, lasting for a week on a 500mah battery and running
OpenWRT/LEDE.

~~~
ianhowson
You _can_ use Linux for this sort of thing, but you have to be very careful
with the software stack.

This is identical to a modern laptop where you can hit, say, 10 hours battery
life, but the software must be asleep practically all of the time. Anything
misbehaving (e.g. Flash, mds) will keep the CPU switched on and waste power.

Smaller micros are less efficient per unit of work but they just aren't
capable of running as fast and chewing up a lot of power. You can also
compensate for sloppy code by turning down the clock rate.

If you're running a BLE device (not Bluetooth Classic), 500mAh for a week of
runtime sounds doable. An iPhone battery is 2-3Ah, and so long as cell modem
and screen are switched off, I believe that it would hit a week of runtime.

------
gsich
Sadly, no wlan.

~~~
joezydeco
Beaglebone Green has built in wlan.

[https://beagleboard.org/green-wireless](https://beagleboard.org/green-
wireless)

~~~
gsich
Raspberr Pi3 is in the same price range, why should I use this?

~~~
ChristianGeek
Actually, it seems like this is more akin to to the Raspberry Pi Zero, which
is a fifth of the price. I have the same question...why this?

~~~
joezydeco
Open schematics and kernel source. Publicly available SoC.

If you want a one-off for a little hobby project, then RpiZ is just fine. If
you are developing a commercial product and don't want to be at the mercy of
RPi or Broadcom for your parts and availability, you go with something like
BeagleBone.

