MongoDB passes Jepsen Test! – The Industry’s Toughest Database Test

I’m really pleased to share the news that MongoDB has been acknowledged by the creators of the formidable Jepsen Test as demonstrating Data Safety, Correctness & Consistency. On February 7th 2017, Kyle Kingsbury, creator of Jepsen, published the results of his tests against MongoDB 3.4

His Conclusions are:

MongoDB has devoted significant resources to improved safety in the past two years, and much of that ground-work is paying off in 3.2 and 3.4.

MongoDB 3.4.1 (and the current development release, 3.5.1) currently pass all MongoDB Jepsen tests….These results hold during general network partitions, and the isolated & clock-skewed primary scenario.

Read more about the news here: https://www.mongodb.com/mongodb-3.4-passes-jepsen-test

The Plan

I’ve been working on the plan, or what passes as a plan for the soil sensor. Right now it looks something like this.

the plan

I don’t know if it will work yet, I’m not really clever enough to work through the numbers, but I’ve ordered all the components, so they should trickle in over the next few weeks from china. While several people have mentioned that trickle charging lithium cells is a really bad idea, I’m hoping that two layers of protection firstly within the 18650 cell and then on the TP4065 charging board will cut down the risk of explosions and fire to a manageable level. The 5v Solar Panel has already arrived and looks to be suitable for the job, but as I’ve nothing else yet, we’ll have to wait and see.

I may yet drop an Arduino into the picture in place of the ADS1115 i2C if the ESP8266 seems to be a bit too unstable and needs supervision or an external watchdog. It never really sat well with me before, but when you think about it, you can buy a knock off pro-mini for the same price as an ESP-12 so it’s not going to break the bank.

ESP8266 Analogue input expansion

I’ve just read on the Internet of Home Things blog, a great idea for expanding the number of analogue inputs that can be read by an ESP8266.  Using an 74HC4051 CMOS analog multiplexer chip you can get 8 Analogue inputs selectable from a matrix of 3 digital inputs.  Great idea.

I’ve ordered some samples of the Maxim MAX4617CPE multiplexer to see if I can get any analog(e) joy out of it.

To be fair, A Reddit thread I just started seems to come down in favour of a separate ADC. It seems the ESP8266 only has a +/- 1v on it’s solitary ADC pin, so a i2C ADC makes sense. I’ve been pointed in the direction of this Adafruit product (ADS1015 12-BIT ADC – 4 CHANNEL) and while I love Adafruit, their shipping to the UK kills me. Luckly there seem to be some chinese clones floating about which profess to do the same job.

Suffolk Harvest

I’ve just got back from a holiday in Suffolk, where is was great to see this year’s harvest in full swing.  For an engineering geek like myself, seeing the huge Combine Harvesters running through the night was a great sight.  Even better were the large stubble fields which I took the liberty of trespassing on.  Specifically, I’ve been wanting to perform an autotune, which sees the quad throw itself around a bit so that it can tune it’s PID settings.  I managed to get it into autotune, but my batteries didn’t have the staying power to see it through to the end.  I’ve given up on the Turnigy 2200mAh 20c batts now, five out of the six that I got have puffed, and I’m not willing to use them anymore.  I think the voltage sag was taking cells down below their healthy voltage and damaging them permanently.

I’ve splashed out on some turnigy nano-techs, which depending on who you listen to are either just as bad or amazingly good.   They should be a little bit more resistant to sag and perhaps will give me enough juice to get an Autotune complete.

With the camera and gimbal in place and with the new 4000mAh battery (333g) it’s now weighing in at over 1600g.  That’s a fair weight and I’m going to be ultra cautious about flying with this config.

Trust in Software

I had some fun with the Quad this evening.  I’ve been flying it in my father-in-law garden (the only fairly large private space that I have access to) testing the new 2 axis gimbal and the fake SJ4000 that I was given by Rob.  The first flight went really well, but I wasn’t doing anything more advanced than hovering in loiter mode and giving it a bit of yaw now and then.  Everything was fine (except for the stupid hard landing)

I went out about an hour later to have another go.  Immediately I’d noticed that the wind had picked up, but if I kept fairly low, this shouldn’t be a problem, and certainly not outside the envelope.  I armed in stabilise mode and took off in Loiter.  Everything looked really sweet so I let the altitude climb a little to get a nice aerial of the garden. I probably went up to about 15m (I’ve not checked the logs yet) and did two slow spins in yaw.  It was obvious the the wind was pushing the quad around quite a lot, but the GPS seems solid and Loiter was holding position nicely. I decided to come down.

Nothing happened.

My first thought was that the wind was quite blustery and must be keeping the quad aloft, so I dropped the throttle even more, in fact, I had it right down, but the quad still hung there, perhaps coming down very slowly, but certainly not listening to me. Adrenaline was pumping and figuring the best thing to do now was to try and remove any autonomous behaviour from the FC, I went back to stabilise mode.

Despite the heart thumping adrenaline, I had the presence of mind to put the throttle back up to mid stick, so that the quad wouldn’t just fall out of the sky.  Nothing. The quad still hung there.  It was still coming down very slowly and was probably about 10m when dramatically, and 5 or so seconds after commanding it, stabilise kicked in.

What happened next is never going to be a coherent story, I was panicked and outside my range of experiences with quad flying. Despite having about 50% throttle, the quad came down rapidly, not quite free fall or autorotation, but far faster than I’d hoped for.  It hit the edge branches of a small tree at about 5m which knocked it off level and it hit the ground hard but still upright, breaking both front leg extensions and burying the gopro clone lens down in the lawn.  The damage looked not much more than cosmetic so I started breathing again and pushed the throttle down and to the left to disarm, as the props were still spinning.

But they didn’t stop. I looked down at the TX in my hands and was horrified to see it dead.  No power at all.  I cycled the power button, but nothing, still dead.  I looked at the damaged quad on the lawn. I couldn’t approach it like this to pull the battery without disarming it,  and with a dead TX, it was a very dangerous and live machine.

As I watched it spinning at fairly low revs and wondering how long it would take for the batteries to die, or it to disarm it’s self, everything suddenly got much, much worse.  Without any warning, the quad throttled up to full power, and shot upwards, hitting the same tree as it had done on the way down.  It lurched wildly in the air, and I watched it, with the dead TX still in my hand shoot up and away from me at full power into the sky.  Every story, every post, every video I’d seen about fly-aways came into my head at that moment, and I knew not only had I lost it, but there was a significant chance it might damage some property on the way down.

As I think back to it now (this all happened about 2 hours ago) I can almost see the branching control structures in the code and the variables updating from the Accelerometers and gyros as the Flight Controller followed logic and paths that I had no idea about.

It dawned on me slowly as I watched the rapid gain in altitude back up into the strong winds, and the damaged legs swinging around in the down-draft from he props, that all may not be lost. The Quad was under it’s own control, in Fail-safe, attempting to execute a “return to launch”.  The first element of which is a rapid ascent to 15m in order to get clear of any danger. Still powerless to control it, with no life magically returned to the TX, I crossed fingers as the software brought the quad back to above it’s first received GPS coordinates, and a slow stable descent back to Terra Firma. Ir disarmed within a few seconds of coming to rest on the two remaining legs and the camera gimbal.  At this point, I knew it was over.

Flying multirotors is about gaining experience and tonight was a valuable lesson.  Not only about getting some new, better nicads in my TX but in how to deal with emergencies and the partnership between the human operator and the onboard software.

Printing Again

IMG_20150625_080301

It’s been a long haul getting the printer up and running again. I left it with a half finished Z probe for Automatic Bed Levelling, but it never worked quite as intended.  I’ve been spending a few hours with it this week and I’ve got it running sweet.  To celebrate I printed one of the first bespoke, made to measure parts I’ve ever done.  Talk about starting simple,  it was a replacement for a 11mm x 20mm dowel that had fallen out of one of Joe’s wooden trucks.  I sized the part in blender but despite importing a 1cm cube STL for size reference and setting the scale accordingly, I still had to scale up 1000x in Repiter, the printing software. However, in the end it was really nice to get a part out of the printer that was absolutely fit for purpose and slotted into the hole it was designed to fit.  The look on Joe’s face this morning when he saw it was worth the hours of buggering about with stupid Chinese servos and reams of configuration.

First taste of water…

I’ve just finished work on the prototype of the moisture sensor. As I type, it’s sitting, powered by batteries, with it’s probes in a hanging basket, sending data to my server in the cloud.

IMG_20150528_225628

Inside the large tuppaware box there is a 4xAA battery box, from a defunct string of Ikea Christmas lights. This powers the breadboard which still has an FTDI converter plugged into it, along with the ESP8266 ESP-12 in it’s freshly breadboard ready formfactor. The moisture sensor it’s self is a cheapo ebay special and very prone to all sorts of horribleness. Which is why I’ve powered it from a digital pin on the ESP-12, so I can keep it powered on for only as long as I need to.

It’s working, it’s sending data, the scale is wrong, and I don’t like Tupperware, but other than that I’m super happy with it.