Tuesday, February 3, 2015

Upgrading, isnt all it is cracked up to be

Ok, so I like to tinker. I was upgrading the server and the prototype machine today and thought Id bring things a little closer to current. I had been running Ubuntu 12.04.1 LTS on both machines. I thought Id go ahead and take them tho the latest LTS of Ubuntu 14.04.

I got all the software moved over and things were looking good. Nodejs, mqtt and socket.io modles were loaded. I got the webpage for monitoring everything going, as well as all of the lastest in the firmware for the microcontrollers saved. It was a real pain, but necessary every once and a while.

So I fire everything up, the mosquitto broker, pops right up and is running....thats good. I open a terminal and see the arduinos logged in and publishing stuff to the broker, thats good. So I fire off the pusher script, and it looks good, I have a session opened, excellent. I ( for whatever reason) decided before I open the web monitoring page to take a look at the webserver on port 5000 ( my websockets port)......fail.....really? What the heck is wrong?

So what now......well I still had the old image of the old server, I could just ghost it over and tackle it another day, but I had everything loaded, so I decided to sit down and see what was wrong. What was throwing me off was the fact that the pusher script I was using ( thanks to Robert Hekkers) was initiating a session, and reported it was ready, but nothing worked......I knew that it had to be tied to the websockets, that pointed to the nodejs module socket.io.

I did more snooping. Seems socket.io author has revamped socket.io. He has killed off version 0.9.0, and the only two versions you can get through NPM, is version 1.3.6 and a few older ones. I also found on the forums that version 1.3.6 has had bugs, in fact running on Windows, has caused a number of bugs. While I use Windows very little, when I installed the new socket.io module, I never looked at the version number. Investigating further, I was running version 1.3.6....hmmm.

I decided to see what I was running before, turns out it was socket.io version 0.9.0. So.....I uninstalled version 1.3.6 and requested the older version. Turns out the author has killed the older version, now what. I decided then to look for the oldest living version, and found it was 0.9.16, perfect. SO I installed version 0.9.16, restarted the mosquitto broker, and launched the pusher script, BINGO, now I get a session started!

I relaunched the web page and my monitoring is back, whew........I am not a huge fan of upgrading, especially when you have a working system, but every once and a while it is necessary. I figured after nearly two years, it best I go ahead and bite the bullet. Conflicts happen all the time with new systems, Im glad this one was fairly easy....

Keep coding!