Installation

Installation Guide for Josev

This tutorial teaches how to install Josev Pro on a Linux system and configure systemd to manage Josev Pro. Josev Pro is compatible with other service managers (e.g. init.d) and works with any other MQTT broker. However, this tutorial assumes the MQTT broker Mosquitto is available on the Linux host, as as well as systemd.

Prerequisites

Before installing the Josev application, ensure that the following prerequisites are met:

  • Embedded system running a Linux-based operating system with systemd.

  • An MQTT broker is installed and configured on the system to facilitate communication.

  • A cs.service is implemented and configured to respond to the required MQTT messages. (A mock cs service will be provided if it is needed)

Quick Installation

  • Step 1: Download the Josev Bundles for your architecture

  • Step 2: Extract the Application Package

     $ tar -xzvf josev_pro_{version}_{arch}_{glibc_version}_{python_version}.tar.gz -C josev_pro
  • Step 3: Copy the bundles into your board. Usually the destination path is /bin/josev_pro

    $ scp -r josev_pro user@board_ip:/bin/josev_pro
  • Step 4: Connect to your board using ssh.

    $ ssh user@board_ip
  • Step 5: Create the path for the configuration files and create .env file

  mkdir /etc/josev_pro
  cd /etc/josev_pro
  s/nano/vim .env # open the .env file with your favorite text editor
  • Step 6: You can use the sample configuration for the first step. Configure the .env file for your board.

    MQTT_HOST=localhost
    MQTT_PORT=1883
    
    # OCPP CS Settings
    CS_DEFAULT_HEARTBEAT_INTERVAL=300
    DATABASE_URL=sqlite:///ocpp_service/cs.db
    
    CSMS_PING_TIMEOUT=30
    CSMS_SLEEP_TIME=10
    
    # LOG Settings
    LOG_LEVEL=INFO
    
    # SECC Settings
    FREE_CHARGING_SERVICE=False
    FREE_CERT_INSTALL_SERVICE=True
    ALLOW_CERT_INSTALL_SERVICE=True
    SECC_ENFORCE_TLS=False
  
    
    # Available authorization modes
    # EIM by default, set to PNC to enable Plug and Charge ex:"AUTH_MODES=PNC,EIM"
  • Step 7: Using a text editor, create a new systemd service file for the Josev applications:

    nano /etc/systemd/system/iso15118.service`
    [Unit]
    Description=ISO15118 service for Josev Pro
    Requires=mosquitto.service
    After=mosquitto.service
    StartLimitIntervalSec=0
    [Service]
    Type=simple
    Restart=always
    User=root
    WorkingDirectory=/etc/josev_pro
    ExecStart=/usr/bin/josev_pro/iso15118
    Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/bin/josev_pro
    StandardOutput=append:/var/log/iso15118.log
    StandardError=append:/var/log/iso15118.log
    
    [Install]
    WantedBy=multi-user.target
    nano /etc/systemd/system/ocpp.service`
    [Unit]
    Description=OCPP2.0 service for Josev Pro
    Requires=mosquitto.service
    After=mosquitto.service iso15118.service
    StartLimitIntervalSec=0
    [Service]
    Type=simple
    Restart=always
    RestartSec=1
    User=root
    WorkingDirectory=/etc/josev_pro
    ExecStart=/usr/bin/josev_pro/ocpp
    Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/bin/josev_pro
    StandardOutput=append:/var/log/ocpp.log
    StandardError=append:/var/log/ocpp.log
    
    [Install]
    WantedBy=multi-user.target
    nano /etc/systemd/system/slac.service`
    [Unit]
    Description=Slac service for Josev Pro
    Requires=mosquitto.service
    After=mosquitto.service
    StartLimitIntervalSec=0
    [Service]
    Type=simple
    Restart=always
    User=root
    WorkingDirectory=/etc/josev_pro
    ExecStart=/usr/bin/josev_pro/slac_service
    Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/home/root/josev_pro
    StandardOutput=append:/var/log/slac.log
    StandardError=append:/var/log/slac.log
    
    [Install]
    WantedBy=multi-user.target
    nano /etc/systemd/system/smart_charging.service`
    [Unit]
    Description=Smart Charging Service for Josev Pro
    Requires=mosquitto.service
    After=mosquitto.service cs.service
    StartLimitIntervalSec=0
    [Service]
    Type=simple
    Restart=always
    User=root
    WorkingDirectory=/etc/josev_pro
    ExecStart=/usr/bin/josev_pro/smart_charging_service
    Environment=PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/home/root/josev_pro
    StandardOutput=append:/var/log/smart_charging.log
    StandardError=append:/var/log/smart_charging.log
    
    [Install]
    WantedBy=multi-user.target
  • Step 8: Enable and Start the Josev Service

    • Reload systemd to apply changes.

      systemctl daemon-reload
    
    • Enable the Josev services to start on boot.

      systemctl enable --now iso15118
      systemctl enable --now ocpp
      systemctl enable --now slac
      systemctl enable --now smart_charging
    
  • Step 9: Verify Installation

    • Check the status of the Josev services to ensure it is running without errors.

      systemctl status iso15118
      systemctl status ocpp
      systemctl status slac
      systemctl status smart_charging
    
  • Step 10: Viewing Logs

    • Access logs for the Josev application using the tail command.

      tail -f /var/log/iso15118.log
      tail -f /var/log/ocpp.log
      tail -f /var/log/slac.log
      tail -f /var/log/smart_charging.log
    
  • Step 11: Done! Congratulations! You have successfully installed the Josev applications on your embedded system.