Thursday, January 09, 2020

dAISy AIS HAT for the Raspberry Pi

Just received the dAISy HAT from Wegmatt, it just works!
Whoever can click can do it.

And this was the opportunity to keep working on the AISParser, and I have also added a custom TCP Forwarder to the Multiplexer, along with an AIS filter on the regular TCP Forwarder.

This way, you can forward NMEA data on one port, and AIS data on another one. This is not necessary, but it can be nice to have.

Here is an example of a yaml driving the Multiplexer:

#
# MUX definition.
#
name: "With a GPS and AIS"
context:
  with.http.server: true
  http.port: 9999
  init.cache: true
channels:
  - type: serial
    # GPS
    port: /dev/ttyUSB0
    baudrate: 4800
    verbose: false
  - type: serial
    # AIS
    port: /dev/ttyS0
    baudrate: 38400
    verbose: false
forwarders:
  - type: tcp
    port: 7002
    properties: no.ais.properties
  - type: tcp
    subclass: nmea.forwarders.AISTCPServer
    port: 7003
computers:
  - cls: nmea.computers.AISManager
    properties: ais.mgr.properties

And OpenCPN is happy in both cases.

See more details here.

Friday, August 30, 2019

Autonomous Raspberry Pi

Solar powered, with a wireless keyboard and touchpad.

Solar powered, with a wireless keyboard and touchpad.


The solar panel

Closed. The keyboard can also fit in the box.

Sunday, April 21, 2019

San Juan Islands, WA

Data logging in San Juan Islands, Washington:

Apr 19-21, San Juan Island

Apr 22, San Juan Island to Orcas Island

Apr 23, Hiking in Orcas Island

Apr 24, Hiking in Orcas Island, Mountain Lake

Apr-25, Back ashore


Data logging was done as explained here, here and here.

Tuesday, March 12, 2019

Easy Low Pass Filter

Instead of implementing a buffer and smooth it, there is a much easier and efficient way to do it. Here is a simple JavaScript implementation. First you define your accumulator function:
 function lowPass(alpha, value, acc) {
   return (value * alpha) + (acc * (1 - alpha));
 }
Then you need to define your APLHA coefficient:
 const ALPHA = 0.015;
Then you can invoke the accumulator with the aplha coefficient on the data to smooth:
 let filteredGustArray = [];
 let acc = 0;
 data.data.forEach(dp => {
   acc = lowPass(ALPHA, dp.gust, acc);
   filteredGustArray.push(acc);
 });
This produces an array containing the smoothed data. Here is a representation of what it looks like, along with the data to smooth (raw data in red, smoothed data in blue):
The demo data are available here. Just run the script with nodejs like
 $ node max.gust.js both > data.csv
This will produce a csv file you can then import into any spreadsheet program, to see the figure above.

Monday, March 11, 2019

Smart TCP Watch, prototype.

TCP, no BlueTooth (and as a result, no Smart Phone) is required. The "watch" can connect directly to the network.
See a first prototype here.
And a short video here.

Monday, November 26, 2018