Forums & Support

Raspberry pi setup?

Hello

I’m using this guide for setting up the software based version of floathub

I’m having some issue with the setup. I was wondering how to configure the settings. For example, when I try to use ./sfh -i [ID] nothing happens for a while, but it tells me “Can’t find any host to connect to at fdr.floathub.net:50003.” The same occurs when putting in the device key.

What should I do here?

First, try verbose mode by adding a -v:

./sfh -i xxxxxxxx -v

and let us know what that spits out.

Seems like you’ve probably solved the host connection issue based on looking at some incoming messages at this end. Note that you’d need a non-default FloatHub ID and Security Key to track data specific to your location/vessel. Certainly not required, but you can get one here if you want:

https://floathub.com/signup

Adding the -v tag displays nmea data in the console.

But you still can’t connect to fdr.floathub.net on port 50003?

If you just do a:

host fdr.floathub.net

on the pi command line, what do you get?

I receive an ip address.

34.198.148.176

Super. So it can resolve.

And if you try just a straight telnet:

telnet fdr.floathub.net 50003

You should get something on your terminal like:

    Trying 34.198.148.176...
    Connected to fdr.floathub.net.
    Escape character is '^]'.

if you then type:

    hello

and hit enter, you should get back:

     $FHR$ OK
     Connection closed by foreign host.

How’s that look at your end?

Telnet unfortunately does not work on my raspberry pi. I’ve tried apt-get install, but the telnet command is not found. Any other alternative for connection testing?

This should install telnet on most Pi’s:

sudo apt-get install telnet

No luck with that at this end.

Nevermind! I did a few reboots and it works now. I received the expected outputs.

Excellent. Let us know if you need any other deta

One more thing. I have a source of NMEA data coming via USB. How should I configure this as a source of data for floathub?

Longer answer is that we should extend the sfh package to have an option for USB/Serial data. Stay tuned on that.

Quick answer is that you could use kplex:

    http://www.stripydog.com/kplex/quickstart.html

and check, in particular, the “Serial to Network Conversion” part of that document.

So in order to have everything up and running, I would do a command like this?

./sfh -p 2000 -s localhost -i foobar99 -k 42424242424242424242424242424242

Where -i and -k are the floathub ID and key respectively?

Yes on -i and -k.

The -p and -s part depends on how you have kplex set up, but yes, assuming you have kplex setup on the same device and serving TCP NMEA data on port 2000, that would be correct. The -v flag will verify what it is receiving (via IN: messages).

I’m receiving a failed to connect response.block

This is what my kplex config looks like. Is there anything wrong here?

Anything that starts with # is a comment, and so is ignored by kplex.

So you probably want something like:

[serial]
# This is a comment and ignored
filename=/dev/ttyUSB0
direction=in
baud=38400
[tcp]
mode=server
port=2000
direction=out

Ah, okay. Thank you. I checked to see what ports are being in use to make sure kplex is broadcasting, but it seems that 2000 isn’t in use. Am I missing anything specific to run kplex? Maybe a reboot? Still receiving a failed to connect.

You can check kplex (without sfh running) by trying a simple:

telnet localhost 2000

If kplex is serving NMEA, you will see it on the terminal when telnet connects. If telent can’t connect to 2000 or something else happens when you try to connect on 2000, then something is misconfigured.