Computing stuff tied to the physical world

RFM12B Command Calculator

In Software on Sep 18, 2011 at 00:01

I wanted to learn a bit more about how to implement non-trivial forms in HTML + JavaScript. Without writing too much HTML, preferably…

There are a few versions of a tool floating around the web, which help calculate the constants needed to configure the RFM12B wireless module – such as this recent one by Steve (tankslappa).

Putting one and one together – it seemed like an excellent exercise to try and turn this into a web page:

Screen Shot 2011-09-17 at 15.47.21.png

If only I had known what I had gotten myself into… it took more than a full day to get all the pieces working!

In fairness, I was also using this as a way to explore idioms for writing this sort of stuff. There is a lot of repetitiveness in there, mixed with a frustrating level of variation in the weirdest places.

Due to some powerful JavaScript libraries, the result is extremely dynamic. There is no “refresh”. There is not even a “submit”. This is the sort of behavior I’m after for all of JeeMon, BTW.

The calculator has been placed on a new website, called The page is dynamically generated, but you can simply save a copy of it on your own computer because all the work happens in the browser. The code has been (lightly) tested with WebKit-based browsers (i.e. Safari and Chrome) and with FireFox. I’d be interested to hear how it does on others.

If you want to look inside, just view the HTML code, of course.

As I said, it’s all generated on-the-fly. From a page which is a pretty crazy mix of HTML, CSS, JavaScript, and Tcl. With a grid system and a view model thrown in.

You can view the source code here. I’ve explored a couple of ways of doing this, but for now the single-source-file-with-everything-in-it seems to work best. This must be the craziest software setup I’ve ever used, but so far it’s been pretty effective for me.

Why use a single programming language? Let’s mash ’em all together!

  1. Looking very good there JC. I haven’t had a chance to test it through on my collection of desktops and browsers, but from the playing earlier today it also works on my Android phone in Dolphin and the built in webkit browser.

  2. Just a sidenote: I’m not into the rfm12b protocol. So I’d really would be helped with some onmouseover texts with explanations. Might be an idea for an extension on your work :)

  3. Neat! The page works fine in the browser on my Android phone (Samsung Galaxy Ace).

  4. Just a thought, could you make it default to the normal RF12 library settings? Or maybe have some quick links at the top which will set it to the defaults for 433, 868 and 915?

    Oh, and one of head to do it, so I dirtied my hands – works in IE8

  5. Ooh, V. useful. Though I’d like to see it generalized to cover the RFM01 and RFM02 as well ;) (and RFM22/23 series and the nRF24L01+/RFM70…) Perhaps I’ll be motivated to do the RFM01 and RFM02 sometime myself (they are the RX and TX only modules that are basically compatible with the RFM12/RFM12B).

Comments are closed.