Modbus-Droid Software Projects

ModbusDroid 1.0 Release!

After working on another app for a start-up and some half-written project ideas, I decided to return to my original app ModbusDroid and finally clean up some stuff that was obnoxious about my first go at it.

So here you have it, I added a landscape layout that moves the Modbus controls to the left in their own column, and the data has its own column to the right. And I fixed the issue that disconnected from the server when rotated from portrait to landscape (or vice-versa), but it still disconnects if you exit the app to avoid doing any unnecessary draining of your battery. A few other nagging bugs – there seemed to be a few exceptions from bad inputs in the settings or register offset or lengths. So I set all the text-boxes to be numeric-only keyboards and inputs. Please report a bug on launchpad if you are able to enter any alpha characters into any of those boxes with any keyboards I don’t have installed (like swiftkey – I only have the stock keyboard and swype installed, and I don’t have a physical keyboard). I also fixed some annoying bug reports that came in from the market – for the record on those, if you put “crash” in the description that is not helpful at all – if you put what you were doing, that helps WAAAYYY more, and I’ll fix it as soon as I see it and can reproduce it.

Unfortunately I didn’t clean up everything I would like to (still have the stupid “JAVA: Socket Exception, timeout while trying to make a connection” error messages instead of a more friendly message). But maybe as time allows I’ll circle back to that.

All that being said, let me know what you think about the final 1.0 release, and I hope you find the minor tweaks I made an improvement.

Going beyond 1.0

I learned a lot about android, and real application development during this project as well as when I was working on Whooznear (the prototype App I put together w/ my friend Alec for the startup now named Primmo Apps). And in all that learning, as well as everything I’ve read and learned since then I’ve realized I could do a lot better at making this app a little more friendly, and easier to maintain and extend w/ new features.

Also, since then android 3.0 came out and brought w/ it the new fragment and action bar APIs, and just a few weeks ago android 4.0 brought those features to phones. And I got to thinking there were some usability improvements that could be had on this app if I leveraged those.

So I’m thinking re-write w/ new APIs when I can find the time (who knows when that will be – I’m having a kid early next year – but here’s to hoping anyway!). Something to expand a little nicer to a tablet layout – especially in layout mode. I’m thinking something more like a grid layout, where each column would have a register number and the value in it, and the number of columns would be screen size dependent (i.e. portrait on a phone would be 1 column, portrait on a tablet would be 2, layout on a tablet would be 2 or 3 – depending on the font). And maybe I’ll cook up some other niceties – if you have suggestions feel free to post them here, or to put them into launchpad (or github – read on for more info on that).

Besides that, I’ve gotten some requests for these features (or dreamed them up after some request made me think of them):

  • Data recording to a file
  • Real tested Slave support – for some TCP to RTU bridge devices you can have multiple slave IDs, so that might be useful for some people
  • RTU support for devices that can connect to your phone or tablet that have a COM port
  • RTU over TCP – this is a use-case for some people. Might be worth looking into
  • Modbus4J library changes to be posted separately – not a feature per-se, but still a request I think is worth doing
  • The ability to put ‘names’ at certain register locations instead of the register number

Now, I’m probably not going to be able to tackle all of these requests, but I’m hoping to re-architect how I did the app (again, if I can find time) for android 3.0+ devices to include some of these. And I definitely want to separate out my changes to the Modbus4J library so that I can more easily contribute back to the community that developed it originally, and so I can more easily track upstream changes as well. Right now when people ask me about it I’m forced to say “uhhhh…yeah, I just dumped the source code into my project folder for ModbusDroid and started hacking – I couldn’t tell you what I changed.” Since then I’ve gotten a lot better about knowing how to keep projects separated and yet connected, and use these new fan-dangled DVCS features like ‘branches’ to keep my changes separate from the upstream changes.

Switching source-code management and hosting
Finally – I keep pushing everyone to for the hosting of the project, and there are a lot of awesome things about Bzr and launchpad, but to be honest, since then I’ve kinda fallen in love w/ Git. And GitHub seems to have a better community and UX vibe going on (“Fork This” is a great banner). And, bazaar apparently messes w/ some of my work software (ePDM from Solidworks), and crashes that when I right-click on stuff inside of our company vault, so I had to uninstall it for now – making it a pain every time I want to upload changes in my source code to launchpad. So as soon as I commit the 1.0 release branch to launchpad (after I finish this blog post and upload the APK to the market), I’m going to switch the project to Git – the first commit will be the 1.0 branch – and then upload to github for my hosting. Look for an announcement about that sometime later this week, and I hope for a lot of you this will make it simpler to follow the project as I think Git (and to a lesser degree Mercurial) is gaining more and more traction all the time, and I hear less and less about Bazaar outside of Ubuntu.

Thanks for your feedback so far, and keep it coming so we can make this a great piece of software for the other android faithful out there in the controls industry.