Re-flashing a WRT54GL running HSMM Ham Mesh firmware

I recently flashed the firmware on a spare Linksys WRT54GL to take a look at ham radio mesh networking on 2.4GHz re-using WiFi routers like the WRT54. I wanted to flash the router back to regular WiFi router firmware, and turned out this was more difficult than it should have been. For future reference, here’s a few notes.

The HSMM-Mesh firmware (3.0) has an admin page to either upload a new firmware to flash, or download an existing firmware from a list of available firmware versions. Neither of these worked for me – uploading a firmware gave an error that it wasn’t recognized, and then the router was connected to my network for internet access, it didn’t give any firmware options other than later versions of the HSMM firmware.

Elsewhere there are instructions for using the tftp approach to ftp a new firmware to the router as it boots. This seemed like an easy option, but I could not get it to work despite trying multiple times.

Instructions for OpenWrt here give steps for ensuring the tftp feature is enabled… this apparently is key, as before following the steps I could not get it to work, but after setting this options it worked first time.

ssh to the router using:

ssh root@10.72.105.9 -p 2222

this is the ip that my HSMM had on starting up, and sshd on the HSMM firmware is enabled by default and listening on 2222.

From thr OpenWrt page above, enter these commands to setup tftp:

nvram set boot_wait=on
nvram set boot_time=10
nvram set wait_time=10 #important for some models
nvram commit && reboot

Before the reboot step, set your ip address on laptop connected to router as:

192.168.1.2
netmask 255.255.255.0
router/gateway 192.168.1.1
Reboot router, start following the tftp procedure to upload the firmware:

If you are seeing WRQ messages with tftp trace turned on, the router is responding, but not yet accepting the tftp upload. You need to wait until you see messages like this to indicate the transfer is occurring:

sent DATA <block=6562, 512 bytes>
received ACK <block=6562>

These will repeat several times a second until the upload is complete, then they will stop, tftp will disconnect, and you’ll see the router power light flashing, indicating it is rebooting. Wait a couple of minutes until the lights are back to their normal state, and then try hitting the admin page for the new flashed firmware at 192.168.1.1

Does the leadership shakeup at Microsoft mean their Phone business in finally dead?

Microsoft have struggled forever to get a foot in the mobile device market, with a trail of failed products and mis-steps over the past years. Who even remembers Project Pink (here), the Kin One and Kin Two, or the time they bought Danger and then had a server failure and lost all their user’s data?

With Microsoft announcing recently that it’s haemoaging cash on it’s mobile business, and that Stephen Elop, the ex-Nokia chief and lead of the Mobile Devices Group, is out the door in the recent exec shakeup, you have to wonder just how much focus Microsoft is going to put on it’s promise of Windows 10 to be the OS to run on all device types. Maybe all devices as long as it’s not a Nokia phone, or all devices but not phone hardware coming from Microsoft. Which at this point this probably means any phone at all – without Nokia Windows devices, what devices are left?

I doubt anyone’s upset that we won’t see Microsoft phones running Windows 10, but it is sad that at this point, Microsoft’s failed acquisition of Nokia most likely means that Nokia, as a brand and as the phone, is now dead.

AngularJS and Google Maps – dynamic marker updates

I have a need to dynamically create and display markers on a Google Map. Statically declaring a single or an array of markers seems pretty easy, but updating an array of markers so they are displayed and removed over time seems more tricky using the available AngularJS libraries for Google Maps.

The two libraries I have looked at are:

Both offer AngularJS directives to insert a Google Maps into an existing page. Let’s take a quick look at each approach.

Angular Google Maps

With Angular Google Maps, use the provided directives to insert the map and an array of markers:

[code]
<ui-gmap-google-map center=’map.center’ zoom=’map.zoom’>
<ui-gmap-markers models="markers" coords="’self’" modelsbyref="false"/>
</ui-gmap-google-map>
[/code]

In my Controller I’ve added a map object to $scope with values for center and zoom:

[code]
$scope.map = {center: {latitude: 37.7699298, longitude: -122.4469157}, zoom: 12};
[/code]

… and to add the initial array of markers (random markers in SF):

[code]
var marker1 = {id: 1, latitude: 37.7699298, longitude: -122.40};
var marker2 = {id: 2, latitude: 37.7699298, longitude: -122.45};
var marker3 = {id: 3, latitude: 37.7699298, longitude: -122.46};
$scope.markers = [];
$scope.markers[0] = marker1;
$scope.markers[1] = marker2;
$scope.markers[2] = marker3;
[/code]

Since the markers array in $scope is reference by the ui-gmap-markers element, setting the markers array to [] deletes the markers from the map, and adding them back re-adds them back to the map. The property ‘coords’ is the name of the property on the object passed to models that contains the objects with the latitude/longitude properties for each marker. modelsByRef=”false” seems to add support for watching changes to the model.

ngMap

The ngMap approach is very similar. To add the map to a page with a repeating list of markers:

[code]
<map style="height:100%" center="37.7699298, -122.4469157" zoom="11">
<marker ng-repeat="pos in positions" position="{{pos.lat}}, {{pos.lng}}"></marker>
</map>
[/code]

To create the markers, create an array of markers with lat and lng properties, similarly to Angular Google Maps:

[code]
var marker1 = {lat: 37.769, lng: -122.44};
$scope.positions = [];
$scope.positions[0] = marker1;
//etc
[/code]

Summary

Since my app needs to dynamically add and remove markers for display to the Google Map, this was my primary requirement for selecting one of the libraries. I struggled to get this working initially with Angular Google Maps, but seemed to work straight out of the box with ngMap. Most of my struggles though may have been related to my misunderstanding of how $scope works in AngularJS (which I’m still learning), so maybe at some point I should go back and re-evaluate both of these again once I have a better understanding of AngularJS.

I put together a sample app that uses both of the libraries, which you can find on GitHub here: https://github.com/kevinhooke/AngularJSGoogleMapsExamples

Also, my final usage for ngMap you can see in action in my app, SpotViz, which is available here: http://www.spotviz.info/ . It allow Amateur Radio operators to playback an animated display of received station locations over time from log files from a digital mode application called WSJT-X.

 

OpenShift 2.0 Hot Deploy option

I’m not sure why I haven’t tried this earlier, but by default, when you git push your updates to OpenShift Online, it stops all your cartridges, builds, deploys and then restarts everything, which can take a few minutes.

OpenShift 2.0 supports a hot deploy option to minimize the amount of time that your app is down – details are in the docs here.