Category Archives: Computing

Greenland Calling: Iridium Satellite Phone

I have trouble calling Petermann Gletscher, Greenland where I am collecting ocean data that feeds into a remote weather station. This station is run on a pair of car batteries, because the solar panels do not work until the sun rises again in two months and the next electrical outlet is about 300 miles away. A computer controls power to sensors and a satellite phone. All calls from and to the station are routed via a commercial satellite phone system that consists of about 66 satellites orbiting our planet. They often appear as shooting stars in the night sky that are called Iridium flares. As beautiful as these orbiting satellites are, they have driven me mad.

Screen shot of Iridium satellite orbits observed in real-time from http://www.satflare.com/track.asp?q=iridium

Screen shot of Iridium satellite orbits observed in real-time from http://www.satflare.com/track.asp?q=iridium

Iridium satellite phones and modems connected to computers are the only way to get data from remote areas of the Arctic and Antarctic. Some modems send small text messages called Short-Burst-Data (SBD) while other modems support a true two-way dial-up connection that includes all the hand-shaking of a telephone call. This computer-to-computer calling is more tricky than the person-to-person calls that this system was originally designed for. Working near Petermann Fjord, we had much trouble with even the person-to-person calls. Senator John McCain’s of the U.S. Congress was rudely disconnected, when he called us on the ship while in Sweden working with Government officials. And the Iridium phones on our Swedish icebreaker I/B Oden were thoroughly checked by field technician Robert Holden:

Rob Holden testing Iridium phones above the bridge of I/B Oden.

Robert Holden testing Iridium phones above the bridge of I/B Oden in August of 2015.

The building and coding of this ocean weather station is cool stuff for someone like me who likes Legos, computer games, and hacking electronics. Our Greenland ocean observing system uses both the text message SBD system at two smaller stations and the dial-up system at the larger weather station. The SBD system is great for small burst of data smaller than 1960 bytes per message. The Greenland station makes the call to a ground station that then e-mails the message forward to us. The method is very reliable, but there are small connection gaps that become data gaps.

Inside of University of Delaware command and control of five ocean sensors and surface weather station. Two computers are stacked above each other on the left.

Inside of University of Delaware command and control of five ocean sensors and surface weather station. Two computers are stacked above each other on the left with satellite modem 9522B on bottom left with RS-232 cable connecting to computer (Campbell Scientific CR1000).

In contrast, the dial-up method delivers a gap-free data set, but its bi-polar behavior drives me nuts. There are periods when each scheduled call results in a connection and new data, but there are also periods when each scheduled call fails to connect. Over the last 4 months I made 1450 calls to Greenland. Only 189 of these 1450 calls resulted in a connection. That is a failure rate of 87%. It admittedly includes one desperate day (Sept.-18) when I made a call every 3 minutes and each call failed. This desperation was after a 10-day sequence of failed calls when I lost my cool. There were 86 out of 130 days when a successful connection was made, that’s still a large failure rate of 34%, but there are zero missing data so far. [The station was set up Aug.-20.]

Logs-OWS

The advantage of the fickle dial-up connection is that I only need one connection to recover all data that has been collected since the last successful call. This differs from the SBD text message, where a lost connection means lost data. Furthermore, the connection to the Greenland station is a regular RS-232 connection which acts the same as the iPhone connected to the computer from which I type these lines. Hence software changes are possible, too, as scary as they may be.

Now why is the Iridium connection acting in a such a bi-polar fashion, that is, working like a charm for weeks and months to suddenly shut down completely for days to weeks just as suddenly? My honest answer is that I do not know. Furthermore, nobody really knows for sure. There is some talk in hidden places that Iridium modems or phones “de-register” themselves from the Iridium network, if they do not start a phone call. This is no problem for the SBD message as the Greenland modem always does the calling. It does matter for my dial-up, because the Greenland modem never initiates a call, it only responds when called after the Greenland computer gives it the power to do so. Which brings me to

‘Fake call’
Register_Modem = “ATDT 1234″ & CHR(13) & CHR(10)
SerialOpen (ComRS232,19200,0,0,2000)
Delay (0,1,Sec)
SerialOut (ComRS232,Register_Modem,””,0,0)
SerialClose (ComRS232)

The “fake call” is a software update that tells the Greenland modem to, well, make a fake call. The text string Register_Modem contains a non-existing phone number (I hope) 1234 as well as a carriage return CHR(13) and a line feed CHR(10) and the string is send via SerialOut to the modem that is addressed here as ComRS232 after the serial port between Greenland computer and modem is opened via SerialOpen. Lets see how this works over the next days, weeks, and months. For the first time, I received this morning a response from Greenland that it was “BUSY.” I took this as a good sign …

PostScript: Data look awesome with new, large, and unexpected diurnal variations that started Dec.-8.

Ocean temperature (black) and salinity (red) below Petermann Gletscher from Dec.-6 (Day-340) through Dec.-31 (Day-365). Top panel is just below the glacier ice at 95-m below sea level while bottom panel shows data 810-m below sea level.

Ocean temperature (black) and salinity (red) below Petermann Gletscher from Dec.-6 (Day-340) through Dec.-31 (Day-365). Top panel is just below the glacier ice at 95-m below sea level while bottom panel shows data 810-m below sea level.

Sun Sets over Petermann Gletscher

Lights are out. Our ocean weather station on a floating glacier of northern Greenland confirms what the U.S. Naval Observatory reports for location 60 degrees and 30 minutes West longitude and 80 degrees and 40 minutes North latitude: As of today the sun is no longer above the horizon and will not rise until 23 February 2016. Total darkness means no solar power for the station that will have to survive on a fancy car battery temperatures as low as -50 degrees centigrade. Last week with the sun still up our station recorded -30.4 degrees celsius about 4 feet above the ice. How long will the station survive on that car battery?

Petermann Gletscher at dawn on 5 Oct. 2015 as captured by NASA Operation IceBridge. Our Ocean Weather Station is in the corner bottom left.

Petermann Gletscher at dawn on 5 Oct. 2015 as captured by NASA Operation IceBridge. Our Ocean Weather Station is in the corner bottom left.

Without power the station does not function, because each sensor, each computer, and each telephone call via the Iridium satellite system requires electricity. Without power I am in the dark about what the station does or what ocean or air temperatures are. Since I do have power at the moment, well, I got new data. For example, there is a voltage that the station sends me …

Voltage at Ocean Weather Station on Petermann Gletscher.

Voltage at Ocean Weather Station on Petermann Gletscher.

… whenever the sun is up, the solar panels recharge the battery and the voltage goes up. As I use electricity, the voltage goes down. Lets ignore a small temperature effect and details on how much electricity we draw at what “amperage.” Instead, lets focus on the regular up and down of voltage for the last 60 days and how it suddenly went flat. The flat line at 12.5 Volts tells me that the sun is down. The station now uses the car battery, but how long will this last? Quick answer is … a day, if I am dumb. Or 150 days, if I am smart. Time will tell, if I made a mistake in either my power budget or my computer code that gives and takes power to a range of sensors. Scary stuff, and my little sister Christina Parsons can attest, how nervous I was, when I uploaded new power-saving software that I wrote from my attic at home to the station in Greenland. The station did take the new software, restarted itself, and works making one data call each day instead of three. Data are still collected every hour, but I save 20% of total power.

Power is something in Watts (40 W Light bulb anyone?) and you have to multiply voltage by current draw (0.5 Amps anyone?) to estimate the power needs of the device drawing 0.5 Amp current at 12 Volts. Incidentally, 0.5 Amps is what the Iridium satellite phone draws when it calls me with new data. Let me check my power budget, if this is true … nope, it only takes 0.365 Amps, so it takes 12 volts times 0.365 Amps equal 4.4 Watts which is about 1/10 of that 40 W light bulb you are looking at, perhaps, or the station we put up: the yellow box is the car battery powering all the gadgets you see and many more you do not:

What I just showed you is the beginning of a power budget that I had to make to get my station through the night, now that there is no more sun for the next 4-5 months. My car batteries are rated to give 110 Watts for an hour, so if I run my 4.4 W satellite phone all the time, I would be out of battery juice after 110 Watt-Hours divided by 4.4 Watts equals 25 hours. That’s bad, real bad, especially since one should not run a car battery to zero and the battery at -30 degrees Celsius may only give me half the power than it would at the more usual 15 degrees Celsius we got outside. The solution to this problem is to use the phone only for a few minutes each day, say 5 minutes. So, since I am using the phone only 5 minutes out of the 1440 minutes that each day has, it takes about 1440 minutes divided by 5 minutes times 25 hours equals 300 days for the phone running 5 minutes each day to run down the battery. Magic this math is not, but it shows how important it is to use resources (electricity) wisely. There are times and places where it is not possible to plug your iPhone into a power outlet. You get the picture … well, here are some that University of Delaware PhD student Peter Washam took who was part of the ice drilling team during last summer’s deployment of the ocean weather station:

So, as of this morning at 4 am Delaware time, the station now in total darkness tells me that the ocean temperatures 700 meters below the 100 meter thick glacier are +0.3 degrees Celsius while air temperatures 2 meters above the ice are -11.1 degrees Celsius. Now what that means to the melting of the glacier by the ocean, I will have to tell you at another time in more detail. These data are the ONLY data from below any glacier to the north of the equator. We are really breaking new ground and are making new discoveries as we go along … as long as there is power. Hopefully there is no dumb mistake in my power budget.

Sun over the horizon of Greenland as seen during NASA's Operation IceBridge Flight in October 2015.

Sun over the horizon of Greenland as seen during NASA’s Operation IceBridge Flight in October 2015.

Ocean Weather Below a Greenland Floating Glacier

Sensing the oceans below ice as thick as the Empire State Building is tall, we are revealing some of the mysteries of ocean melting of one of Greenland’s largest glaciers. The expedition to Petermann Fjord last month made possible the deployment of three ocean sensing stations that all call home daily via Iridium satellite phone to send us new data from 800 meters below sea level. The ice of the glacier at our stations is 100 to 300 meters thick and a whimsical cable with 3 tiny wires connects the instruments under the glacier to a home-made computer that calls home daily with new data. I am still stunned at the many marvels of technology that all came together to make this happen.

University of Delaware PhD student Peter Washam at the Ocean-Weather station on Petermann Gletscher after final installation 2015-Aug.-20, 17:00 UTC at 80 39.9697 N and 60 29.7135 W.

University of Delaware PhD student Peter Washam at the Ocean-Weather station on Petermann Gletscher after final installation 2015-Aug.-20, 17:00 UTC at 80 39.9697 N and 60 29.7135 W.

Panoramic view of the ocean-weather station on Petermann Gletscher. View is towards the south-east with Washington Land in the background.  [Photo credit: Peter Washam].

Panoramic view of the ocean-weather station on Petermann Gletscher. View is towards the south-east with Washington Land in the background. [Photo credit: Peter Washam].

It started with an off-the-shelf automated weather station that David Huntley at the University of Delaware put together for me with the non-standard addition of 5 serial ports that each allow one ocean sensor to be connected by cable to the weather station. It continued with the holes that Paul Anker and Keith Nicholls of the British Antarctic Service drilled through Petermann Gletscher. My PhD student Peter Washam was on the ice helping with the drilling, preparing the ocean sensors, and he is now processing some of the new ocean data.

AWS2015

The map above shows Petermann Gletscher (bottom right), Petermann Fjord, and adjacent Nares Strait. The red lines are bottom depths at 500 and 1000 meters while the thick black line shows the location where the 550-m thick glacier sits on bed rock. All glacier ice seaward of this black line is floating with warm ocean waters below. These waters enter the fjord at he sill at the entrance to Petermann Fjord which is about 450 meters deep. The blue dots are locations where last months we collected detailed profiles of ocean temperature salinity, and oxygen. The warmest water inside the fjord and under the glacier enters near the bottom at this sill. The green dots on the glacier are the 3 drill sites where we put our ocean sensors down while red triangles are “fancy” GPS receivers that we placed for almost 2 weeks on the glacier. The one triangle on land (bottom right) is a permanent GPS station at Kap Schoubye that UNAVCO maintains under the code name SCBY. We will reference our moving glacier GPS station (the glacier moves) to this fixed station on bed rock, but that’s a story for another day.

The ocean data are worked up by a small, but wonder group of men and women of all ages working out of the universities of Gothenburg (Sweden), Oxford (England), and Delaware (USA) as well as BAS (England). It is very much an informal group of people who like each other and met in strange ways over the last year or so with all of us juggling way too many projects for which we all have way too many ideas. Bottom-up collaboration and sharing at its best from the bottom up.

Two quick highlights rushed onto these pages before I have to run off to teach a class on signal processing:

Measurements from the ocean weather station up until 2015-Sept.-11 as a function of time where Day-20 is Aug.-20 and Day-32 is Sept.-1. The station provides battery voltage (bottom panel), air and ocean temperatures, wind speed and direction, ice drift from GPS, and atmospheric pressure (top panel).

Measurements from the ocean weather station up until 2015-Sept.-11 as a function of time where Day-20 is Aug.-20 and Day-32 is Sept.-1. The station provides battery voltage (bottom panel), air and ocean temperatures, wind speed and direction, ice drift from GPS, and atmospheric pressure (top panel).

Ocean temperature (black) and salinity (red) observations from below the ice shelf of Petermann Gletscher at 5 different vertical levels from near the bottom (bottom panel) to the ice-ocean surface (surface panel).

Ocean temperature (black) and salinity (red) observations from below the ice shelf of Petermann Gletscher at 5 different vertical levels from near the bottom (bottom panel) to the ice-ocean surface (surface panel).The bottom of the ice shelf is about 90 meters below sea level.

Note that the scales for temperature and salinity are different at different vertical levels. The warmest water is always found near the bottom while both temperature and salinity under the ice shelf vary by a larger amount that we had initially expected. This means that there are direct and fast connections of the ocean under the glacier with waters inside the fjord and beyond. Notice also that air temperatures are well below freezing (0 degrees Celsius) for 2-3 weeks now while the ocean waters are well above freezing (-1.7 degrees Celsius) everywhere. Hence there is no melting at the surface while there is much melting at the bottom of the glacier. While trivial, this emphasizes the controlling influence that the oceans have on glaciers and ice shelves such as Petermann Gletscher. In the meantime, we got much exciting and fun work ahead of us.

Shout of thanks to NASA (and the US tax-payers) who funded this ocean-weather station at the University of Delaware at about $64,000 for a single year and NSF (and again the US taxpayers) who funded the larger ocean- and land-based experiments within which small part was embedded.

Münchow, A., Padman, L., and Fricker, H.A. (2014). Interannual changes of the floating ice shelf of Petermann Gletscher, North Greenland from 2000 to 2012, Journal of Glaciology, Vol. 60, No. 221, doi: 10.3189/2014JoG13J135

Johnson, H., Münchow, A., Falkner, K., & Melling, H. (2011). Ocean circulation and properties in Petermann Fjord, Greenland Journal of Geophysical Research, 116 (C1) DOI: 10.1029/2010JC006519

Rignot, E., & Steffen, K. (2008). Channelized bottom melting and stability of floating ice shelves Geophysical Research Letters, 35 (2) DOI: 10.1029/2007GL031765

Lab Notes of a Physical Oceanographer

I go to sea to learn about oceans, glaciers, weather, and climate. Despite dramatic photos of exciting field work, those action-packed scenes or serene nature shots of beauty and violence are misleading. Most of my time is spent sitting an a desk in a spacious office with books, papers, telephone, and most important of all, my computers.

Most of my time is spent writing. The writing is varied and ranges from illustrated essays on IcySeas.org to computer code. Add technical writing of research proposals, papers, and reviews for funding agencies and scientific journals. My screen rarely looks like what is shown above with the beautiful LandSat image of 79N Glacier as a screen-saver, it actually looks like this

Picture 2

The blog-writing window is open on the right while a Fortran computer code is in the top left. The code processes temperature, salinity, and pressure data from Petermann Glacier. When the code is run in the bottom-left window, it produces numbers. In this specific case, the numbers are from the only profile of temperature and salinity that exists from Petermann Glacier. Koni Steffen collected the data in 2002. Columns are depths that start at -68 (meters), salinity at 33.774 (no units, think of this as grams per kilogram), temperature at -1.885 (degrees centigrade), and the last column is the density anomaly These numbers are better presented as a graph:

Koni2002raw

Notice that temperature and salinity start only at -68 meters. This is because the ice at this location was about 68-m thick. The Big Ben clock in London is about 96-m high, but this piece if Petermann was chosen because it was less hard to drill through 2/3 of Big Ben’s height when compared to drilling through the glacier ice a mile away where the ice is thicker than the Empire State Building in New York; but I digress.

The profile above reveals a pattern we find almost anywhere in deeper Arctic Waters: Temperature increases with depth. Under the ice at 68-m depth, water is at its freezing point. As you move down the water towards the bottom, salinity increases and so does temperature. It is still cold, about +0.2 degrees Celsius, but this is heat from the North Atlantic Ocean that for perhaps 20-50 years circled all the way around the Arctic Ocean from northern Norway, past Siberia, past Alaska, past Canada to reach this spot of Greenland. While this appears marvelous, and it is, this is NOT what gets a physical oceanographer excited, but this does:

Koni2002Gade

It is the same data, but I did some reading, physics, algebra and code-writing in that order. First, instead of temperature, the blue line shows the difference between temperature T and the temperature Tf above the freezing. The difference T-Tf relates to the amount of heat available to melt the ice somewhere. The black line is the real killer, though. It combines salinity and temperature observations to reveal where the glacier water resides at this location that was melted somewhere else. Without going into the physical details, glacier meltwater is present where the black line touches zero (the so-called Gade-line, so named after a Swedish oceanographer who proposed its use in 1979). This happens at a depth from about 280-m to 500-m depth. This means that the glacier is NOT melting where it is as thin as Big Ben, but instead where it is as thick as the Empire State Building. So this is where we will need to place our instruments.

Proving my initial point, I spent two hours of fun writing this blog. I now will have to focus on more technical writing to pay the many bills of sea-going research. These “lab-notes” also serve as a document to raise $10,845 to install instruments this summer through Petermann Gletscher, have a look and give a little, if you can at

https://experiment.com/projects/ocean-warming-under-a-greenland-glacier

Shellshock Bugs, Macs, and Unix Powers

I love my Apple to bits. My writing, teaching, coding, graphing, and playing are all done on a MacBookPro with two Intel 2.4 GHz processors running OS X 10.5.8 called “Leopard.” It was the up-to-date operating system from 2006-2009 and I never saw the need to change, as I was too lazy to fix something that is not broken. Until today when I learnt of a vulnerability deep inside the guts of my beloved Unix-machines.

For over 5 years this laptop has been running non-stop doing scientific computing on huge amounts of ice, ocean, and satellite data. It is this Unix environment that I cherish as it is open, transparent, elegant, and concise. It also allows me to use unlimited codes and tools of many open-source communities. My Apple also traveled with me on ships and planes to Arctic Canada, Greenland, Norway, Germany, and anywhere in-between. It travels daily on my bicycle from home to work and back.

Today I was worried when my student Pat told me about shellshock, a bug that potentially can give control to a hostile party smart enough to exploit this vulnerability for which Apple has not yet released a patch. So, did I have a problem? You bet.

STEP-0: From a terminal I entered the command

env x='( ) { : ; }; echo vulnerable’ bash -c “echo this is a test”

If the word “vulnerable” appears, then the bug is present. Also check the second flavor of the bug by entering the command

env X='( ){(a) =>;\’ bash -c “echo date”; cat echo; rm -f echo

If you see the actual date displayed (as opposed to the word “date”), then again you got the buggy code. Here is how I fixed it on my laptop and MacMini that hosts my work web-pages.

Step-1: I took this technical recipe, but not all elements worked for me:

$ mkdir bash-fix
$ cd bash-fix
$ curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf –

The above line failed me, but the added option -k worked to download the needed files from apple.com with the curl-command; the same was also true for the two other curl commands below that downloaded the patches from gnu.org It applies the patches to the files uploaded from apple.com prior.

$ curl -k https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf –
$ cd bash-92/bash-3.2
$ curl -k https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
$ curl -k https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-053 | patch -p0
$ cd ..
$ sudo xcodebuild

STEP-2: The above line “sudo xcodebuild” did not work for me for reasons I do not understand. I realized, however, that it was supposed to compile the patched codes to produce executable new files “bash” and “sh” free of the bug. I searched for and found the code-building application XCode.app on my computer as /Developer/Application/XCode.app and started it by point and click. Then via File > Open File I found the relevant “project file” bash.xcodeproj that was in the directory created previously, that is, bash-fix/bash-92 which I then opened within XCode.app Hit the button with the hammer called “Build and Go” and you build yourself a new bash.

Screenshot of compiling patched bash.xcodeprof using XCode.app

Screenshot of compiling patched bash.xcodeprof using XCode.app

STEP-3: Once the compilation and building of the executables is complete, all that needed to be done was to move the newly created, patched executable shells “bash” and “sh” into their rightful places deep within the guts of the operating systems. First, however, lets just save the buggy old files. From the command line

$ sudo cp /bin/bash /bin/bash.old
$ sudo cp /bin/sh /bin/sh.old

and as the last step move the new, patched “bash” and “sh” to their
root directory /bin:

$ sudo cp build/Release/bash /bin/.
$ sudo cp build/Release/sh /bin/.

I moved the binary files “bash” and “sh” to my web-hosting MacMini after renaming the old buggy ones, oh, and as a good practice (short
of deleting those old system files), I changed the permission settings.

Credit for this way to reduce a vulnerability on my dear machine belongs to this concise blog whose content is also presented in a more chatty voice. Wired Magazine adds a little drama in their story titled “The Internet Braces for the Crazy Shellshock Worm, but it took me longer to write and assemble this essay than it did patching the bug.

Unix is fun to hack.
Eric S. Raymond

Unix is not so much an operating system as an oral history.
— Neal Stephenson

ADDENDUM Sept.-28, 2014: A quick online to test for vulnerable web-sites and cgi scripts.

ADDENDUM Jan.-6, 2015: I apparently missed 3 more vulnerabilities that the above test may not check for, e.g., http://tenfourfox.blogspot.com/2014/09/bashing-bash-one-more-time-updated.html