Sunday, July 31, 2016

Image hash functions

I really need to spend some time with image hash functions (geometric hashing).  It would be really helpful for testing to have these in the core GDAL toolbox.  And maybe there needs to be a gdal compare commandline tool that does those plus what perceptualdiff does.

Weird that VisionWorkbench doesn't have image hashes already in its code base.

Saturday, July 23, 2016

BBS door games of the 1980's

I just remembered playing "Nukem" on the Haunted House BBS in Los Altos, CA back around 1985-6 or so.  I don't remember them being called "door games".  You had to use your modem to call into the BBS and tell it that you wanted to enter the game as you logged out.  It would then drop into the game on your way out and you could specify for each round how many factories or missiles you wanted to build and how many missiles you wanted to launch at who.  This memory was triggered by hearing about Sumer/Hamurabi while listening to the Dreaming in Code audio book this morning.   I also remember "Inge's Abode" BBS run by David S? who was a few years older than me and was also in Boy Scout Troop 37.  It ran on his Apple II.  Ah the days of using an HP150 with thermal paper records of my sessions.  And before that it was an HP 2640A terminal.  The fun of Hayes modems.  Back when HP was cool and I got to meet Bill Hewlett when he would say hi to all the kids at the company parties up in the Santa Cruz mountains.

Monday, July 18, 2016

Playing with Javascript

There are lots of ways to play with Javascript, but here is one I broke out from the vaults...

sudo apt-get install rhinosudo apt-get install rlwrap
rlwrap rhino
Rhino 1.7 release 4 2013 08 27js> var s = "1234567890abc";js> s.slice(-5);90abcjs> 

Wednesday, July 6, 2016

Ricin - the poison

Ricin comes from the caster-oil plant (Ricinus).  I grew a few of these plants because the are a very fun / crazy looking plant.  I've noticed a whole bunch of what I think is the same plant growing along the river in Santa Cruz.  It's hard to see in the photo, but is is at the edge of the brown grass.

How to tap an AIS transceiver


The VTS provider has said there is no way to share the raw AIS data from this unit as it is a single serial port output. 
Do not use a splitter on the antenna.  That will drop the signal strength to both the AIS transceiver and any radio you add.

This is a failure of the VTS provider to think through much of anything.

You can tap RS-232 or RS-422 and listen in on the serial.  Or you can probably tap the serial port inside the OS.  Or the app could easily do a localhost UDP broadcast of the NMEA.  Or provide a TCP localhost service providing the raw TCP. Or the app could write the raw NMEA to log files that you tail (e.g. what tail -f does).  Or setup a service that listens to the serial port and provides a connection for the VTS software so it does not talk directly to the serial port (similar to what GPSD does) Or betting that this is windows there are options I don't know because I avoid MS windows.   If the VTS provider is Transis, they know better than to say this.  Or can put a computer with two ports in between the AIS transceiver and VTS machine and do forwarding of all messages. On a linux machine, you can modify the serial driver to send the data to a 2nd location.  Or maybe fiddle with the pts setup.  Or ...

Just look through socat for more ideas!

Here is an example socat command line I used a while back with the USCG AISUser.jar:

socat -u TCP:localhost:31414 - | grep --line-buffered 'r003669945' |  socat -d -v -u - TCP4-LISTEN:35001,fork,reuseaddr
An old AntiLog device with tap:

Sunday, July 3, 2016

Inter-VTS Exchange Format (IVEF)

The argument I heard for IVEF over AIS is that you get Radar info with IVEF. That seems like a bit wonky to me. When you talk about AIS, that usually implies that the system is talking NMEA and more recently, that might mean NMEA 0183 sentences wrapped in NMEA TAG BLOCK metadata. While I am not a big fan of NMEA, it does have messages for all sorts of stuff and there are message for Radar and ARPA targets in the spec. So why invent another protocol encoded in XML when you could either use NMEA or go something like MessagePack, protobuf/grcp, thrift, etc. Taking a look at the IVEF, there are things like logging in. One thing that has been well established is that security is very hard to get correct. So why not use a standard that tons of people use and beat up like OAUTH2?  I have no idea what IVEF would really buy anyone. Really, this feels like reinventing basic RPC services that the internet has had for ages.

And if you really want to pass radar targets via AIS, you could make RAVDM messages and use type 27 position reports with mmsi equal to your arpa target number.  Someone could even propose a change to ITU-1371 for type 1 or 27  to specifically designate radar targets.

Additionally, the reference implementation is GPL licensed, so any proprietary vendor will have to write their own implementation.  Outside of OpenCPN, there hasn't been a lot of open source software on ships and none that I know of in VTS operations centers. The big defense contractors like Lockheed are particularly against using open source from what I have seen.

Some figures from IALA Recommendation on the Inter-VTS Exchange Format (IVEF) Service, IALA V-145:

In NMEA 0183 4.0 (I bought this damn doc):

  • Sentence: RSD – Radar System Data  
  • Talker: Radar and/or Radar Plotting RA
See also:
My notes for people (not in the United States) setting up their own VTS  and/or WhaleAlert and/or Met/Hydro systems:

You can transmit standard IMO 289 AIS msg 8-1-22 using a simple computer (e.g. RaspberryPi + Linux), ssh via keys (just use passwordless), using any of a Class-A, ATON, or Basestation transceiver.  You just have to send it serial BBM messages. I originally used a class-A transceiver which left a "ship" at the location of the transceiver on short and then switched to a blue force Class A transceiver (which really is just a bios patch to the unit) to transmit only the area notices without sending the 1-2-3-5-27 messages a normal class b will send. will send IMO 289 standard 8-1-22 messages.


You could even do this with a software defined radio and have the entire hardware system cost < $300 USD (raspberrypi, gps board, sdr board, cell modem, power amplifier, cables, rf filters and antennas [ build your own J-Pole antennas ]) and the software would then be free after you get the basic glue scripts written.  SDR AIS transmission is specifically not allowed in the US, but would be totally awesome if allowed by the "competent regional authority" [that's the official term] in your area.

A word of warning:

As I tell everyone I talk to, I strongly encourage you to make sure you are always passthrough the original AIS NMEA through the system.  You will likely need it at a later date as your needs expand.  And IVEF does not give you very much of what comes through on the AIS channels and there are some super important missing things in the specification.