
All Your Modem Are Belong to Us - zdw
http://www.rowetel.com/blog/?p=4629
======
chrissnell
I've been working on open-source balloon control software [1] for my own
balloon project that I've been building on/off for about six years. I am
hoping to use a software modem to bridge between the RF and my AX.25 packet
reader/writer [2] because I wanted to save weight. Payload weight is the name
of the game in the balloon hobby--the lighter your payload, the less you have
to inflate your balloon and the higher it will fly before it bursts. Even an
ounce matters and the competitive altitude record balloons are invariably
tiny, single-board, all-in-one payloads that are built around a single low-
power microcontroller.

There are a couple of good open source options for software-based AFSK APRS
modem/TNCs:

Dire Wolf:
[https://github.com/wb2osz/direwolf](https://github.com/wb2osz/direwolf)
minimodem:
[https://github.com/kamalmostafa/minimodem](https://github.com/kamalmostafa/minimodem)

You'll still need a USB sound card though, which adds weight and cabling. I
would love to see some open-source SBC hardware a la Beaglebone Black or RasPi
that had a high-quality sound card built onto the board and wired through a
Molex-type plug that was suitable to the bumps and bounces of flying.

[1]
[https://github.com/chrissnell/GoBalloon](https://github.com/chrissnell/GoBalloon)
\-- This was my first project in Go and while it works well, it now looks
pretty ugly to me with a year and a half of Go experience under my belt.

[2]
[https://github.com/chrissnell/GoBalloon/blob/master/ax25/dec...](https://github.com/chrissnell/GoBalloon/blob/master/ax25/decoder.go)

~~~
normaldotcom
I've been working on a balloon controller as well, although mine is incredibly
bare-bones [1]. It only reports position, altitude, and temperature; but since
it's so minimal it only weighs around 2 grams.

For your use case, you might want to consider a small external microcontroller
that handles TNC functionality, this /might/ be smaller and more lightweight
than a USB sound card.

Your payload controller software looks pretty awesome--nearly makes me want to
launch a balloon with a full Linux single-board computer!

[1]
[http://protofusion.org/wordpress/2015/10/featherhab-2-gram-h...](http://protofusion.org/wordpress/2015/10/featherhab-2-gram-
high-altitude-balloon-tracker/)

~~~
chrissnell
Awesome tracker, by the way! I'm super jealous of guys like you with actual
engineering skills that can put together a custom integrated package on a PCB
like that. Would you consider putting up your schematics and Eagle files on
Github or similar?

~~~
normaldotcom
Definitely! I have a couple issues I need to fix on the hardware so the board
runs without mods, but I plan on posting all of the hardware/firmware very
soon once I get that wrapped up.

------
jws
It's nice living in 2015 when you can code your modem in Octave, an
interpreted numerical computation language, and not put an appreciable dent in
your available CPU.

He approaches the problem at a higher level than a typical modem, for
instance, he uses predictable data in the packets as framing instead of the
deficient framing provided by the bit level protocol. When confronted with a
corrupted packet he also tries to guess the true content by doing a "what if"
analysis on the marginal bits to see if flipping them the other way fixes it.

~~~
unoti
For those that don't know-- although Octave is interpreted, the interpreted
part acts as an interface to highly optimized vector operations under the
covers. Signal processing and a lot of other tasks come down to manipulating
large arrays of data using similar operations across the entire array.
Although Octave is interpreted, these kinds of operations execute very nicely
inside Octave. Octave also lets you write those kinds of operations at a very
high level, like a = b * c, and under the covers it's doing millions of
operations.

If you'd like to give Octave a try and learn about Machine Learning at the
same time, try this excellent and fun free course!
[https://www.coursera.org/learn/machine-
learning](https://www.coursera.org/learn/machine-learning)

One of the later lessons in that class is a mind-blowing signal processing
thing. In that exercise, they show how you can put multiple mics in a room,
with multiple people talking over each other, and the computer separates out
the different sources of sounds, and outputs a clean wav file for each sound
source with the sounds isolated from each other. It blew my mind, and was
implemented in Octave. And they teach you exactly how to do it yourself.

All the above concepts can, of course, be done in C++ or NumPy or whatever,
they just use Octave to teach the course.

~~~
drudru11
I don't believe that exercise is part of the course anymore.

~~~
swsieber
That's really sad. I was hoping to something similar to that. Do you happen to
have any of those materials around?

~~~
unoti
Here are a couple of resources to get you started. Looking at these might give
you ideas of what else to search for.

[http://www.technologyreview.com/view/537101/deep-learning-
ma...](http://www.technologyreview.com/view/537101/deep-learning-machine-
solves-the-cocktail-party-problem/)

[http://m.youtube.com/watch?v=VO0d6EuGpO0](http://m.youtube.com/watch?v=VO0d6EuGpO0)
Signal Processing for Machine Learning - YouTube (even though this is for
marlab, octave is designed to be compatible)

------
nikanj
Lost me at the Windows bit. I thought we were more adult than that by now.

~~~
angersock
Then you did yourself a disservice, because the rest of the writeup is kind of
interesting.

Besides, for modern software development work, vanilla Windows is pretty
terrible compared with any of the 'nix variants.

~~~
brianberns
Really? Visual Studio is widely recognized as one of the best IDEs available,
and the .NET platform is leaps and bounds better than, say, vanilla Java at
this point. I'd like to know what sort of "modern software development" you do
that is so "terrible" on Windows.

~~~
angersock
I'll expand on both my own experience and that of TeMPOraL here.

First, to clear up something: I don't dislike Windows, I don't dislike Visual
Studio (having used it for over a decade now), and I absolutely think that
.NET is better than Java-- _if you are only deploying on Microsoft platforms_!

Windows has a number of technical advantages over most of the 'nix folks
(IOCP, for example, is pretty cool), and the documentation is like a thousand
times better. The debugging experience can be a hell of a lot better. The
drivers story is a hell of a lot better. The graphics and audio stories don't
even bear bringing up because of how far behind and fragmented the 'nix
ecosystem is. _I am not making those complaints_.

However, Windows (and again, I noted _vanilla_ Windows, not one with a bodged-
on Cygwin or git-bash) was not designed for developers. It's heritage and
primary interaction metaphor is not one that a developer uses.

The Unix Way (as popular as it is lately to badmouth) is a powerful notion of
composable simple programs. The desktop and GUI metaphor on Windows doesn't
support that. The notion of a command-line as a happy little conversation
between the user and the system doesn't exist, least of all because the
selection of default tools on Windows is so cripplingly tiny that doing
meaningful work from the command-line is near impossible (and Powershell only
kinda/sorta helps with this).

As TeMPOraL points out, a lot of software on Windows is written by domain
experts who don't actually know anything about software engineering. Even a
rank noob on 'nix quickly learns basic piping and complexity management. There
is no such evolutionary pressure on Windows devs, least of all because of the
friendly tools put into place to manage complexity.

As a result, the basic ideas of little helper scripts or small programs or
quick hacks to test ideas out are strange to a lot of devs--and when they _do_
decide to play, they end up creating applications that are Winforms or MFC or
<Microsoft flavor of decade> hairballs that are hard to update and maintain.
They usually end up with nice little apps, but the source is usually closed
and the app is large enough (due to boilerplate and IDE bloat) that a casual
contributor may have a hard time jumping in (if they can at all).

The mindset is just completely different, and not being exposed to both is
pretty bad.

~~~
brudgers
Vanilla Windows ships with PowerShell. Since it works at a much higher level
of abstraction than byte/text streams, it is reasonable for some people to
believe that it is more sensitive to developer needs than standard *nix
shells. Since it more fully integrates with Windows services, it is also
reasonable to hold the opinion that it is a better tool for system operations
than Cygwin in many contexts.

The Unix way is a good engineering approach, but it is not unreasonable to
hold that it is not the sole good engineering approach because "good
engineering" is only meaningful given a specific set of requirements, goals,
and constraints. There is plausible historic evidence that the design of
Windows was critical in the wide spread adoption and proliferation of general
computing devices into the lives of non-technical people by providing
economies of scale that vendors of alternatives did not pursue. If I had to
summarize it, I would say that Windows gave us a culture in which software
vendors were able to decouple themselves from individual hardware vendors.
While Windows was proprietary, the hardware upon which it would run was not
and Microsoft was able to make billions by selling operating systems at
affordable prices into the mainstream market.

~~~
TeMPOraL
> _Vanilla Windows ships with PowerShell._

This is a relatively recent development, and PowerShell itself is not
popularized among Windows user yet. If you've begun programming in the last 5
years then you may get some good habits; those who started earlier probably
followed the path 'angersock described.

~~~
brudgers
PowerShell came out a mere three months after JQuery.

~~~
TeMPOraL
And Scala was created in 2003, but it wasn't until 10 years later before
anyone started using it for anything. Adoption takes time, and popularization
tends to follow an exponential curve.

