Wednesday, February 17, 2016

Synology NAS performance to Amazon S3 and Glacier with Synology packages is poor

Ok, so I'm a long time coming to this party but just bothered to set up an Amazon account so I can store some of my data off-premise and was totally underwhelmed by the upload performance. Google it, you will see the same lamentations of upload speed plaguing folks using the Synology Glacier or regular Backup (with S3 destination) packages.

Basically, I get about 160Kbps upload for both the Synology Backup to S3 and Glacier packages on a cable connection which should by rights get me 2Mbps. Unacceptable for transfering 100's of GB of data, unless you like waiting months for your initial load to complete.

I tested (one of the many available tools) S3 Browser to upload from my PC rather than directly from the NAS. Lo and behold it will push my connection to 1.2Mbps (with maxed-out config on the free version). Looking at the basic config between the Synology provided tools and S3 Browser, I surmise that Synology's tools don't use multi-part uploads or multi-threading.

Suffice it to say, a lack of decent integration to major cloud storage services is pretty lame.

Tuesday, August 04, 2015

Raspberry Pi - adventures in home automation (h/w and s/w)

I kicked off a project some time ago around a Raspberry Pi to perform some home automation - namely to control my backyard sprinkler system. The old system got relocated during some backyard updates and the original wiring and system had seen better days so I decided to replace the old 1980's unit and wiring with a Raspberry Pi based set up.

Needless to say, I've had a pile of electronics sitting on my office desk for some months (ie what happens when done in dribs and drabs!) but it has been fun assembling pieces of kit to get this thing working.

The basic objective is to create a circuit controlled by the Raspberry Pi to manage standard 24VAC sprinkler valves attached to a residential pressure water supply. The Pi will run an app server to host the device control software and will respond to commands from a web browser based UI. It will need to have some safety features built in to ensure the system turns off the sprinklers on failure!

So far, I have in terms of h/w inventory (circuit diagrams and photos to follow in a separate post):
  • Raspberry Pi Model B+
  • WiFi USB dongle
  • 4 Relay module
  • 24VAC step down transformer
  • Some wiring (raw wires and header pin leads)
We're at the conceptual stage but have shown that the relay board can be triggered via the Pi's GPIO array which is the foundation for starting on the control software.

In terms of software, I have the following:
  • WiringPi utility (for initial testing with the Pi's GPIO interface)
  • pi4j library (which I later discovered and found and makes more sense to use from Java than executing external processes such as the gpio utility from WiringPi - CGI, anyone???)
  • glassfish J2EE app server (for running the control software)
  • NetBeans IDE running on Win7 for development
I basically followed the directions here to get the Pi set up to run the glassfish server. As the main points of difference I created a user 'glassfish' to run the server rather than the pi account itself and I loaded the glassfish 4.1 full server, not the web profile. It takes some minutes to start up, even with the Pi overclocked to 950MHz. Maybe the web profile version is lighter weight but I haven't tried it.

You will need to set up NetBeans to be able to see your glassfish app server on the Pi. Do this under the Tools->Servers menu in the NetBeans IDE. You should see the server under Services->Servers. The next thing to do is get your project to use the remote server explicitly by right clicking your NetBeans project, selecting 'Properties' at the bottom of the menu then selecting from the category tree on the left 'Run', then select the server you created. This will run a lot slower than your desktop app server (say 20+secs for a deployment) but we'll have to live with this to get access to some of the Pi h/w and utilities such as WiringPi/pi4j which won't be available on the default local app server on your dev box.

To use the pi4j library in your dev environment you will need to make the library available to the NetBeans IDE. I am new to this IDE so in the event you are too then under the Projects tab look in the tree for Libraries then Add JAR/Folder... then use the file system browser to select the pi4j-core.jar file and similarly the pi4j-core-javadoc.jar and pi4j-core-sources.jar files. The latter will help some context menus to work in the IDE should you for example want to see javadoc for pi4j.

To run the pi4j code in your test/runtime environment you'll need to make it available to your app server - in this case the glassfish app server. To do this I fired up the glassfish admin server on the Pi (ie 192.168.1.x:4848) after following the installation instructions for the Raspberry Pi on the pi4j link above. Remember that glassfish on the Pi isn't speedy. Also, I found the admin console didn't work with Chrome Version 44.0.2403.125 m but works ok with IE11. Go figure. Chrome shows a message about detecting a long running process then the page never displays. IE11 shows the same message, but eventually displays the page.

You can find the glassfish server reference manual here but in short this is what I ran to load the 3rd party pi4j libary into the Pi's glassfish app server instance. Adjust paths for your system accordingly.

glassfish@raspberrypi001 /opt/glassfish/glassfish4/bin $ ./asadmin add-library --type ext /opt/pi4j/lib/pi4j-core.jar
Enter admin user name: admin
Enter admin password for user "admin":
Command add-library executed successfully.



The add-library command requires a restart of the server so do that now:
glassfish@raspberrypi001 /opt/glassfish/glassfish4/bin $ ./asadmin start-domain domain1
Waiting for domain1 to start ........................................................................
Successfully started the domain : domain1

We may later find that additional libraries are required - there are three other JARs in the pi4j directory.

Anyway, this is about what I've discovered around setting up the development and test environments to date. I will come back with any edits or updates here, or cross link to new posts as further progress is made.

Tuesday, March 11, 2014

Smart (dumb) TVs - sudden loss of wi-fi connectivity on Samsung 7-series smart TV

UPDATE 13/4/2014: Problem solved. Thanks to Samsung and their local service partner, the problem was resolved by replacing a faulty wi-fi module (WIDT20R) at no cost despite being out of warranty. Balance has been restored to the universe.

I have a Samsung 7-series (UA55ES7100M) smart (dumb) TV. It has a nice big screen, good picture and is generally easy to use. I question most of the smart TV features, and have never used the 3D feature, but this is what came with a TV with a 55" form factor when I bought it. Since I got it unpacked, it's been hooked up to my home network wirelessly, initially over 2.4GHz then later 5GHz wi-fi after a router upgrade. Streaming of HD content was always smooth and problem free and Plex came along and made for a nice client through which to access this content. Recently though, the wi-fi connection has been decidedly flaky, and now doesn't really work at all despite no apparent changes in my home network setup.

Symptoms:
  • No wi-fi connection from Samsung TV to any wi-fi access point I have
  • Menu->Network->Network Settings allows wi-fi scan
  • Not all access points show up to TV (all are set to broadcast SSID), despite them being visible to a multitude of smart phones, laptops and tablets from various manufacturers anywhere in the house, including near the TV in question
  • Network Settings dialog box would bomb frequently after a scan for no apparent reason. Identified wi-fi SSIDs would be displayed for a fraction of a second then return to the TV display.
Attempted resolution paths (none of which worked...):
  • Tried to set up multiple wi-fi access points (RS6300 at 2.4 and 5GHz, cable modem/ethernet/wi-fi router, Samsung Android AP). When these can be seen (not consistent), few, if any, successful connection attempts were made.
  • Removed all authentication to see if that made a difference (it did not)
  • Changed various radio settings in the access points, including forcing different versions of 802.11
  • Tried to manually input IP address, DNS, gateway, netmask etc parameters in TV network settings but to no avail
  • Did shut-down (via IR remote control) then power-down (at the wall) and restart of TV between network changes
  • Released and renewed IP address on other devices on my home network to confirm the DHCP server was working correctly (it was)
  • Reset both wireless routers
  • Did full factory reset of TV. You won't find this in the manual, but for the model listed above you need to turn the TV off then press the following buttons on the IR remote control in quick succession: Info, Menu, Mute, Power. Note that the reset option under Menu->Support->reset doesn't touch network settings. The network set-up for wi-fi failed in the manner described previously, and for what it's worth, it took about 5-10mins to restore all the other TV settings from scratch via the setup wizard.
  • I did NOT try to use a LAN cable (not really an option for me), but most people seem to report this generally works fine.
I appear to have v1040 of the TV firmware installed (via an online upgrade when the wi-fi set-up was working - strangely though, this version doesn't seem to be available on Samsung's website for download and installation via the USB method).

I have not yet tried to contact Samsung for support and can see that plenty of other people out there have experienced this issue, but none that have reliably fixed the problem (short of replacing wi-fi hardware module in the set itself).

The rest of my home network continues to work just fine and none of the access points have physically moved or been reconfigured or reflashed, and internet connectivity works fine for all connected devices.

Anyone out there had this issue and found a way to fix it?