HomegrownMarine / boat_computer

Platform for processing and interacting with boat sensor data. Runs on Raspberry Pi or BeagleBone Black.
MIT License
38 stars 5 forks source link

HomeGrown Marine: Boat Computer

The HomeGrown Marine Boat Computer is a platform for processing and interacting with boat sensor data, such as GPS speed, position, heading, and wind. It runs on a small PC on the boat, like a Raspberry Pi or Beaglebone Black, so you can build a WiFi streaming boat computer for under $100. Its designed with a modular architecture that will let you pick and choose the functions you need, or easily develop your own modules. With this, you can build a regatta processor to compete with very expensive offerings from the big guys.

It is designed using Node.js, which allows for a really flexible and light weight webserver. And, Node's event based architecture also works really well with the nature of sensor data. Modules that process and consume event data can cleanly subscribe to relavent events, such as new wind or gps messages.

Included Apps:

Other App Projects:

Build One

This can be done easily, with a little soldering and assembly.

Materials:

The serial data converter will convert from the 12V RS-232 style data sent by your instruments to 3V TTL as expected by the miniPC.

TODO: diagrams and pictures.

  1. Install node.js and forever on boat PC

    • Raspberry Pi
    • BeagleBone Black - comes pre-installed on BeagleBone Black
  2. Copy boat_computer project and any desired apps to boat PC

  3. install node serial port

  4. run '''npm install''' from the project directory

  5. install startup scripts make sure apache is disabled if you want to use port 80

If you're have trouble setting this up and getting it running, please open an issue to ask for help here.

If you just want to record your boat data, check out this simple NMEA Logger. It will just log boat data to an SD card.

Make An App

Apps are the way of extending your boat computer. They can be light-weight, just responding to data changes, or they can include a web based user interface component. The boat computer will import, and try and call a load method on every file or directory in the apps/ directory. The load method will receive three arguments: server, boat_data, and settings.

module.exports.load = function(server, boat_data, settings)

server

server is the Boat Computer webserver. It can serve simple static web pages and server dynamic programic interfaces into the sensor data. It is an express.js server object.

settings

Settings is the global preference and configuration storage mechanism. It only has two methods: get(key) and set(key, value). So, if an app needs to either save a user preference or configuration value, this is the way to do it.

boat_data

boat_data is the interface to the boat's NMEA 0183 instrument system. It can either receive or broadcast nmea messages or parsed data. Receiving data works by subscribing to one of three events:

sending data to other apps and the instrument system is done by calling boat_data.broadcast(message,data). If only message is specified, it will be sent only to the serial bus. If data is specified, as a json object, it will be broadcast to the rest of the apps on your system. If an encoder is specified for the data type, it will also be encoded into a NMEA sentence and broadcast over the serial bus.

TODO:

- use homegrown nmea

Next Steps