08 May 2010

Using a 3G UMTS stick under Linux

I've been trying to get a typical 3G UMTS modem in USB 'dongle' form working with an embedded Linux system. I subscribed to a local service (KPN 'Hi') a while ago. The dongle turned out to be a rebranded ZTE MF628. It works reasonably well under Microsoft Windows and Mac OS X.

Getting it work somewhat under Linux 2.6.26 or 2.6.30 wasn't very difficult either. Getting it to work reliably turned out to be beyond me. I didn't know it yet, but GSM modems have a whole set of standards that are generally based on the bastard child of the original "AT" commandset created 30 odd years ago by Hayes. The ETSI publishes these standards that are 'open' in that they can be accessed by everyone. That's all fine but it turns out that the ZTE has some peculiar issues with how it implements the standards and it's own company specific extensions that are hard to reverse engineer. Also, the serial speeds required for mega bit speeds (I've got 3,6 Mbps service) were beyond the serial drivers so the PPP connection kept going down. All in all a very frustrating experience that cost much more time than I'd anticipated.

There turns out to be a very simple solution: I bought an Option Icon 505 USB modem to replace the ZTE. What a difference! The Option device uses the same AT command set for control but provides an IP device for the data connection. This eliminates the PPP driver and has very good performance. The driver for Linux is written by Option employees and available on Pharscape. Kudos to Option for making an excellent product that works great with Linux.

06 May 2010

Lowrance yellow Ethernet cabling

The Navico 'yellow' ethernet connector used on new Lowrance devices such as the HDS series has the advantage of being watertight and easy to make a reliable twist-on connection:

Navico Yellow Ethernet connector

In case you want to use a standard Ethernet switch, or have guys lay ethernet cabling through some narrow ducting you cannot use the normal Lowrance Ethernet cabling and have to crimp an RJ-45 jack onto the Lowrance cable.

On opening up the cable I found two twisted pairs of cable, as expected, plus a shield:

Navico Ethernet cable pairs exposed

The pairs are blue and orange. I connected those the same way as a 3 Com sourced very thin Ethernet cable I had lying around: blue to pins 1+2 and orange to pins 3+6 of the RJ-45 jack. This isn't according to either T568A or T568B, but that cannot be helped when the cable pairs are blue and orange. In practice the cable works fine, both when wired directly and when wired to a switch. I don't know whether the is actually a cross over cable or direct through though, so if you use a switch that doesn't do auto MDI-X you may have to swap the pairs.

Here's the crimped connector:

Navico cable to RJ-45 jack

and the final cable:

Finished Navico to RJ-45 Ethernet cable

Once plugged in a quick run of tcpdump revealed the IP address of the Lowrance HDS and a ping proves that my Mac and HDS are able to talk to each other:

PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.788 ms
64 bytes from icmp_seq=1 ttl=64 time=0.405 ms
64 bytes from icmp_seq=2 ttl=64 time=0.480 ms

Hurrah, one more item from my to-do list done!


May 2010: Commenters have asked me whether this means they can now interface a HDS or Broadband Radar to their PC. Alas, no. The test done above was just a convenient way for me to test that the munged cable works.June 22, 2010: Yes, you can! Navico has released a SDK that allows navigation software providers to interface with the Broadband Radar. As far as I know, only Expedition has released the necessary software so far (August 2010). For more information see Simrad BR24PC, Free Range BroadBand Radar #2 at Panbo.

01 May 2010

Basics of Electrical units and quantities

I'm sick and tired of stories in the general boating press by confused writers that mix up electrical numbers and quantities.

This is probably because electrical units are a bit different than the units used for length, speed and distance.

Here's my feeble attempt at clarifying this apparently confusing matter. I shall compare electrical current to water current flowing in a circular pipe, which seems appropriate in our nautical environment.

Some theory first

Let's start with the three most familiar units:

  • Voltage - The eagerness with which electrons want to flow from A to B. In our comparison, this is equivalent to the water pressure in a pipe.
  • Current - The magnitude (amount) of electrical charge passing through the conductor per unit of time. In our comparison, this is equivalent to the discharge of a river or pipe. Discharge is usually measured in cubic meters per second, likewise electrical current is measured in coulombs per second. An electrical current of 1 ampere is defined as 1 coulomb per second. This is important to note: current is a derived quantity. One coulomb is just a large bunch of electrons, about 6.241 x 1018 of them.
  • Electrical energy - The thing that we have electricity on a boat for anyway. Electrical power is what makes the appliance (winch, coffee maker, light bulb) work. In our comparison, it is the amount of power that a turbine could transfer from the water in the pipe. This is a product of the discharge and the pressure. Likewise, in an electrical circuit the power is the product of the voltage and the current. In units: volt times ampere equals watt (V * A = W). (Note to fellow engineers: I know it should be U * I = P, but let's not further complicate matters.)

Note that although voltage and current are used so often, they are NOT basic units such as volume and length are. In particular voltage is defined as the total energy required to move an electric charge from A to B divided by the magnitude of the charge. Current is also a derived value. In electricity, the basic unit is charge measured in coulombs.

The confusion grows when we start talking capacity. In particular the capacity of our electrical charge containers, more commonly known as a battery. Given what I stated above you'd think that we'd measure battery capacity in coulombs: how many electrons does it take. Unfortunately, historically we have used ampere hours. One ampere hour (Ah) is a current of 1 ampere during 1 hour (3600 seconds). Since 1 ampere is 1 coulomb per second, 1 Ah is 3600 coulombs.

Likewise the total amount of power used over a number of hours defines how much must be recharged, or bought from an electricity company. Historically this is measured in (kilo)watthours. 1.2 kWh = 1200 Wh = 1200 watts for an hour. If this power had to be supplied by a typical 12 V battery bank this would be (V * A = W, therefore A = W / V, therefore Ah = Wh / V) 1200/12 = 100 Ah.

Typical Errors

Taking one article from a Dutch magazine "Zeilen", let's discuss what they do wrong. The article "Geen beweging, toch stroom" (No movement, still current) in the May 2010 issue discusses fuel cells, and shows a few typical examples.

The first small error is a sentence where the author discusses a Gas generator ... with a capacity between 1.5 and 2.2 kWh ... Now kWh is the amount of power delivered over a particular amount of time. Generators are sized in terms of power, e.g. (kilo)watts -- not kilo watt hours.

Then he goes on to discuss the admittedly confusing (but correct) wording used by EFOY fuel cells. EFOY rates their equipment by the amount of watt hours they can deliver per day (24 hours). Admittedly, this would be better expressed in simple Watts. The author writes this as follows: There are five models from 600 to 2200 Watt/h per day, a rather strange and misleading denomination. You should divide the number by 24 to arrive at the true performance. For an EFOY 2200 this coumes down to a maximum current of 7.5 Ah at 12 volt. Ouch: it should be Watt hour, not Watt per hour (Watt/h). It should also be 7.5 A (amps) not 7.5 Ah (amp hours).

Anyway, on to the next section where he claims that the Protonex M-250C fuel cell delivers 250 Watt per hour. Guess he means 250 Watt...

And the last one: The Italian company Acta delivers fuel cells with a capacity of 100, 200 or 1000 Watt during eight hours. Again, Watts per hour is meaningless.

Guess it's no wonder that many boaters are confused about electricity with magazines feeding them mis-information like this.