Sunday 26 June 2016

Melbourne Technology & Gadget Expo 2016 Review

Technology & Gadget Expo 2016, Melbourne MEC 26 June 2016

"Australia’s first consumer Technology & Gadget Expo" - they boasted - " will be showcasing the best and most innovative new products on the market today and what's to come"...  so quite why did the organisers shepherd us towards an electric toothbrush stand on entry?  Now just to be clear, this wasn't some kind of new-fangled high-tech infrared dental cleaning device, it's a brand of toothbrush that has been around for at least 10 years.  Perhaps the organisers were trying to manage expectations.

Of course I should have already known: it was barely 11am and people were streaming away from the venue (opening time 10am) clutching their Telstra branded goodie bags.  The organisers seemed to have underestimated the amount of people willing to accept an advanced purchase shafting by Ticketek (their various fees added almost $5 to the $25 ticket price) which resulted in a very long queue to buy face value tickets outside the venue, followed by another very long queue to get into the venue.

The exhibition area itself was disappointingly small, sandwiched between a bridal exhibition on one side and a careers fair on the other.  I guess I had expected the entire hall.  Broadly speaking this show seemed to be about VR and drones, with some other bizarre stuff thrown in.  The VR consisted of a few exhibitors with HTC Vive setups - not particularly exciting. As for giving it a go, forget it!  The queues were ridiculous (these queues snaked around and congested the venue).  Telstra had a nice but dim idea of allowing people to book a slot by text, consequently every single slot (except oddly 4.45pm) was taken for the entire day.  You can only speculate how many no-shows they had:  I'd bet my bottom dollar no one that booked at 11am was still in the expo more than a couple of hours later - there simply wasn't enough to do.

To left they had a demonstration area with a Banjo electric skateboard which was being demoed (presumably) by a member of the public.  Unfortunately the area wasn't wide enough for the turning circle of the board (or at least the turning circle this particular punter required) so he had to keep getting off at the corners to manually heave the board round to point in the correct direction.  It was a depressingly lame spectacle and witnessing it extinguished any desire for a Banjo Board.

To the right there was a caged drone area, again too small, but thanks to some extremely skilled piloting this was a good watch.  For me at least this was the only redeeming feature of the expo.  Nearby drone stands abounded, the sheer amount and variety was incredible.  It's clear that swooping magpies will soon be the least of our aerial concerns.

In between there was a weird collection of other stuff including disturbing methods of electronically tagging and tracking your kids.  For some reason this invasive tech is always aimed at children, presumably because any adult application would be considered unacceptable not to say illegal.

I was out the exit in about 25 minutes, it would have been sooner but the VR queues impeded my escape.  If this exhibition is going to return next year they are going to have to do a lot better.

Monday 9 May 2016

FRITZ!Box 7490 and Huawei E3372s M150-2

Summary: FRITZ!Box 7490 can use Huawei E3372s M150-2 for USB Tethering :)



It's quite hard to find information on router / modem compatibility.  I took a chance on a Megafon 150 advertised on eBay (Russia) as it was so much cheaper than anything available domestically.  The Megafon 150 appears to be a Huawei E3372s M150-2.  It has good frequency support (4G: 800/1800/2600, 3G 900/2100, 2G: 850/900/1800/1900).

I plugged it into the side USB port and it was quick to connect to the mobile network automatically downloading the necessary APN, so no need to manually configure the modem at all.

The Internet -> Mobile Telephone Network sub menu appeared in the FRITZ!Box configuration pages and I ticked the "USB Tethering" box and pressed "Apply" at the bottom of the page.  Returning to the Overview page now showed:


If you return to the Internet -> Mobile Telephone Network page there is now an IP address you can use to go to the modem's configuration pages (Note it seems there's a FRITZ!Box bug that shows your DNS server IP address if set rather than the IP address of the modem).

Note you can only connect using USB Tethering.  Direct mode does NOT work with the E3372s.  [FYI I have had a ZTE MF821 working fine in direct mode]

Note also the FRITZ!Box configuration pages seem to refresh extremely slowly if USB Tethering is enabled - anybody else get that?

Thursday 21 April 2016

Edimax AV500 PowerLine Adapter Security / Encryption

I've got a combination of the Edimax HP-5103K and HP-5101ES powerline adapters and they work very nicely (at least over reasonably short distances, I can't vouch for a larger property).

The documentation they come with is pretty basic (you might say awful).  Wanting to secure my network I followed the pushing the Security/Reset buttons routine as described in the instructions and everything seemed fine.  A few weeks later I bought another adapter and unfortunately it connected to the network the instant I plugged it into the electrical socket - this was not good as I thought my network had been secured and therefore any new adaptor should not be able to connect without a password.

I'm still not sure what happened, perhaps I merely reset to the default password or perhaps they never secured themselves.  The problem is it's hard to tell whether they are operating securely or not!

I found the most straightforward solution is the use the utility that comes with adaptors:  Plug the adapter via Ethernet cable to your computer.  Choose a password for the network and enter this into the "Network Name" box, check the "Set local device" checkbox and then press the "Set" button.  Do this for each adaptor.  They should now be in their own secure network.

The best way to test this is to try adding another adapter - it should not be able to connect to the network until the above procedure has been applied to it.

Note for those in Australia the iiNet PowerLine Adapters appear to be exactly the same thing as the Edimax AV500 Nano adapters.  I've had them working together with no issues.  In fact the the iiNet adapter software is slightly better, so you may like to download and try that with the Edimax adapters.  This was great news as far as I was concerned as a refurbished iiNet kit can currently be picked up on eBay for $21, now that's a bargain.

Friday 18 March 2016

Vodafone R216 Pocket WiFi with Telstra

The R216 Pocket WiFi is a nice little 4G WiFi router from Vodafone (Australia).   It's currently supplied unlocked which is nice.  Most router/SIMs seem to be plug and play these days and often there's no need for additional configuration, however my Telstra prepaid broadband SIM would not work in the device.  It found the Telstra 4G network, but remained disconnected.  The solution: go to the Mobile Broadband tab and connection menu.  Select Custom, and then set IPV4/IPV6 APN field to telstra.internet and IP4/IPV6 Number field to *99#.  Leave the other fields untouched, save and it should then be able to connect.

Sunday 13 March 2016

Eventuate with a Cassandra Event Log

I'm just starting out with Eventuate.  I've previously successfully experimented with Akka Persistence, but was looking for a little more for a system we're developing.   Although it looks a lot cleaner to integrate into a pure Scala project, we've decided to use the Java API as the core team are experienced Java developers.  The following blog articles will document our experiences and hopefully ease adoption of this technology for others.

So it all looked great in theory.... I created the Event Log actor as follows:
ActorRef eventLogRef = actorSystem.actorOf(CassandraEventLog.props("test", true));
I downloaded the latest (3.3.0) version of Cassandra from the Datastax website.  Ran the program and bang! the following (truncated) error:
 
    [ERROR] [03/13/2016 17:24:27.798] [ActorSystem-eventuate.log.dispatchers.write-dispatcher-8] [com.rbmhtechnology.eventuate.log.cassandra.Cassandra] Cannot connect to cluster (attempt 1/4 ...)
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
    at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)

In the Eventuate documentation it notes that Cassandra v2.1 or higher is required.  Perhaps I'd gone to high?  Uninstalled v3.3.0 and re-installed v2.1.13 and the problem disappeared.  I'm still a Cassandra novice, but it seems schema_keyspaces was removed in Cassandra v3.0, therefore it would appear Eventuate cannot currently support Cassandra v3.0+.

Note: to verify Eventuate was actually writting data, I fired up the Cassandra CQL shell and did a "select * from eventaute.log_test;" which showed the written events.

Wednesday 24 February 2016

Looking at MySQL data changes during manual testing

This is article 3 of 3 for a MySQL test strategy.  In article 1 and article 2 we did the spadework and set up 2 instances of MySQL on the same machine and set up replication between them.

During development I've found it useful to compare the state of the database before and after a test.  This is especially true when using database tools such as Hibernate/JPA as often the complexity of these tools results in unintended side-effects.  Rather than try to predict the various effects on the database, it's best to compare the database before and after to verify the expected changes.

There are a number of tools which can help.  Redgate's MySQL Data Compare is an excellent commercial example.  I would take a dump of database, perform a test, take a second dump and compare the two.  It worked well, however it was tedious taking 2 dumps each time and loading each into the tool, particularly on larger databases this was very slow (to the point I soon gave up).

So nowadays I set up replication between 2 instances, and then:
  1. Stop replication on slave instance (mysql> STOP SLAVE;)
  2. Run test
  3. Compare master and slave instance
  4. Restart replication on slave (mysql> START SLAVE;)
  5. Repeat
I currently use Toad to compare the 2 instances.  It is excellent freeware.

Tuesday 23 February 2016

Running MySQL replication on a single machine


This is article 2 of 3 for a MySQL test strategy.

First up, from a redundancy point of view, you're unlikely to want to run a master and a replicated slave instance on the same machine.  If the machine goes down you probably lose both.  My reason for doing this is specifically for testing during development.

See article 1 for a guide to installing muliple MySQL instances on the same machine. We'll start with a 2 instances, a master and a slave.
  1. Ensure master and slave instances have a different server-id set (see Setting the Replication Master Configuration and Setting the Replication Slave Configuration)
  2. Enable binary logging on the master: log-bin=mysql-bin (see Setting the Replication Master Configuration)
  3. As this is only a test instance the slave will use the root account to access the master access.  If this was a production system you'd want to create a replication account with more limited privileges (see Creating a User for Replication).
  4. Flush and lock the master database:
        mysql> FLUSH TABLES WITH READ LOCK; 
  5. Obtain the current log position information:
        mysql> SHOW MASTER STATUS;
  6.  Take a dump of the master database (from another command window):
        > mysqldump -u root dbName > dbdump.sql
  7. Unlock the master database:
        mysql> UNLOCK TABLES; 
  8. Import dump into slave database (assuming your slave instance is running on port 3307):
        > mysql --port 3307 -u root dbName < dbdump.sql
  9. Set up the replication link to the master:
        mysql> CHANGE MASTER TO MASTER_HOST='localhost',
        MASTER_USER='root',
        MASTER_PASSWORD='<password>',
        MASTER_LOG_FILE='as obtained from step 5',
        MASTER_LOG_POS=as obtained from step 5;
  10. Start replication:
        mysql> START SLAVE;
  11. Check status:
        mysql> SHOW SLAVE STATUS\G;

Monday 22 February 2016

Running multiple instances of MySQL on same machine


This is article 1 of 3 for a MySQL test strategy.

Inspiration came from this blog article Installing Multiple MySQL on Same Machine.

This was done on a Windows 7 platform with MySQL 5.6, the gist of it should work on other versions and platforms.

There is no need to install the MySQL binaries again (unless of course you'd like the additional instance(s) to run a different version of MySQL).

We simply need to make a copy of the data files and ensure there are no clashes with the exisiting instance

Find the data directory.  On my machine it's C:\ProgramData\MySQL\MySQL Server 5.6.
  1. Make a copy of the my.ini file and call it something different, for example, my2.ini
  2. Make a copy of the data folder and call it something different, for example, data2
  3. Edit the my2.ini file*:
    a) correct any paths to the folder above
    b) update the log files
    c) update server-id
    d) update port x2
  4. Copy the mysql folder and its contents from original data folder to your new data folder.  Note: I don't fully understand the ramifications of this and therefore these instructions should be treated with extreme caution and not used on a production system.
  5. Install a new windows service for this instance: mysqld --install MySQL56_2 --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my2.ini"

* for the record, my settings changed as followed:
[client]
port=3306 -> 3307
[mysqld]
port=3006 -> 3307
datadir="C:/ProgramData/MySQL/MySQL Server 5.6/data2" ->  "C:/ProgramData/MySQL/MySQL Server 5.6/data2"
general_log_file="XXX.log" -> "XXX2.log"
slow_query_log_file="
XXX-slow.log" -> "XXX2-slow.log"
log-error="XXX.err" -> "XXX2.err"
server-id=1 -> 2

I don't think server-id is a default setting, but it's helpful if you're going to be running replication (if not you may not need it).