Sunday, April 21, 2013

Dead End

It is springtime here at Mad Scientist Labs, though you would never know it.  Mother Nature has decided to totally screw us out of our spring.  Snow still covers most of our yard.  I took Buddy for a walk today wearing an old parka and nearly froze to death.

"That sucks", you must be thinking.  You would be thinking wrong.  The weather sucking outside lets me play around inside with little gadgets and gizmos.  The focus of my efforts the last couple of weeks has been trying to get my Stellaris LM4F120 (bought for the princely sum of $4.99 with free shipping) to play nicely with a little RF1100SE CC1101-based board I picked up at Deal Extreme.  The goal here, of course, is to pick up the signal from my Davis Weather Station's Outdoor Sensor Suite (ISS).  In other words, I want to get the Stellaris to tell me how cold it is outside without me having to walk the dog to find out.
Stellaris On Left, RF1100SE On Right, BMP085 Module Hanging In Mid-Air In Middle
"Should be a piece of cake", thought I.  Long ago, I had figured out the mysteries of the ISS wireless transmissions, going so far as to get my Pretty Pink Pager to work as a portable weather station.  Turns out it wasn't so simple.  It might not even be possible.

I've burned a couple of weeks on this trying to get it to work, and when it works, it barely works.  I was seeing all kinds of strange things, and I didn't know if it was my unfamiliarity with the Stellaris board or with the poorly documented RF1100SE CC1101-based module.  At times I would get a bunch of garbage.  At times I would get nothing at all.  But now I think I've come to a conclusion: if you are thinking of picking up one of these RF1100SE boards to work at anything other than 433 MHz, don't to it.  Simple as that.  And here's why.

This picture is taken from the CC1101 datasheet for using the module at 433 MHz.
Recommended CC1101 Schematic for 433 MHz Operation
And this picture is taken from the same datasheet for using the module at 915 MHz, the frequency the ISS operates at.
Recommended CC1101 Schematic for 915 MHz Operation
The two circuits are very different in the connection between the CC1101 and the antenna.  The 433 MHz recommended circuit has four inductors between the chip and the antenna, while the 915 MHz recommends either six or seven inductors between the chip and the antenna.

Now, here is a picture of my module taken from the DX website.
RF1100SE Module With Inductors Circled
Count the inductors circled in red and it becomes pretty obvious pretty fast that these RF1100SE modules are designed for 433 MHz operation.  I feared that this might be the case, and I hoped that getting a proper length antenna for 915 MHz operation might be enough.  It is not.

This is the output from my Stellaris board talking SPI to the RF1100SE with a 915 MHz antenna attached.
This Sucks
This is what I get after tweaking the register settings to within an inch of their life.  You can see all kinds of things here.
  • My frequency error (a two's complement value shown on the very right" is about as low as you can get, so I'm dialed right on the signal.
  • My RSSI value is terribly low: I'm barely seeing the signal above the background noise.
  • As tweaked up as I am, I'm still seeing a lot of bit errors.  Those packets starting with 68 and 78 are corrupted - all of the packets from this ISS should end with zero.
  • You can't see it here, but many times the radio misses the packet altogether.
In the process of banging my head against a wall, I went looking for other people using this RF1100SE module at 915 MHz and found none.  People have tried but I haven't come across anybody reporting success.  And this is why.  The CC1101 needs a very different circuit between the 433 and 868 / 915 MHz bands.  This board is designed for the one, and getting it to work at the other isn't going to happen if you expect any kind of performance out of it.

What to do, what to do?  Not quite sure yet.  Any kind of CC11xx module that doesn't already incorporate some kind of processor on it (8051, Atmega) and is cheap seems to be designed for 433 MHz.  What I'm looking for is just the RF chip itself that I can drive directly with the Stellaris board without having to fuss with two different toolchains, processors, etc.  I might have to consider a non-CC11xx type chip instead, like something HopeRF based (like this one, or maybe this new one out soon).

Anyway, this problem was just consuming me for a while.  It wasn't the "not working" part, it was the "why isn't it working" part.  I gave up several times trying to get this working, only to keep going back to it when I realized I couldn't stop thinking about the problem.  Now I know what's wrong.  I haven't been defeated.  I just realize that victory with this module doesn't look to be possible, and I'm OK with that.  You can't do what you can't do.

Mad Scientist Labs: wasting weekends so that you don't have to.

Saturday, April 6, 2013

Happy Birthday, Buddy Boy

Around April 1st, our dog Buddy turned a year old.  I say "around" because we're not exactly sure when his birthday is.  He is a rescue dog, and it turns out he is lucky to have gotten as far as he has.

I've blogged about the experience we had when we first came across the little guy.  He basically went right through somebody to come and greet us when we first visited the shelter.  "There was something about Buddy", we said back then.  One thing led to another, and we ended up bringing the little guy into our home last August.

After we got him home, we found him to be a little different than we expected.  I would say he was either On or Off.  When he was On, he was tearing around as you'd expect a puppy to tear around.  When he was Off,  he was powered down and very low energy.  We thought it was maybe because he hadn't had the best start in life.  Now that he was living with us, he was getting the food he needed to finally get growing, and all that growing would take a lot of energy.  We were wrong.

Buddy was battling bladder infections from the first weeks that we brought him home.  We were lucky to catch this and get him to the vet for treatment.  He would go onto antibiotics for a couple weeks and would seem to do OK while he was on them.  He still wasn't a dynamo, but he'd spend less time "Off" and a little more time "On".  Then the antibiotics would finish up and he'd be fine.  For a couple days.

Then he'd get sick again.  And then again.  The poor little guy went through five rounds of antibiotics for his bladder infection.  Different meds, different durations, and each time we thought that this time would do it.  He'd do OK while he was on the meds and for a couple days after they ran out, and then he'd get sick again.

His fifth round of meds wrapped up while I was off traveling on business and, as per usual, he seemed to be doing OK.  Then he got sick one night.  Really sick.  My Lovely Wife stayed up with him all night and rushed him into the vet the next day.  The news was not good.  Based on their initial look at him, they thought he might be in either liver failure or kidney failure.  My wife was girding herself for having to make a terribly difficult decision with me a few thousand miles away, and with the loss of our last dog Abby still weighing on her mind.

But we caught a break.  The blood tests came back and what they discovered was the infection in his bladder had moved on to his prostate.  They hadn't looked for this previously because prostate infections happen in six year old dogs, not six month old dogs.  Buddy was the youngest by far of any dog they had seen with this problem.  It was the astute observations of Buddy's behavior that my wife relayed on to the vet that caused them to look down this road.  The vet told her that Buddy wouldn't have made it if it were not for her.

Now prostate infections are nasty bastards.  The wall of the prostate is very thick, and it is difficult for the drugs to work their way in there.  The course of treatment the vet called up would be 12 weeks long, with medication given twice a day.  This treatment ended a month ago.  When it did, we held our breath and waited to see if the infection would come back.  My Lovely Wife watched him like a hawk.

Days passed.  Then weeks.  And now a month, with no sign of the infection reappearing.  Buddy is now "On" pretty much all the time.  He has tons of energy.  He is strong.  He tears through the house.  He runs everywhere, blasting through deep snow like a plow.
That Name Again is Mr. Plow
Buddy seems to be making up for lost time.  The infections and subsequent treatments had robbed him of his energy.  The vet was also afraid that his growth could be stunted.  But this pup is a fighter and will not be denied his youth.  He eats like ten dogs plus two and is putting on some solid size.  He now stands around 24" at the withers, and is pretty close in size to what Abby used to be.  I keep thinking he looks a lot smaller, but some pictures we have tell a different story.  Plus, big dogs tend to grow until they are 14 - 18 months, so he might have a few pounds yet to go.

An interesting side note in Buddy's time with us here was that, besides not knowing when his birthday was, we didn't know his breed either.  I mean, we had no clue as to what his breed was.  Many people saw German Shepard in him.  Some saw Rottweiler.  A few people guessed Alaskan Malmute.  I hate not knowing stuff, so we got all CSI-like and had his DNA analyzed by DNA My Dog.  For $50, you too can have a cheek swab from your dog analyzed.  What we got back was...

  • Level 2 Golden Retriever (?!?!?)
  • Level 3 Siberian Husky

Level 1 would indicated a purebred and we knew for sure he wasn't that.  The Siberian Husky made a lot of sense to me (his massive forelegs should have been a dead giveaway) but the Golden Retriever didn't seem to add up.  Then a few months went by and golden-colored bits of hair started to show up around his eyes, legs, and tail.  Looks like they were right on after all.
Not To Mention An Arse Almost As Hairy As Mine...
Buddy's lineage explains his love for the snow.  But another trait of Siberian Huskies is that they apparently like to bury things.  That explains stuff like this...
This Spells Doom For Our Garden This Year

But where we really seem to be lucking out is his temperament.  He seems to be quite a good natured little guy and will capture your heart if you give him half a chance.  He has also been incredibly well behaved as a puppy.  You hear horror stories from people with a new puppy that have their furniture torn apart.  The worst we've suffered is Buddy chewing a bit of a hole into the heel of a slipper.  He's had pretty much the run of the house whether we are home or not since he's been around eight months old, and has never made a mess in the house except when he was sick.  His crate sits downstairs unused and empty.

This is a story that certainly could have gone another way.  Could have but didn't.  We seem to have a healthy, happy, and well-behaved puppy on our hands.  That's what we had last time around with Abby too, and she turned out to be the best dog that we could have possibly hoped for.  Hopefully lightning strikes twice.