Reverting to Type http://www.practicalreason.net Mon, 20 Aug 2018 09:45:31 +0000 Joomla! - Open Source Content Management en-gb Cannot Communicate with Battery http://www.practicalreason.net/item/36-cannot-communicate-with-battery http://www.practicalreason.net/item/36-cannot-communicate-with-battery

My secondhand Canon 7D suddenly developed a "Cannot Communicate with Battery" warning recently. I didn't think much of it at the time as the camera still worked perfectly. The only minor annoyance was that the battery power indicator no longer appeared on the top LCD window or in the battery details screen in the main options panel. However, the problem became far greater when a week later I grabbed my camera to head to a small school event only to realise that the previously fully charged battery was now empty despite next to no usage.

After some quick searching online I found that this problem is quite common with the Canon 7D: it's due to a motherboard screw becoming lose and eventually coming to rest somewhere that causes a short that not only blocks the camera from communicating with the battery but also causes the battery to discharge even when the camera is powered off.

Both the videos I watched online showed the offending screw as being located on the underside circuit board next to the camera chamber. However, when I opened up my camera the same screw was intact. Taking off the entire back panel of the camera so I could get a better look at the main motherboard showed no missing screws either. Neither was there any rattle or sound of any loose screws when I shook the camera.

Dejected, I began to doubt the "loose screw" theory. But further reading only offered alternative options that involved putting the camera in a freezer for "6 or 7" minutes as some people maintained the problem was due to temperature related expansion and contraction of battery connector components. This didn't seem to be a very scientific approach so I decided I wasn't going to go down that route, at least just yet.

About the give up and resort to flying blind with my battery indicator plus the added awkwardness of having to take the battery out each time I finished with the camera to stop it discharging; I decided to have one last look around the inside of the camera. Thankfully I somehow spotted a screw that had lodged itself next to the motor's magnet. Where this screw came from, I have no idea. All the obvious screw holes were intact. This must have come from somewhere out of sight, perhaps behind the main motherboard. I plucked the offending screw out and did a quick battery test: everything was back to normal. The camera was once again communicating with the battery.

I decided to leave the screw out entirely instead of dismantling the camera any further to locate where it came from. Perhaps this is a risky tactic and make the inner components prone to movement. I'll just monitor the camera for the next few weeks and months and see how it performs. If additional problems start to crop up at least I'll know the likely issue. For now, I've got a fully working camera again so I'm pleased.

Here are the videos I found useful:

Another video of how to dismantle the camera:

I also found this link useful:

https://photo.stackexchange.com/questions/16152/how-can-i-fix-a-cannot-communicate-with-battery-error-on-canon-7d
]]>
dermot.ohalloran+dohalloran@gmail.com (Dermot O'Halloran) Blog Sun, 11 Feb 2018 20:55:01 +0000
Rural Broadband Woes http://www.practicalreason.net/item/35-rural-broadband-woes http://www.practicalreason.net/item/35-rural-broadband-woes

Until recently, Eircom's fixed-line ADSL service was just about adequate for my broadband needs. But at over 4km from the exchange the average speeds of around 1.5Mbps download and 0.4Mbps upload have become primitive in comparison to what's available from the newer fibre and mobile broadband services starting to roll out across the country. Things took a turn for the worse a few weeks ago when, despite repeated calls to Eircom support, the best stable speeds I could get dropped to about 0.54Mbps. I even took a screenshot. Something to show the grandchildren in years to come:

Eircom ADSL Speeds

The main contender as an alternative to Eircom fixed line is Vodafone Mobile Broadband. We've been lucky to have a really good Vodafone 3G signal in the area where I live (the village of Dualla) the past few years. Fortune shone again about 6 months ago when a 4G signal became available - despite it still being unattainable in more built-up areas close to us, like Thurles, for example.

Other providers such as 3 and O2 offer plans with more data but their signal is non-existent in our area. And while there are other wireless alternatives available in the area, such as Premier Broadband for instance, their packages are currently not much ahead of Eircom in terms of bandwidth (around 2MB up/down) and there's also no guarantee their service will work due to line-of-sight issues.

So I decided to experiment with two possible solutions: Vodafone and Meteor. Both plans have cooling off periods meaning I could try them both for 7 days (14 days in the case of Vodafone) with the option of a "no quibble" return and refund if they proved unsuitable.

Vodafone

Vodafone have easily the best quality signal and the Huawei R215 device that came with the package detected a 4G connection almost anywhere in the house.

Huawei R215

The best location however was the attic where I could get speeds of around 18Mbps and ping times of 30 - 45ms.

Vodafone 4G Speeds

So what's the problem? The main impediment so far with moving to a 3G or 4G service has been the lack of a plan with unlimited data. Because I do a lot of work from home I could easily go through 40-60GB of data a month. But the best Vodafone can offer at the moment is a plan with a data usage limit of 20GB. This is paltry; especially in terms of 4G bandwidth. Another annoying factor is that Vodafone require a minimum 12 month contract at about €30 per month -- I don't want to be tied into something for this long.

The real deal breaker however is that I want to hook the modem into a TP-LINK MR3220 3G/4G router I have so I can distribute the signal around the house. Try as I might I could not get it to detect the R215 device no matter what settings I used.

So, while a great performer in terms of speed, the Vodafone solution had just too many niggly issues to make it a runner.

Meteor

The Meteor router came in the form of a Huawei E5377. The package is branded as XXL and costs 24 euro per month including VAT and the data usage limit is 30GB.

Huawei E5377

When I initially turned it in I could only get a 2G signal. I had feared this as my understanding was that Meteor shared the O2 network which has a very poor reception around here. To my surprise, however, when I took the router into the attic I was able to get a strong 3G signal. Here's a sample speedtest:

Meteor 3G Speeds

So while Meteor's 3G speeds were around half the speed and double the ping times of the Vodafone router's 4G signal, it was still more than adequate for my requirements. And at 6 euro cheaper per month and only a 6 month contract it was starting to look like a runner. The best was yet to come. The TP-LINK 4G router detected it within moments of plugging the E5377 into its USB port.

The only concern was that even at 30GB a month, it may not be enough before incurring excess charges. So I tried it for a few days and found that I was averaging around 1GB a day. This included a few Webex sessions with work and almost constant VPN connectivity to the office. So with some care it would certainly be possible to keep things within the 30GB limit if I avoided streaming video and the like. And if I did need more data Meteor offer an add-on of 20GB for 20 euro which would bring my limit up to 50GB; all for €44 a month.

So I returned the Vodafone router and opted for the Meteor package.

The Setup

As mentioned already, the wifi signal on a small mobile broadband router like the Huawei E5377 or R215 is never going to be strong enough to broadcast around the entire house. You can get around this by using a dedicated 4G router that will greatly extend your wifi capacity and provide ethernet ports for additional devices such as file servers, printers etc.

I already had a TP-LINK MR3220 3G/4G router I picked up some time ago and until now was lying unused.

TP-LINK  MR3220 3G/4G

This router has a USB port on its side that will take the connection from the Huawei E5377 and automatically relay its internet connection.

Because these devices must reside in the attic in order to catch the best reception, I also need a way of bringing the signal downstairs to another router under my stairs where my file server resides and where I broadcast another wifi signal. To do this I got a set of TP-LINK 300Mbps AV200 Powerline Extenders.

TP-LINK 300Mbps AV200 Powerline Extenders

One plugs into an attic socket. It takes an ethernet cable from the MR3220 and sends the data down to the second plug downstairs. This second home plug broadcasts the data it gets from the attic over its own wifi. It also has two ethernet ports, one of which connects to a NAS server.

Below is a schematic of how it all hangs together. A bit convoluted, no doubt, but it works well. I'm hoping there's a way I use WPS to perhaps cut out the TP-LINK router from the chain but I've had no joy so far trying to get the powerline adapter play nice with the Huawei E5377.

.

Full Setup

Update #1

The setup has been in place a few months now and is generally working well and the 3G/4G speeds are a much needed improvement over the miniscule 1MB speeds were were living with. There's been no huge downsides apart from the odd day or two where the 3G signal in the area went AWOL. I'm also finding it virtually impossible to stay within the data 30GB limit. It's a lot closer to 50MB and sometimes even more. I've therefore had to purchase a monthly 20GB add-on giving me 50GB a month by default. Some months I've had to buy an extra 15GB on top of all that just to get me over the line. This brings the cost up to roughly €60.

One interesting thing to note was that the MR3220 had some trouble dealing with the Huawei E5377 switching between 3G and 4G signals depending on the network quality on a particular day. This caused the MR3220 to lose its connection entirely with the E5377 entirely and required a restart. This problem was resolved by configuring the E5377 to only use the 3G network so no switching occurred thereby stopping the MR3220 from getting confused.

In addition, the 4G signal in the area seems to have strengthened and I'm now getting on average 25Mb download speeds. Happy days.

Update #2

Andrew L got in touch to say that an external antenna he purchased for use with his E5377 made a huge difference to the signal reception. Prior to using the antenna he was barely getting a 3G signal indoors and could only get 4G when the dongle was held out an upstairs window. His speeds went from approximately 1Mb to almost 40Mb.

Also worth noting is that Andrew uses a Netgear N900 (WNCE4004) 4-Port Wi-Fi adapter to connect to his Meteor broadband router wirelessly instead of via USB. I think this is a better solution than the TP-LINK MR3220 as it bypasses any compatibility issues you might get connecting a mobile broadband dongle to a router via a USB cable.

]]>
Blog Wed, 25 Feb 2015 11:23:00 +0000
Dualla Show 2013 http://www.practicalreason.net/item/33-dualla-show-2013 http://www.practicalreason.net/item/33-dualla-show-2013

Check out the new website for this year's Dualla Show: www.duallashow.ie

Dualla Show

]]>
dermot.ohalloran+dohalloran@gmail.com (Dermot O'Halloran) Blog Fri, 26 Jul 2013 14:22:49 +0000
Mounting Network Locations on Linux using Samba http://www.practicalreason.net/item/31-mounting-network-locations-on-linux-using-samba http://www.practicalreason.net/item/31-mounting-network-locations-on-linux-using-samba

A convenient way to browse files on a networked drive is to map its location to your operating system so that it automatically connects to the drive each time it starts up. Mapping networked drives on Mac or Windows is pretty straightforward using the Mac Finder and Window's explorer GUIs and both give you an option to automatically reconnect on startup. On Linux however, a little more work is involved to automatically map network locations, so this article will describe how to map network drives on a machine running the Ubuntu flavour of Linux.

Mapping network drives on Linux is called mounting. For example, if you have all your photos on a networked drive you'll need to mount this directory onto your Linux desktop in order to access it. In Ubuntu, network mounts are temporary by default. This means that the next time you restart Ubuntu it will not remember to remount the network drive from the last time you did it. This can be annoying when you want to permanently mount a network drive you will be using a lot. To mount a network drive permanently you will have to add a line to your file /etc/fstab. This file tells Linux what drives you want mounted on boot up. You need to add a line similar to the existing ones, depending on your exact setup.

In my case, I keep all my photos centrally on a ReadyNAS file server that sits and runs in a closet under my stairs. I also have a collection of Windows, Mac and Linux laptops/desktops in the house. When anyone wants to look at the photos they just need to connect to the server and navigate to the /photos directory. Since ReadyNAS servers come with built-in support for numerous file protocols all of these systems can access the photos on the ReadyNAS drive using the most suitable protocol.

So what file protocols exactly? Looking at the ReadyNAS configuration panel you'll see that it includes support for CIFS, NFS and AFP. CIFS stands for Common Internet File System and was largely developed by Microsoft for Windows operating systems (it's in fact based on a protocol called Server Message Block and therefore CIF is sometimes referred to as SMB). NFS is the Network File System for Unix and Linux operating systems. Finally, AFP is the Apple File Protocol and is used by machines running a Mac OS.

Linux machines have in fact two choices: connect to the ReadyNAS using CIFS or NFS. So what's the difference? It boils down to security. CIFS is generally the better choice when working within an open network. NFS can be less complicated but is only really suitable within a secure network due to its lack of security. I'm chosing to take the CIFS route so let's see how that's done.

Allowing a Linux system to access a Windows CIFS file system is done using Samba. Samba is a free software re-implementation of the CIFS networking protocol designed to enable Windows operating systems and non-Microsoft operating systems to connect. Samba is now standard on nearly all distributions of Linux. Connecting to a CIF file system from Linux is therefore simply a matter of using Samba's client application which is called smbclient (you only need to install the Samba server if you wish to allow Windows machines to access a Linux file system).

Start by installing the necessary Samba utilities:

  1. Install smbfs and smbclient(the Samba File System & Samba client) on your machine using the following command:
    sudo apt-get install smbfs smbclient
  2. Once installed you can check what directories are shared on your network drive using the the command smbclient -L [server] (replace [server] with the IP address or DNS name of your CIFS server). In this example the IP address of my ReadyNAS server is 192.168.1.14 so the command is:
    smbclient -L 192.168.1.14
    This should display a list of all the currently shared directories on the file server. Here's an example:
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.34]
    
    Sharename       Type      Comment
    ---------       ----      -------
    IPC$            IPC       IPC Service (ReadyNAS)
    video           Disk      Videos
    shared          Disk      Public directory for everyone's use
    photos          Disk      Family photos
    music           Disk      Everyone's Music
    media           Disk      Media downloads
    
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.34]
    
    Server               Comment
    ---------            -------
    READYNAS             ReadyNAS
    
    Workgroup            Master
    ---------            -------
    WORKGROUP            READYNAS
  3. To mount the photos directory on my machine I'll begin by first creating a local folder that will act as the mount point. Here's the command that will create a mount directory in /home/dermot/Desktop/photos:
    mkdir /home/dermot/Desktop/photos
  4. The next step is to test that the mount will actually work using the following command:
    sudo smbmount //192.168.1.14/photos /home/dermot/Desktop/photos -o
    username=admin,password=secretword,uid=1000,mask=000
    If this works you should see a /photodirectory mounted on the Desktop. Unmount it again using the following command:
    sudo smbumount /home/dermot/photos 

 

Getting drives to mount automatically

So now that we've established that the mount works, we can move on to configure Linux to mount this drive automatically each time it starts. This is done by adding the above command to a file called /etc/fstab.

  1. Open the /etc/fstabfile for editing:
    sudo gedit /etc/fstab
  2. Add the following line to the end of the fstab file:
    //192.168.1.14/photos /home/dermot/photos smbfs auto,credentials= 
    /home/dermot/.smbpasswd,uid=1000,unmask=000,user 0 0
  3. Run the remount command:
    sudo mount -a
  4. Navigate to the /home/dohalloran/Desktop/photos mount directory.

    For more information mounting drives in Ubuntu see: https://help.ubuntu.com/community/MountWindowsSharesPermanently

 

Handling password protected directories

If your network drive is password protected then you'll need to include your username and password details in the mount command. There's a way of doing this that's secure.

  1. When mounting a password protected directory the login details are specified as follows:
    sudo smbmount //192.168.1.14/photos /home/dermot/Desktop/photos -o
    username=admin,password=secretword,uid=1000,mask=000
  2. However, because the fstab file is located in the /etc directory it means it's visible and accessible to everyone. This is not a good idea as your username and password will be visible to everyone. So a way around this is to store the username and password in a separate, secure file and simply reference it from the fstab file. So let's create that file first. Do it in the /rootdirectory as follows:
    sudo gedit /root/.credentials
  3. Add the username and password to the newly created file so they appear as follows:
    username=your_smb_username 
    password=your_smb_password
  4. After exiting and saving the file, make it read-only so no one else can access it and see your credentials. This is done using the chmodcommand as follows:
    sudo chmod 600 /root/.credentials
  5. Next, open the /etc/fstabfile for editing:
    sudo gedit /etc/fstab
  6. Update the line in your fstab file as follows:
    //192.168.1.14/photos /home/dermot/photos smbfs auto,credentials= 
    /home/dermot/.smbpasswd,uid=1000,unmask=000,user 0 0
  7. Remount to test things by run the remount command:
    sudo mount -a

 

]]>
Blog Sun, 29 Jul 2012 20:14:53 +0000
Syntax Highlighting in Joomla http://www.practicalreason.net/item/8-syntax-highlighting-in-joomla http://www.practicalreason.net/item/8-syntax-highlighting-in-joomla

Code listings are often rendered badly in online articles and blogs making them difficult to read and understand. A nice utility to help format and display code within HTML is Alex Gorbatchev's widely used SyntaxHighlighter. It is developed in JavaScript so runs in any modern browser. Numerous Joomla implementations of SyntaxHighlighter exist in the form of plugins (have a look here: http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/code-display). The one I used is called Joomler SyntaxHighlighter and was developed for Joomla 1.6 but works in Joomla 2.5 also. It enables you to display nice code listings like this:

function foo()
{
 if (counter & lt;= 10)
 return;
 // it works!
}

Simply install and enable the plugin in your Joomla installation and highlight any of your code snippets by including some properties within the <pre/> tag while in HTML editing mode. For example:

<pre class="brush: js; gutter: true;"}
 function foo()
 {
  if (counter &amp; lt;= 10)
  return;
  // it works!
 }
</pre>

The SyntaxHighligher supports a whole bunch of brushes including JavaScript, PHP and even Bash. it also includes an auto brush facility which can automatically analyze the code listing to determine what brush to use if you don't specify one (it defaults to plain text).

Note that when using the preformatted style (i.e. the <pre/> tag) you will need to escape all right angle brackets must be HTML escaped (meaning all < must be replaced with &lt;).

Here's a bash example:

sudo ./make_me_a_sandwich.sh

Some links:

http://www.webresourcesdepot.com/11-syntax-highlighters-to-beautify-code-presentation/

 

 

]]>
dermot.ohalloran+dohalloran@gmail.com (Dermot O'Halloran) Blog Tue, 20 Mar 2012 06:57:14 +0000
Setting up a Squeezebox Duet without a Controller http://www.practicalreason.net/item/34-squeezebox-duet-without-controller http://www.practicalreason.net/item/34-squeezebox-duet-without-controller

A few years ago my sister bought a Squeezebox Duet to play her music. It's a superb solution. It consists of a small black box known as a Receiver. This connects to your wireless or LAN network and streams music from any device on it running the Squeezecenter Server software and plays it through your own speaker setup. It's all managed using a separate Controller that wirelessly connects to the headless receiver and enables you to browse your music collection and decide what gets played.

Unfortunately, one day the controller just stopped working. Without the controller it became impossible to configure the Receiver. A new controller cost anything up to 300 euro and just wasn't worth the expense. Luckily, after some investigating, I found a pretty good solution - someone had written an application called Net:UDAP that could connect to a Squeezebox Receiver and enable you to setup and configure the receiver's wireless settings so it can connect to your network.

The application comes in the form of a Perl script which when run, connects to the receiver over a direct ethernet connection and enables you to manually set the receiver's settings just like you would have done with a working controller. Once configured you can then use the free Squeezebox app available from the Android market or Apple Store on your phone or tablet to control the Receiver just like you would with the original controller.

Summary of the Steps

The following is a short summary of the steps. More detailed instructions are found further down.

  1. Start by performing a factory reset the Squeezebox Receiver. Do this by holding down the button for five seconds or more until it starts flashing red.

  2. Connect the Receiver directly to your PC or laptop using an ethernet cable.

  3. Determine the IP address of the Receiver. Use ipconfig /all in Windows or ifconfig -a in Unix.

  4. Install Perl on your operating system.

  5. Download the Net::UDAP application from https://projects.robinbowes.com/Net-UDAP/trac/browser/branches/1.0.x

  6. Run the Net::UDAP application's udap_shell.pl script as follows to connect to the Squeezebox Receiver:

    udap_shell.pl --local-address [Squeezebox Receiver IP address]
  7. Run the scripts commands in its CLI to configure the receiver's wireless network settings and the address of the Squeezebox server running on your network. See Running the Application.

 

Prepare the Squeezebox Receiver and get its IP Address

  1. Before starting, the Squeezebox Receiver must be in init mode indicated by its front button flashing slowly red. Do this by performing a factory reset on the receiver by pressing and holding the button for five seconds or more until the light starts flashing red.

  2. Once in init mode, connect the Squeezebox Receiver to your laptop using an ethernet cable.

  3. Turn off your laptop's wireless so it's only looking at the LAN network.

  4. Open a command window and get the IP address of the Squeezebox Receiver using the following DOS command:

    ipconfig /all

    You should get some output like the following:

    C:\Users\Dermot> ipconfig /all
    
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : MyLaptop
       Primary Dns Suffix  . . . . . . . : 
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : 
    
    Wireless LAN adapter Wireless Network Connection:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
       Physical Address. . . . . . . . . : 24-77-03-26-B3-D4
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
    
    Ethernet adapter Local Area Connection:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
       Physical Address. . . . . . . . . : 00-21-CC-72-45-01
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::a4fb:9202:38d6:a32a%14(Preferred)
       Autoconfiguration IPv4 Address. . : 192.168.1.4(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.0.0
       Default Gateway . . . . . . . . . :
       DHCPv6 IAID . . . . . . . . . . . : 285221324
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-16-B2-73-D0-00-21-CC-72-45-01
       DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                           fec0:0:0:ffff::2%1
                                           fec0:0:0:ffff::3%1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    
  5. Examine the output and look for the Ethernet adapter details. Here you should find a section Autoconfiguration IPv4 Address which will list the IP address assigned to the device connected on the ethernet port. See the highlighted line above for an example - you can see how the IP address of the Receiver is 192.168.1.4.

Install Perl

To run the Net:UDAP application you'll need to have Perl installed on your environment. Perl is typically installed by default on Ubuntu. A good way to run Perl scripts in Windows is using the ActivePerl distribution. Download the installer file for its free community edition from here and run it to install Perl on your Windows environment. Once installed run the command perl -version within a command window to test that it works:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Dermot>perl -version

This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Binary build 1402 [295342] provided by ActiveState http://www.ActiveState.com
Built Oct  7 2011 15:19:36

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

C:\Users\Dermot>

Run the Application to Connect to the Squeezebox Receiver

  1. Download the Net::UDAP application ZIP and extract the archive to any location.

  2. To get the Net::UDAP application to connect to the Squeezebox Receiver you need to run its udap_shell.pl script and specify the IP address of the Receiver you determined in the previous section. Here's an example of the command where the IP address of the Receiver is 169.254.163.42:

    C:\branches\1.0.x\scripts>udap_shell.pl --local-address 169.254.163.42
    

    If the script successfully connects to the network address and you should see a command line interface as follows:

    C:\branches\1.0.x\scripts>UDAP>

    If the connection fails then it's typically because the IP address is incorrect. See the Troubleshooting section for some help.

  3. Use the help command to see what commands are available in the CLI:

     UDAP> help
      Type 'help command' for more detailed help on a command.
        Commands:
          configure - configure a device
          discover  - Discover UDAP devices and get their current configuration
          exit      - Exit configure mode (if configuring a device), otherwise exit application
          fields    - Display a list of valid device fields
          help      - prints this screen, or help on 'command'
          list      - List discovered devices, or a specific information about a device
          quit      - Exit configure mode (if configuring a device), otherwise exit application
          reset     - Reset a device
          save_data - Save data parameters to device(s)
          save_ip   - Save ip parameters to device(s)
          set       - Set device parameter(s)
    
  4. The next step is to use the CLI to discover the Receiver and start its configuration.

Discover and Configure the Receiver

Once you've launched the script and connected to the Receiver you can begin to configure it.

  1. The first step is to tell the application which Squeezebox Receiver you wish to configure. Do this using the discover command to scan the IP address for Squeezebox Receivers running on the connection. You should get the following type of output:

     UDAP>
     discover
      info: *** Broadcasting adv_discovery message to MAC address 00:00:00:00:00:00 on 255.255.255.255
      info:   adv_discovery response received from 00:04:20:16:05:8f
      info: *** Broadcasting get_ip message to MAC address 00:04:20:16:05:8f on 255.255.255.255
      info:   get_ip response received from 00:04:20:16:05:8f
      info: *** Broadcasting get_data message to MAC address 00:04:20:16:05:8f on 255.255.255.255
      info:   get_data response received from 00:04:20:16:05:8f
    
  2. When the scan has completed as above, use the list command to display the available Squeezebox Receivers. There should only be one in this case:

     UDAP> list
    
       #    MAC Address    Type       Status
      == ================= ========== ===============
       1 00:04:20:16:05:8f squeezebox init
    
  3. Use the configure command to select the Squeezebox Receiver to configure based on its number (it will always be 1):

     UDAP> configure 1
    
      UDAP [1] (squeezebox 16058f)>
    

    Notice the prompt has changed to show the device number [1] and name

  4. You are now ready to change the Receiver's configuration details. Use the list command to display the current settings. You'll see a list of all the configuration fields and their default values:

     UDAP [1] (squeezebox 16058f)> list
    
                   bridging: 0
                   hostname:
                  interface: 0
                lan_gateway: 0.0.0.0
                lan_ip_mode: 1
        lan_network_address: 0.0.0.0
            lan_subnet_mask: 255.255.255.0
                primary_dns: 0.0.0.0
              secondary_dns: 0.0.0.0
             server_address: 0.0.0.0
      squeezecenter_address: 0.0.0.0
         squeezecenter_name:
              wireless_SSID:
           wireless_channel: 0
            wireless_keylen: 0
              wireless_mode: 0
         wireless_region_id: 0
         wireless_wep_key_0:
         wireless_wep_key_1:
         wireless_wep_key_2:
         wireless_wep_key_3:
            wireless_wep_on: 0
        wireless_wpa_cipher: 1
            wireless_wpa_on: 0
          wireless_wpa_mode: 1
           wireless_wpa_psk:
    

    To see a list of all the available fields and their descriptions use the fields command:

     UDAP> fields
                   bridging: Use device as a wireless bridge (not sure about this)
                   hostname: Device hostname (is this set automatically?)
                  interface: 0 - wireless, 1 - wired
                lan_gateway: IP address of default network gateway, (e.g. 192.168.1.1)
                lan_ip_mode: 0 - Use static IP details, 1 - use DHCP to discover IP details
        lan_network_address: IP address of device, (e.g. 192.168.1.10)
            lan_subnet_mask: Subnet mask of local network, (e.g. 255.255.255.0)
                primary_dns: IP address of primary DNS server
              secondary_dns: IP address of secondary DNS server
             server_address: IP address of currently active server (either Squeezenetwork or local server
      squeezecenter_address: IP address of local Squeezecenter server
         squeezecenter_name: Name of local Squeezecenter server (???)
              wireless_SSID: Wireless network name
           wireless_channel: Wireless channel (used by AdHoc mode???)
            wireless_keylen: Length of wireless key, (0 - 64-bit, 1 - 128-bit)
              wireless_mode: 0 - Infrastructure, 1 - Ad Hoc
         wireless_region_id: 4 - US, 6 - CA, 7 - AU, 13 - FR, 14 - EU, 16 - JP, 21 - TW, 23 - CH
         wireless_wep_key_0: WEP Key 0
         wireless_wep_key_1: WEP Key 1
         wireless_wep_key_2: WEP Key 2
         wireless_wep_key_3: WEP Key 3
            wireless_wep_on: 0 - WEP Off, 1 - WEP On
        wireless_wpa_cipher: 1 - CCMP, 2 - TKIP
            wireless_wpa_on: 0 - WPA Off, 1 - WPA On
          wireless_wpa_mode: 1 - WPA, 2 - WPA2
           wireless_wpa_psk: WPA Public Shared Key
    

    In general you only need to configure a subset of these fields to get things working. It all depends on the type of network you want the Receiver to connect to.

    1. server_address - It's not clear from the documentation what exactly this setting relates to but if it's not set it doesn't work. I assumed it relates to the IP address of the Squeezebox server (the same as the squeezecenter_address field). You decide what the IP value is - make sure its a unique address anywhere on your network.
    2. lan_subnet_mask - The subnet mask of your network. The default is 255.255.255.0 so if your subnet mask is the same then there's no need to change it.
    3. squeezecenter_address - The IP address of the Squeezecenter server running on your network.
    4. wireless_SSID - The SSID of your wireless network.
    5. wireless_wep_key_0
    6. wireless_wep
    7. interface- 0 - wireless, 1 - wired
    8. hostname - A name for the Squeezebox Receiver so you can easily identify it.

    NOTE THAT THESE ARE CASE SENSITIVE SO BE CAREFUL! Here's an example where the wireless network was WPA enabled and therefore just required a passphrase. :

    set server_address=192.168.1.3 squeezecenter_address=192.168.1.3 squeezecenter_name=Squeezecenter wireless_SSID=shed wireless_wpa_psk=rathcloughduallacashel wireless_wpa_on=1 wireless_wpa_mode=2 wireless_wpa_cipher=2 interface=0 hostname=squeezebox-duet
  5. Type list to see the values have changed:

     UDAP [1] (squeezebox 16058f)> list
                   bridging: 0
                   hostname: squeezebox-duet
                  interface: 0
                lan_gateway: 0.0.0.0
                lan_ip_mode: 1
        lan_network_address: 0.0.0.0
            lan_subnet_mask: 255.255.255.0
                primary_dns: 0.0.0.0
              secondary_dns: 0.0.0.0
             server_address: 192.168.1.3
      squeezecenter_address: 192.168.1.3
         squeezecenter_name:
              wireless_SSID: shed
           wireless_channel: 0
            wireless_keylen: 0
              wireless_mode: 0
         wireless_region_id: 0
         wireless_wep_key_0: 
         wireless_wep_key_1:
         wireless_wep_key_2:
         wireless_wep_key_3:
            wireless_wep_on: 0
        wireless_wpa_cipher: 2
            wireless_wpa_on: 1
          wireless_wpa_mode: 2
           wireless_wpa_psk: rathcloughduallacashel
    
  6. Use the save_data command to save the settings to the device:

     UDAP [1] (squeezebox 16058f)> save_data
      info: *** Broadcasting set_data message to MAC address 00:04:20:16:05:8f on 255.255.255.255
      ucp_method set_data callback not implemented yet at /home/robin/projects/Net-UDAP/trunk/scripts/../src/Net-UDAP/lib/Net/UDAP.pm line 281
      Raw msg:
                00 01 02 03 04 05 06 07 - 08 09 0A 0B 0C 0D 0E 0F  0123456789ABCDEF
    
      00000000  00 02 00 00 00 00 00 00 - 00 01 00 04 20 16 05 8F  ............ ...
      00000010  00 01 C0 01 00 00 01 00 - 01 00 06 00 1A           .............
      info:   set_data response received from 00:04:20:16:05:8f
    
  7. Finally, use the reset command to reset the Squeezebox Receiver in order to apply the changes:

     UDAP [1] (squeezebox 16058f)> reset
      info: *** Broadcasting reset message to MAC address 00:04:20:16:05:8f on 255.255.255.255
      ucp_method reset callback not implemented yet at /home/robin/projects/Net-UDAP/trunk/scripts/../src/Net-UDAP/lib/Net/UDAP.pm line 281
      Raw msg:
    
                00 01 02 03 04 05 06 07 - 08 09 0A 0B 0C 0D 0E 0F  0123456789ABCDEF
    
      00000000  00 02 00 00 00 00 00 00 - 00 01 00 04 20 16 05 8F  ............ ...
      00000010  00 01 C0 01 00 00 01 00 - 01 00 04                 ...........
      info:   reset response received from 00:04:20:16:05:8f
    

    Ignore any warnings.

  8. The Squeezebox Receiver should reset and when it restarts it should begin connecting to your wireless network using the new settings. The Receiver will indicate a successful connection when a dark white light appears.

  9. Install the Squeezebox App on your phone or tablet to connect to the Squeezebox server and play your music.

]]>
Blog Tue, 20 Mar 2012 06:57:14 +0000