Difference between revisions of "OpenPlotter"

From wiki.bastelbude.grade.de
Jump to: navigation, search
(Setup piCAN2:)
(Setup piCAN2:)
Line 61: Line 61:
 
</pre>
 
</pre>
  
* add to /etc/network/interfaces (overwritten by '''/home/pi/.config/openplotter/wifi_server.py'''!)
+
* add to '''/etc/network/interfaces''' (might be overwritten by '''/home/pi/.config/openplotter/wifi_server.py'''!)
 +
<pre>
 +
source /etc/network/interfaces.d/*
 +
</pre>
 +
 
 +
* add to '''/etc/network/interfaces/interfaces.d/can0'''
 
<pre>
 
<pre>
 
#physical can interfaces
 
#physical can interfaces
Line 69: Line 74:
 
down /sbin/ip link set $IFACE down
 
down /sbin/ip link set $IFACE down
 
up /sbin/ifconfig $IFACE txqueuelen 10000
 
up /sbin/ifconfig $IFACE txqueuelen 10000
 +
</pre>
 +
 +
* add to '''/etc/network/interfaces/interfaces.d/vcan0'''
 +
<pre>
 +
#virtual can interfaces
 +
auto vcan0
 +
iface vcan0 inet manual
 +
pre-up /sbin/ip link add dev $IFACE type vcan
 +
up /sbin/ifconfig $IFACE up
 
</pre>
 
</pre>
  

Revision as of 15:00, 28 March 2018

https://sailoog.gitbooks.io/openplotter-documentation/en/

general

Aim

  • fit a cheap and open source ECDIS on board of a sailing vessel
  • yacht has SeaTalkng network (/w Raymarine iTC-5 Converter)

Parts (boat specific)

  • Seatalkng extensions:
    • Spur-Kabel mit 1 offenen Ende 3m Art.-Nr: A06044 EUR 40,-
    • 5-Wege-Verbinder Art.-Nr: A06064 EUR 35,- (alternativ T-Stück Art.-Nr.: A06028 EUR 25,-)
    • Backbone-Kabel 0,40m - A06033 EUR 30,-

Mini-PC

  • Raspberry Pi 3 Model B+ EUR 35,-
  • 16GB MicroSD Card EUR 10,-
  • PiCAN 2 EUR 45,- or PiCAN 2 incl. SMPS EUR 52,-

openPlotter

Setup Pi:

Setup Android:

  • RDC from playStore (working)
  • aRDP free from playStore (suits my needs best)

Setup piCAN2:

  • (in case you want to play with virtual-can-interfaces) add to /etc/modules
vcan
  • add to /boot/config.txt
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
  • add to /etc/network/interfaces (might be overwritten by /home/pi/.config/openplotter/wifi_server.py!)
source /etc/network/interfaces.d/*
  • add to /etc/network/interfaces/interfaces.d/can0
#physical can interfaces
allow-hotplug can0
iface can0 can static
bitrate 250000
down /sbin/ip link set $IFACE down
up /sbin/ifconfig $IFACE txqueuelen 10000
  • add to /etc/network/interfaces/interfaces.d/vcan0
#virtual can interfaces
auto vcan0
iface vcan0 inet manual
pre-up /sbin/ip link add dev $IFACE type vcan
up /sbin/ifconfig $IFACE up
  • install canboat
mkdir ~/canboat
cd ~/canboat
sudo apt-get install xsltproc
git clone git://github.com/canboat/canboat
cd canboat
sudo make
sudo make install
sudo apt-get install libconfig-general-perl
  • copy and edit /home/pi/canboat/canboat/config/n2kd to /etc/default/n2kd (is this really needed?)
  • add to /home/pi/.config/openplotter/OP-signalk/openplotter-settings.json (OP ver 0.10.0)
  • add to /home/pi/.openplotter/openplotter-settings.json (OP ver 0.17.0)
{
  "id": "n2k-can0",
  "pipeElements": [
    {
      "type": "providers/execute",
      "options": {
        "command": "candump can0 | candump2analyzer "
      }
    },
    {
      "type": "providers/liner",
      "options": {
        "rawlogging": true,
        "logdir": "logs",
        "discriminator": "2"
      }
    },
    {
      "type": "providers/n2kAnalyzer"
    },
    {
      "type": "providers/n2k-signalk"
    }
  ]
}

configure kplex and signalk

  • 'Signal K Server Plugin Configuration' > activate 'Convert Signal K to NMEA0183'
    • select sentences you are interested in
  • NMEA0183 (this is kplex) > Advanced >
    • add input channel tcp:localhost:10110
    • remove filter at opencpn out channel
[tcp]
name=signalk_in
direction=in
address=localhost
port=10110

[tcp]
name=opencpn
direction=out
mode=server
port=10109

experimental

    {"pipeElements": [
      {"type": "providers/execute", "options": {"command": "candump can0 | candump2analyzer | analyzer -json -si -nv"}},
      {"type": "providers/liner"},
      {"type": "providers/from_json"},
      {"type": "signalk-socketcan-device", "options": {"n2kAddress": 110, "canDevice": "can0"}},
      {"type": "providers/n2k-signalk"}
      ],"id": "n2k-can0"
    }

blackBox

setup minibian

setup piCAN2

  • install can-utils
apt-get install can-utils
  • add to /boot/config.txt
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
  • add to /etc/modules
vcan
  • add to /etc/network/interfaces
source /etc/network/interfaces.d/*
  • add to /etc/network/interfaces/interfaces.d/can0
#physical can interfaces
allow-hotplug can0
iface can0 can static
bitrate 250000
down /sbin/ip link set $IFACE down
up /sbin/ifconfig $IFACE txqueuelen 10000
  • add to /etc/network/interfaces/interfaces.d/vcan0
#virtual can interfaces
auto vcan0
iface vcan0 inet manual
pre-up /sbin/ip link add dev $IFACE type vcan
up /sbin/ifconfig $IFACE up
  • install canboat
apt-get install xsltproc
apt-get install gcc
apt-get install make
apt-get install git
mkdir ~/canboat
cd ~/canboat
git clone git://github.com/canboat/canboat
cd canboat
sudo make
sudo make install

signalK

apt-get update
apt-get install -y curl git build-essential dialog
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install nodejs
apt-get install libnss-mdns avahi-utils libavahi-compat-libdnssd-dev
npm install -g --unsafe-perm signalk-server
signalk-server-setup
reboot
    {
      "id": "canboat",
      "pipeElements": [
        {
          "type": "providers/simple",
          "options": {
            "logging": false,
            "type": "NMEA2000",
            "subOptions": {
              "type": "canbus",
              "interface": "vcan0"
            }
          }
        }
      ],
      "enabled": true
    }

samba