Tag: synology

  • Daily backup to external hdd

    Daily backup to external hdd

    Goal

    Domoticz has a built in feature to automatically create hourly, daily and monthly database backups in the /home/pi/domoticz/backups/ directory. You just need to tick the Enable Automatic Backup option in System setup.
    However in the case the SD-card crashes and is no longer accessible, a lot of work still could be lost.
    This page will provide you several backupscripts, each with other functions.

    Preparation

    Search the folder on your Network Attached Storage (NAS) where you want the backups to be stored. Check that FTP is enabled and have login credentials available.

    Make sure that if you have enabled website protection, e.g. if your Domoticz webpage is password protected, that you enable Local Networks (no username/password)in your settings. Fill in your local network IP-address (192.168.1.* for example), otherwise the backup will fail.

    Place the script below in:/home/pi/domoticz/scripts and change the parameters to reflect to your settings. (more…)

  • Traccar installation on Raspberry Pi

    Traccar installation on Raspberry Pi

    Download and install Traccar

    Download Traccar

    wget https://github.com/tananaev/traccar/releases/download/v3.4/traccar-linux-arm-3.4.zip

    Unzip downloadfile

    unzip traccar-linux-arm-3.4.zip

    Remove zipfile

    rm traccar-linux-arm-3.4.zip

    Run install script

    sudo ./traccar.run

    Start Traccar Server

    sudo java -jar /opt/traccar/tracker-server.jar

    Optional configuration

    Make autostart on boot

    Start crontab

    crontab -e

    Add following line to the bottom of the file

    @reboot /usr/bin/nohup /usr/bin/java -jar /opt/traccar/tracker-server.jar

    Exit crontab and save file

    Reboot Raspberry Pi

    sudo reboot

    (Source: http://www.forum-raspberrypi.de/Thread-tutorial-tracking-server-mit-traccar)

    Use an external MySQL database like Synology

    By default Traccar Server uses embedded H2 database. If you want to use MySQL database engine you need to replace following lines in configuration file:

    <entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:/home/user/Documents/traccar/target/database</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>

    Configuration parameters for MySQL (replace 127.0.0.1, [DATABASE], [USER], [PASSWORD] with appropriate values):

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
    <entry key='database.url'>jdbc:mysql://127.0.0.1:3306/[DATABASE]?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=latin1&amp;sessionVariables=sql_mode=ANSI_QUOTES</entry>
    <entry key='database.user'>[USER]</entry> 
    <entry key='database.password'>[PASSWORD]</entry>

    NOTE: Traccar will create tables for you, but you need to create database with selected name by yourself.
    (source: https://www.traccar.org/mysql/

    Configuration of devices

    RF-V16

    Device transmits on port 5005. Traccar listens default to this protocol (H02) on port 5013. Make port forward in router 5005 → 5013 or swap port numbers in .xml configuration file.

    Known issues

    Using Synology MySQL database (update)

    = (UPDATE) PROBLEM SOLVED in version 3.4 = You can make version 3.3 work with the Synology MySQL database with a small modification. Change in the .XML configurationfile ‘UTF-8’ to ‘latin-1’. The developer know this problem and it will be solved in the near future.

    Version 3.2 works great without this specific modifcation