Wednesday, 13 October 2010

AxVLCPlugin2, Visual Basic 2008 and Windows 7 64bit - clr20r3 and REGDB_E_CLASSNOTREG

I've been writing an application to monitor multiple streams in VB 2008 and I started using the AxVLCPlugin2 which comes with VLC.

It is a nice plugin and apart from a few problems (it will not go fullsceen in version 1.1.4 for example) works fine for any stream that VLC supports.

I do most of my work on a 32bit XP box at work, but sometimes I like to work on projects at home using my 64bit Win7 PC.

For most projects this works fine, but on this one every time I started the application it would crash telling me that an error with an "EvenType: clr20r3" has occurred. It also gives a lot of information about the crash but nothing useful to point to the source of the error.

Assuming that the problem was that the application could not find VLC or that the AxVLCPlugin2 was not recognised, I fired up Visual Studio, cleaned up the project and tried to recompile - at which point VS proclaimed that "Class not registered (Exception from HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))".

No matter how many times I removed the reference an added it again, the error remained the same.

The solution was quite simple though.

Go to the "Project properties -> Compile" and set the platform to "x86" instead of "Any CPU". This allowed the application to successfully compile and run on the 64bit Win7 pc, without breaking it for the 32bit.


If "x86" does not appear in the combobox, open the configuration manager (Build -> Configuration Manager).

In the Configuration Manager dialogue, select "New" from the "Active Solution Platform" combobox.


In the new dialogue, select "x86" and "Copy Setting from Any CPU" and leave the checkbox ticked.


Keep in mind that this will create a new directory under the "<project>/bin/" folder of your project called "x86" which will contain new debug and release subdirectories. So make sure that if you have any shortcuts to your executables pointing to the old "<project>/bin/release" or "<project>/bin/debug" folders they are updated accordingly.

Tuesday, 12 October 2010

Setting up an AXIS 241QA Video Server to Control an Everfocus PTZ Camera

Camera Setup
1. Set the protocol on the camera to Pelco-D.
2. Set the baud rate to 9600bps.
3. Give a unique address to the camera.

For the Everfocus EPTZ500 cameras, the setup DIP switches will look like: 10 00 00 00

AXIS Server Setup

1. Set the RS485 mode to “Pan Tilt Use”.
2. Load the Pelco driver. It can be found at the Axis website (there is a link in the server’s web UI).
3. Check the “Force Install” checkbox before hitting ok.
4. Set the device type to “Generic”.
5. Set the Address to be the same as the camera’s address.
6. Set the RS485 port settings as follows (they are at the bottom of the page):
Baud Rate: 9600
Data Bits: 8
Stop Bits: 1
Parity: None

Cable Connection
1. The Yellow (+) cable on the Camera goes to the RS-485-A pin on the Axis (Pin 11 for the 241QA).
2. The Orange (-) cable on the Camera goes to the RS-485-B pin on the Axis (Pin 12 for the 241QA).

Troubleshooting
1. If something doesn’t work, make sure that Camera’s address is reflected correctly in the server’s port/video settings.

Tuesday, 21 September 2010

ADB driver installation fails after ROM update or change

Sometimes, after changing the ROM in an Android device, ADB will not detect the phone when you plug it in.
This can happen because:
  1. The rom is a different OS version and there an updated driver version exists, so you will need to update your SDK.
  2. The update changed your device's PID (Product ID) and/or VID (Vendor ID). These two values are used in USB devices to identify them and to select the correct drivers for them.
In the second case, you can modify the inf file which comes with the Android drivers to associate it with the new VID/PID.

Friday, 17 September 2010

Getting Calibre Server to run at Boot in Ubuntu 10.04

Calibre is a multi-platform eBook management software which supports multiple eBook reader and formats.

It also contains a simple eBook distribution server which can be accessed both via a web browser and an OPDS compatible client.

In this article I will set-up the Calibre server to start at boot time and serve books.

Even though Ubuntu 10.4 has Calibre in its repositories, I prefer to download and install the latest version as Calibre updates quite often with both compatibility fixes and new functionality.

The following procedure can be completely done over command line, on a headless system.

To do this, enter the following in a terminal:
 sudo apt-get install xdg-utils  
 sudo python -c "import urllib2; exec urllib2.urlopen('http://status.calibre-ebook.com/linux_installer').read(); main()"  

And follow the on-screen instructions. In case something goes wrong, go here and see if the instructions have changed.

There has been a report (by Emil in the comments) that the following are also needed in Ubuntu 10.10:
 sudo apt-get install xdg-utils imagemagick python-imaging python-mechanize python-lxml python-dateutil python-cssutils python-beautifulsoup python-dnspython python-poppler libpodofo-utils libwmf-bin python-chm   

After installing Calibre, it is time to set it up for boot start up.

Enter the following:
 cd /etc/init.d  
 sudo pico calibre  

In the editor which opens up, copy and paste the following script, making changes as needed (check the top 20-30 lines). UPDATE: if you are sing Calibre 0.7.27+ you need the script from here instead.

Sunday, 12 September 2010

AMX and Procon Equipment

At work we are using a number of AMX Novara panels to automate the teaching lecterns/cabinets.

As Novara panels and the Solecis integrators used to be produced by Procon, there can be a bit of confusion regarding the model numbers.

Here is a small table with what is what (at least the things we use :)):

AMX NameProcon NameDescription
Novarra CP2024-TRYP2024-0124 Button Console 1 Cross
AVS-SLPR-0201-0301YP2020-021U Integrator
AVS-SLPR-0401-0601YP2011-022U Integrator
?8450-03IP Unit

On a similar note, most of the Novaras don't have the pin-out of the programming port printed on their back, so here it is:

Funny characters when using ADB,

Depending on the device's ROM and whether terminal colour is enabled, when you use ADB to connect to a shell, you might see weird characters in the terminal after you enter a command.

For example, this is my terminal after I entered 'ls':
The reason for this is that cmd cannot interpret the escape sequences for color and it is printing them as ASCII characters.

To fix this start adb shell normally and enter:
 alias ls='ls --color=never'  

It should then look like this:

Thursday, 9 September 2010

Android tabbed, horizontally and and vertically scrollable tablelayouts

The following layout XML will allow you to create an application layout similar to the following, where the data under the tabs can be scrolled both horizontally and vertically by a finger swipe.


To see the horizontal scrollbar, you'll have to scroll to the bottom of the screen.

The XML file is after the jump: