Serial to MQTT Bridge

Untitled-2

I have been using MQTT a while now and really like it. It is a simple pub/sub protocol that is perfect for components of robots to talk to each other.  The concept is basic to robotics, Microsoft included it in MSRDS before WCF incubated from it, and ROS still includes it as the core that ties everything together. When you start ROSCORE you are starting a message broker, just like you need to run a broker with MQTT. The difference is that MQTT is modern, and lightweight. So lightweight that there is, and I have used, a MQTT client for Arduino.  But it is TCP oriented.

I looked at MQTT-SN a little. But while it is serial oriented, it also seems as though it is more geared to wireless connections. You need to run a second broker, and the differences are enough that you can’t just plug it in without changing code.

Well If you need to run a separate broker anyhow, why not have it bridge to the existing MQTT broker?  This way, the other components in your system that have TCP ability do not need to change, not even a single line of code.

Untitled-1

So I threw together a lightweight bridge. It tries to open serial ports from a list. It does not freak out if it fails, devices come and go (eg. plugging-unplugging XBee adapters, Arduino, etc). And it shows a listbox of ports that did open, with activity lights.

The first test, using XBees, was on a LEGO NXT robot.  I’m happy. Here is the complicated code, running on the NXT to broadcast its pose to my PC running a WPF mapping app;

Yeah, kidding about the complicated part.

But I am really curious as to why this hasn’t been written or talked about before?  Did I miss something? Is MQTT-SN a better fit than it seemed?  spiked3 @ gmail  if you know something.

Open Source

open-source-logo

A good read on a current Open Source problem;

http://www.xda-developers.com/gplv2-and-its-infringement-by-xiaomi/

So, often I have said, “I am not a fan of open source.” and I probably need to explain that.  It is not open source, so much as it is what open source has become as philosophy.  Most people who take offense when I say I am not a fan, are the same people who will invest time and often money on related hardware in an open source product.  And today, more and more, that product is not really open source, but someone taking advantage of the open source ideology with no intent to actually follow it.  They are looking for profit, and claiming their product is open source, when it is not, it is how they hook people of that ideology.

More than once, I have looked into an open source project or product that features an open source logo in their marketing, only to discover, the piece that is open source has nothing to do with their product, and they contributed nothing to it, or that it was so trivial it took less than 15 minutes to write. Instead there is that asterisks:
“All code open source and free* (*except the part we wrote)”

Or the company that bought rights to open source code, modify it, sell it as a product and still benefit from claiming open source.  I don’t know which is worse, the new company, or the ‘open source’ author who sold it.  Did he make sure every contributor agreed and got their share?  I seriously doubt if they were even asked. It is the sellout of the 21st century.

Open source as a philosophy is good. You have 3 sectors developing software now; Business, Education, Hobbyist.  In education, students have little extra money, but probably can spend time making/molding something into working how they want. And fixing bugs is often a great way to learn.   In business, very often time is more important, I need to get something done, now, with well written and QA’d software. I do not want to spend time debugging my word processor (or E-CAD).  As a hobbyist, I am totally in the middle. I do not want to debug my word processor, but I do not want a $32,000 word processor either. So often I turn to open source, and try it until I realize the authors just did not put enough effort into the particular thing I am looking for, and for me to add or fix it would take too much of my time (even though it is free) so I use proprietary software. It has been debugged and quality tested, and someone was paid to write up-to-date documentation and tutorials on how to use it. These are things that never ever occur in open source. And the arguments that it does have been proven wrong over and over.

Open source; Broken by default™

Open Source; It’s not how big it (the movement) is, it’s how you use it.™

Please support open source. And start by rejecting those who only use it as a marketing ploy, and stop claiming that it is the only way software should be written, and the only software I should use. It is a ‘me too’ attitude instead of a thoughtful choice, different in every instance.

February Meetup Group

The meetup group I organize will try out a new space for February, and I will be discussing beta plans for some upcoming spiked3.com products.

Liquid State Machines and Coreletes

Sunday, Feb 8, 2015, 11:00 AM

Location details are available to members only.

1 Droid Masters Attending

February meetup has a new location!Regularly scheduled monthly meetup.A small, personal get together, with open conversations about our robot projects. Each month we hope to have a main presentation, and plenty of open discussion.  Small demos / videos / pictures are also welcome.  55″ TV is available for DLNA compatible files.We were invited …

Check out this Meetup →

 

I will also talk about a Robotic Competition to be hosted by the group.  If you are local to the Seattle area,  interested in either (and keep in mind the basis for this group is Robotics for PCs with a host USB, not just device USB) please attend.

First PCB install

So, I am finally getting around to installing that PCB.  No, I do not know if it works yet, I have to reroute some wires, but physically it fit. That is a good thing.

DSCN2002

 

DSCN2004

 

DSCN2006

 

Update 1/1/2015: It worked! First try.  Take that 9th grade TV repair class!

LEGOs

I’m doing some LEGO code for the upcoming meetup. I hope to get a LEGO running around with a Gyro complimenting its encoders.

So I ended up writing some Mindsqualls code that looked like this;

Overkill on the Lambdas? In a way it says what I want, do ‘x’ in the UI dispatcher thread, but in other ways, if you did not know that, you would have no idea what it’s doing.

NXT not found, Windows 8.1

A side note for those looking to get the LEGO Nxt Mindstorm stuff working on a modern Windows 8.1 machine.  I saw no mention of this anywhere, but this is the second time I fought through a day of tracking down why I could not connect my NXT V2.

Arduino has a conflicting driver it installs. Apparently both the LEGO and Arduino install a driver that detects when either is in ‘firmware download’ mode. Unfortunately, they both incorrectly detect each other. You need to make sure when you are trying to download LEGO firmware, your NXT shows up in device manager as ‘waiting firmware download’.  If it does not, uninstall the current driver and re-install the phantom drivers (along with probable reboots and praying to sky Gods). Odds are good that you will have to re-install Arduino when you go back to it. Its a mess, but eventually you can make it work.

Untitled-1

Untitled-2

Frankly I think it is a shame. LEGO has let a very good (still the best IMHO) Robotics Education system rot. In its place is a rather poorly thought out ‘update’ (EV3).  While I would like to have the power of its new processors, I do not know if I want to deal with the stupidness of its implementation.

Update: I did finally order a EV3 brick and motors.  I am not sure how much I will do with it them, since the other Robot projects have my attention, but occasionally, it would nice to have a fast idea platform.  Even the SLAM course I am doing uses an NXT base platform.

Complex

RoboNUC, to be honest, is getting big. The simple refactoring I was planning to display LIDAR data on the map, is on its 3rd or 4th week now, and is almost ready …. to start the code that displays the LIDAR data.  This is the first time a single XAML(WPF) file got so complicated I had to split it up, and moving things to resource dictionaries has some consequences (e.g. visual studio doesn’t even handle it completely).

Untitled-1

 

It does look really cool though :P

Untitled-2

Baby steps

So, yeah, I take really small first steps. One of which I did ok on this week;

DSCN1994

It is just a simple connector board, to clean up some of the wiring rat’s nest on RoboNUC. The purpose of learning to do things in Eagle through produced board was a success.  Next board will actually have parts, I promise.

Emerald City Robotics

I hosted a meetup group today. And while attendance was (expectedly) low for December, everyone had a Robot :)

I discussed plans for a business venture I am planning and it was well received … stay tuned.

_DSC8920

Robotics, hahaha