BBBlue hero

I bring a quite an interesting story today. I’ve been busy over the weekend and did a proper tidy-up on a whole power distribution and also fixed few bugs on our devices (vector thruster had a broken axle). I ended up with all being pretty ready for a hot-fire test.

Thinking to give it a go, I wrote a tiny C program to wiggle with both those thrusters.

#include <rc/servo.h>
#include <iostream>
#include <chrono>
#include <thread>
#include <random>

int main(int, char**) {

  std::random_device rd;
  std::mt19937 rng(rd());
  std::uniform_real_distribution<> uni(-1,1);

  std::cerr << "Init" << std::endl;

  std::cerr << "Turning On 6V Servo Power Rail" << std::endl;

  while (true) {
    auto r = uni(rng);
    std::cerr << "r: " << r << std::endl;
    int i = 5;
    while(--i) {
      rc_servo_send_pulse_normalized(1, r);
      rc_servo_send_pulse_normalized(2, r);
      std::this_thread::sleep_for(std::chrono::milliseconds(200) );
  // turn off power rail and cleanup

  return 0;

.. .and because it wasn’t working I asked Sebi to fix it for me and went to do something else. Sebi fixed it by adding those two lines in bold (to initiate BBB’s power rails to feed servos) and told me its ready. It took me couple hours to come back to it, but by that time BBB started complaining about its file system being in a read-only mode and I couldn’t do much except to reboot it.

Unfortunately it never made it back to life. If it would be MS Windows I would probably see something like this:

Everything You Need To Know About the Blue Screen of Death

.. but as it was “just” a BBB I saw just a dead piece of a microelectronic which’ LED ever second blink. Being bit upset about all that situation I went to sleep. I’ve been also hoping that when I’ll come next morning that problem will disappear (it really happened before!), but it didn’t. BBB was dead next morning in a same way like the night before. So I started Googling where next with that and found that there is an option to connect a serial cable to the UT0 slot and observe whole powering sequence and also interact with BBB on a lower level, but that needed a serial cable!

Googling again – found out one from China for $6, but delivery time was Christmas – next year – maybe. Luckily local Altronic store had exactly what I needed for still bearable $25. My way went straight in and I became a proud owner of the Z6522A • FT232 USB To TTL Serial Lead.

Next day I dedicated morning to some taping-magic (there was no time for proper soldering) and I was able to connect it with our BBB through the JST-SH connector which coincidentally arrived to Sebi a day before (it was on its way from China for a month). I am not proud of it, but here comes a picture whilst it is already connected.

I hastily followed that original guide, but at that stage where I was expecting to see the login prompt to BBB – there was nothing.

blech@zenith$ ls -ls /dev/ttyUSB0 
0 crw-rw---- 1 root dialout 188, 0 Sep 13 08:36 /dev/ttyUSB0
blech@zenith$ sudo adduser $USER dialout
blech@zenith$ sudo screen /dev/ttyUSB0 115200

I tried all slots, mutiple resets, adding battery, multiple configurations … very upsetting noting. So I called Andrew (who coincidentally received his own BBB a night before – but from Melbourne – in 4 days) and gave him everything to compare it with his brand new one. It took Andrew exactly 10 hours to come back with a great news – SD and eMMC images are wrong (BBB is ok).

Andrew replaced eMMC image on our BBB and returned it to my hands next day morning. I couldn’t wait to see it really working, but it still took couple hours to get it back where it was before. Still I couldn’t resist seeing it working and was happy where it started to do its first Vectoring thrusters dance. 🙂

Pretty funny, isn’t it?

However huge thanks to Andrew for saving me again!

You The Best GIFs - Get the best GIF on GIPHY

And what was wrong with that cable? Apparently it is a 5V cable, where BBBlue has 3.3V serial interface which malfunctions under 5V. So I plan another trip to Altronics – but this time I’ll be asking for a refund. 🙁

Anyway, all back to normal – next step is to see motors running on 25V!

Leave a Reply