Using IPC-3605N Without EaZy Wizard

Illustration

My laptop has no DVD drive since I removed it a while ago in order to get another hard drive in. Therefore I was little bit unprepared when I bought myself ZyXEL IPC-3605N camera. User guide told me I have to run tool found on CD that I could not read.

I am lazy, so first I tried to download that tool (eaZy Wizard) from ZyXEL pages. Only when I could not find it anywhere (thank you ZyXEL for forcing users to keep CD around) I decided upon more imaginative solutions.

Since manual did mention some addresses in 192.168.0.x range and that range being most often used, I set my laptop’s wired network adapter to 192.168.0.254 and connected camera directly to it. Than I used MagiWOL’s import functionality to scan network for all MAC addresses in range 192.168.0.1-192.168.0.253. That resulted in single hit - my camera was at 192.168.0.100.

After finding out IP address, all I had to do was to enter this IP in browser and use “admin”/“1234” as user/password combination (not “admin”/“admin” as user manual suggested). With that I could proceed with setting-up configuration.

And CD was left forgotten.

Multicast

Whenever there is need to distribute same data to multiple applications over network I tend to see same thing. Everybody just makes broadcast socket. That is usually wrong way to do it.

From the very beginning of IP, there is special class called multicast addresses. Idea is simple: you “join” multicast address and whatever you send to it is received by everybody else who joined.

While this might seem a lot like broadcast, it is not the same thing. If you have network of 100 computers and only two need to talk, broadcast will send same data to 100 of them anyway. In multicast case switch can optimize this and send data only to two computers that need it.

Even in case of dumb switch which behaves with multicast in same manner as with broadcast, there is benefit. Since multicast addresses reside in completely different range, there is no fear that we will interfere with any normal socket that is listening on same port. Yes, we might stumble at another multicast group by accident but chances are pretty slim.

Creation of multicast socket is quite similar to creation of any other socket:

this.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
this.Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
this.Socket.Bind(new IPEndPoint(IPAddress.Any, 65535));
this.Socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.192.0.1"), IPAddress.Any));

As you can see, only real difference is in additional socket option that adds our socket to multicast group (do not forget do remove it on application exit).

And that is it. Everything else works as it would with “normal” socket.

Code example is available for download.

P.S. For this example I use multicast address of 239.192.0.1. You might want to change this to something not as usual as this (but still in 239.192.0.0 range).

Rule Number One

Illustration

I got into discussion with friend about best practices when it comes to designing things around PIC micro-controllers. One that we agreed on was to never, absolutely never use ICSP (in-circuit serial programming) pins for anything other than connecting to PIC programmer.

Yes, I know that there are things that you can connect safely to those pins while having them functional as far as programming goes. Yes, I am aware that I am talking about two-and-half perfectly good I/O pins (PGC, PGD and MCLR). Yes, I am probably overreacting. Taking all into account, I still stand by my recommendation.

I know how it goes, first PGC and PGD are left alone. As design develops, we seem to be one pin short. No biggie, we just use PGC for a button. Simple button cannot hurt. Then we need status LED, PGD can do that!

As design develops we move pins back and forth and, sooner or later, we end-up with something like pull-up or diode on ICSP. And that spells trouble. I will not even go into how exactly are we to use ICSP for in-circuit debugging if we have to use it for e.g. input button that triggers action we are trying to debug.

I am not saying it is impossible to use ICSP in your circuit. Those pins can serve as excellent last resort. But most of time it is better to go for a bigger gun PIC.

P.S. Yes, I broke ICSP rule fair number of times.

Pain in the *Ss

Being in USA these days is getting annoying.

I am in EDT time zone for a few days now and rest of world is still on standard (aka winter) time. That means that difference between myself and my home Croatia is one hour less than it normally is. Or is it one hour more? This is getting confusing.

I would understand if US decided to stop using daylight savings (or better, make it permanent). That way I could blame rest of world for being too backward to kill useless tradition. However, some idiots politicians decided that it would be great thing if USA could be out-of-sync with rest of world’s time zones for two weeks.

Thank you.

A Two Weeks With Windows 8

I have forced myself to use Windows 8 at home for previous two weeks. And best way to describe them would be as tablet OS.

Best example of tablet-centric behavior is seen if you search for “Computer”. You will get known “Computer” icon on which you might want to do right-click (in order to get context-menu). If you do this, context menu will appear but at bottom of the screen. So you need to take your cursor all the way down the screen. Pointless. And it is annoying that you cannot use keyboard to do that at all. Pressing context-menu key brings menu for text box and not for currently selected item. You first need to use arrow keys to go up/down and only then you can use keyboard properly. Unpolished to say the least.

Search that worked perfectly in both Windows Vista and Windows 7 is lacking. You cannot search for Printers, Devices, Programs… all those items that resided in start menu are not easily accessible by search. Yes, you can go and CLICK on Settings bellow, but that is solution that is more oriented toward tablets and guys using mouse. If you want keyboard you can get it with Win+W (very logical indeed) but at cost of time for switching. It gets even worse when you are not sure where something is.

Windows SmartScreen technology helps to annoy user further. It checks each file downloaded over Internet and, if not enough users downloaded that application through Internet Explorer, it will force you to jump through hoops to run it.

As network goes, Windows Vista/7 hid everything behind one more click than it is really necessary. However, if you had network connected, that network was shown in notification area (aka tray). In Windows 8 it shows state of whatever adapter it wants. Chance will have it that it is not adapter that you are using currently. So you can have icon with exclamation point while your network works perfectly. To show it you need to click on icon with warning.

Those were the things that I hated the most during regular work but they weren’t only ones. I think that almost every single feature of Windows 8 was unfinished and it was very obvious. I understand that it is not fair to compare beta (or consumer preview) of Windows 8 with finalized product that is Windows 7. However, I remember Windows 7 beta. I had no reservations to start using it immediately. There was virtually no downsides to it. Comparing two betas, it feels like Windows 8 was rushed…

Single excellent thing about Windows 8 is their ability to boot off the USB. And it is fortunate that they do since I am erasing them from my hard drive.