The libraries I used to test the shield included:

I followed Adafruit’s tutorial to test and become familiar with the shield. There was a lot at the beginning of the tutorial I ignored because I am using an Uno and these sections were for other Arduino variants.The first thing is to try out the RTC (Real Time Clock). This was easy and worked great. It was exciting to read:

For the RTC library, we’ll be using a fork of JeeLab’s excellent RTC library

within the tutorial. I truly appreciate the great works that we build upon!

The tutorial recommends formatting the SD. This was easy enough using this formatter:

Download the formatter from https://www.sdcard.org/downloads/formatter_4/

I then ran the CardInfo.ino sketch which came with Adafruit’s SD library.

Yippee! Here’s what I got on the serial monitor:

______________________________________________________________________

Initializing SD card…

Card type: SDHC

Volume type is FAT32

Volume size (bytes): 3644850176

Volume size (Kbytes): 3559424

Volume size (Mbytes): 3476

Files found on the card (name, date and size in bytes

______________________________________________________________________

The first two times I ran CardInfo.ino, I was guilty of two checks noted below: 1) I didn’t insert the SD card 2) I had left the SPI chip select to 4. I needed to set it to 10. I found this initial check in the sketch helpful. Taking debugging one more step, I wish all libraries were capable of providing APIs that debugged more deeply at each level. During my stint at Microsoft, we realized the layers of interdependency at both the hardware and software level. A lot of attention was put into making sure the various network stacks (e.g.: TCP/IP, security) had debugging output. It gets extremely time consuming to track down challenges without that. I feel this is an area where these open source libraries and break out boards could help save us a lot of time. However, I doubt it will sell more breakout boards. Plus, I doubt the breakout boards are put in positions that could bring a Fortune 50 company’s network down. So I can see why the extra effort is not applied to detailed testing and debugging.

I found CardInfo’s “what might be wrong checklist” to be extremely helpful in debugging the most obvious reasons why the SD card is not read.

______________________________________________________________________

Initializing SD card…initialization failed. Things to check:

* is a card is inserted?

* Is your wiring correct?

* did you change the chipSelect pin to match your shield or module?

______________________________________________________________________

JeeLab’s RFM12B Board

Since the JeeLink does not support adding on additional components, I purchased JeeLab’s RFM12B Board Kit so RFM12B can be added to an Arduino through the SPI bus. This will allow the base station to gather sensor readings from the JeeNode that was built in this post.

The kit comes with all the goodies that need to be soldered together before the breakout board can be attached to an Arduino. I used the info in this PDF to figure out where/how the resistors, capacitors, antenna, and RFM12B chip should be soldered.

Here is the breakout board after I soldered it together.









Clearly my soldering skills need improvement. I like the way the board has made it easy to remember which pin of the board needs to be wired to which pin on the Arduino (note the D13 above SCK/D12 above SD0, etc.). I outlined two other boxes which turned out to be trouble spots. I’ll cover these later.

Can You Hear Me?

Time to test out the RFM12B sending and receiving packets to the JeeNode. For this test, I uploaded the RF12Demo .ino sketch that is found within the RF12 Examples that come with the JeeLib library onto both the RFM12B board and JeeNode. The RF12Demo sketch is great for getting a feel for how well communications are working between nodes.

BUMMER…. 😦 ….The RFM12B board did not work. A Challenge! Why, why, why?

I wrote out how I eventually got the board working because I see debugging as a key part of the process of coming to something that actually works in real life – not just on paper. Debugging is an amazing learning opportunity.

TroubleShooting

Here is what I get after using the AppleScript to set up two terminal sessions (and changing the serial ports to match those used by the RFM12B and JeeNode)

The screen shot is a bit hard to read – on the left is the JeeNode (serial port AE01DTYI). On the right is the RFM12B board (serial port USBMODEMFD111). I use the ‘t’ command to (as the help notes) “broadcast max-size test packet, request ack.”). The JeeNode (left) is working. But the RF12B board is not. So I do what I normally do in my troubleshooting process: 1) self-doubt: “gee – the chances of me getting this working is small. Should I just get another one?” 2) review the RF12Demo.ino sketch and the RF12.cpp library. 3) make sure communications settings are correct. Are they both at the same frequency? Are they in the same group? What are the values for the node? Originally the RFM12B board was on node 1, group 212, and sending/receiving data at a frequency of 433MHz. Compare this to the JeeNode which was set at node 31, group 100, 868 MHz frequency.

First Change

The first change I made was to set the node /group/frequency of the RFM12B board. The RF12Demo.ino supports the serial input commands that are displayed when the ‘?’ command is enterred. Entering 8b changes the frequency to 868MHz. Entering 100g changes the group to 100. Entering 31i changes the node to 31.

Node ID’s should be unique within the netGroup in which this node is operating. ID 31 is special because it will pick up packets for any node (in the same netGroup). ID 0 is also special, it is used to transmit in a special “OOK” format.

In the future I will use different node id’s between 1 and 30.

Did it work?

Try again with the settings showing both nodes on the same frequency, within the same group, and on node 31. Nope…still doesn’t work.

Second Change My next step was to check the wiring. Was GND and + and SPI pins all connected correctly? Always a good thing to check! This time I seemed to have wired the pins correctly. My next step is to cry for help on the JeeLabs support forum. Once again, the members of this forum are incredibly helpful. I have also found them to give insightful guidance. Plutonomore recommended changing the 3v3 connection to 5v. I did, but I should be able to use either since there is a connecting pin for either 3v3 or 5v (see the image above). RE: Trouble Shooting RFM12B Board Kit? – Added by plutonomore 1 day ago It also just occurred to me that you are using an Arduino, therefore 5V, not a JeeNode 3V3.

Therefore try the previously suggested wiring setup but change the 3V3 connections on both

boards to 5V. Also you will need to have the 3x 4k7 and 3x10k ohm voltage divider resistors cheers, JohnO noted the DATAFLASH #define (I agree that my soldering needs practice!). It turns out the JeeLink and JeeNode have a data flash chip that is used for data logging. So I took JohnO’s advice and set #define DATAFLASH 0 from #define DATAFLASH 1. I saved the sketch with this change to RF12DemoUno.ino since now the JeeNode and Arduino UNO + RFM12B are different. But I am not sure why data logging would get in the way of transmitting and receiving data… RE: Trouble Shooting RFM12B Board Kit? – Added by JohnO about 5 hours ago Your soldering isn’t too bad although Rohan will be appalled – Rohan is Martyn’s son and a wiz with a soldering station. If you are happy to, can I ask that you load the RF12Demo while only changing “#define DATAFLASH 0”. With a terminal session connected to both running versions of RF12Demo and capturing output. Then press the ‘?’ once on each and follow up with a second or two of ‘t’ command. Then post the two output files that you captured.

Did it work?

Try again with these changes….Nope…still doesn’t work.

Third Change

I had sent a reply that included the images above to show my soldering efforts. It is not clear to me how to debug which resistor, capicitor, or other component I soldered is not working.

And then a YIPPEE!!!! Moment when Martynj noted:

Hmmm.. a couple of “dry” joints visible but more significantly, ANT // Vdd on the RFM12B module appear shorted. Worth a touch up with solder braid, but may prove to be terminal.

Take a look at the front and back of the RFM12B images above, focusing on the areas that have the red rectangle on them. I used solder remover to get rid of excess solder around the antenna. And then put more solder on pin on the back side of the board.

I then cleaned off the flux using the inexpensive technique noted in this youtube video. This technique seemed to work well.

Here is the front and the back of the RFM12B after removing solder around the antenna and adding solder to one of the pins for a resistor:

Did it work?

YIPPEE! This worked. I was surprised. I assumed I’d muffed up the soldering beyond repair. Luckily, I had not.





JeeNode Arduino Uno + RFM12B Board [RF12demo.10] _ i31 g100 @ 868 MHz Available commands: <nn> i – set node ID (standard node ids are 1..30) <n> b – set MHz band (4 = 433, 8 = 868, 9 = 915) <nnn> g – set network group (RFM12 only allows 212, 0 = any) <n> c – set collect mode (advanced, normally 0) t – broadcast max-size test packet, request ack …,<nn> a – send data packet to node <nn>, request ack …,<nn> s – send data packet to node <nn>, no ack <n> l – turn activity LED on PB1 on or off <n> q – set quiet mode (1 = don’t report bad packets) <n> x – set reporting format (0 = decimal, 1 = hex) 123 z – total power down, needs a reset to start up again Remote control commands: <hchi>,<hclo>,<addr>,<cmd> f – FS20 command (868 MHz) <addr>,<dev>,<on> k – KAKU command (433 MHz) Current configuration: _ i31 g100 @ 868 MHz OK 63 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 -> ack OK 63 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 -> ack > 0t test 0 -> 66 b OK 223 > 0t test 1 -> 66 b OK 223 [RF12demo.10] _ i31 g100 @ 868 MHz Available commands: <nn> i – set node ID (standard node ids are 1..30) <n> b – set MHz band (4 = 433, 8 = 868, 9 = 915) <nnn> g – set network group (RFM12 only allows 212, 0 = any) <n> c – set collect mode (advanced, normally 0) t – broadcast max-size test packet, request ack …,<nn> a – send data packet to node <nn>, request ack …,<nn> s – send data packet to node <nn>, no ack <n> l – turn activity LED on PB1 on or off <n> q – set quiet mode (1 = don’t report bad packets) <n> x – set reporting format (0 = decimal, 1 = hex) 123 z – total power down, needs a reset to start up again Remote control commands: <hchi>,<hclo>,<addr>,<cmd> f – FS20 command (868 MHz) <addr>,<dev>,<on> k – KAKU command (433 MHz) Current configuration: _ i31 g100 @ 868 MHz > 0t test 0 -> 66 b OK 223 > 0t test 1 -> 66 b OK 223 OK 63 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 -> ack OK 63 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 -> ack

The commands I typed in don’t show up. But it is easy to walk through. The cell on the right represents the serial output of the sketch running on the Arduino Uno + RFM12B Board. The cell on the right is output from the JeeNode. I typed t as input to the sketch running on the Arduino Uno.. This wrote “>0t ->66 b OK 223” out to the serial port from the sketch running on the Arduino Uno. On the left, the JeeNode received the data. The sketch on the JeeNode wrote “OK 63 0 1 2 3 4 5….” to the serial port. I type t twice to the Arduino Uno and twice to the JeeNode.

One more YIPPEE! because it was an amazing experience to “fix” this challenge!

Adafruit’s cc3000 Breakout Board