This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
transfer influx data from the boat to a server
So I am running openplotter with influxdb on my boat, and was looking for a way to transfer data from influxdb on the boat to another influxdb on a computer at home. 

Since the boat is only connected to the internet at some times, all "official" influxdb methods i found are not feasible.

I installed termux (basically a mini Linux environment) on my Android phone, and inside termux i installed openssh and rsync, and deployed the ssh key to openplotter for passwordless login:

pkg upgrade
pkg install openssh rsync
cat .ssh/id_rsa.pb | ssh pi@openplotter "cat - >> .ssh/authorized_keys"

On openplotter i added the user pi to the group influxdb and made sure that he can read all contents of /var/lib/influxdb 

sudo su -
cd /var/lib/influxdb
chmod -R g+r *
for i in `find -type d`; do chmod g+x $i; done

Now, whenever i am on the boat, i can connect my phone to the open plotter wifi and use rsync in termux on my phone to get a snapshot of the influx database.

rsync -a pi@openplotter:/var/lib/influxdb transfer
On my home server, i set up a dedicated influxdb server, and when i am back home, i just stop the server, use a similar rsync command to drop the data from my phone and restart it.

Rsync is fairly efficient for this job, as it only transfers new files and changes in files, but does not copy unchanged files.

Of course there would be a shortcut, if either openplotter or my home server could be reached from the internet ( e.g. using  Wink

Forum Jump:

Users browsing this thread: 1 Guest(s)