|
| 1 | +******** |
| 2 | +Firmware |
| 3 | +******** |
| 4 | + |
| 5 | +Introduction to Yocto |
| 6 | +===================== |
| 7 | + |
| 8 | +chargebyte hardware platforms are shipped with pre-flashed firmware including one of the following charging stacks: |
| 9 | + |
| 10 | +* EVerest charging stack along with platform specific EVerest modules e.g. CbSystem. |
| 11 | +* chargebyte's proprietary charging stack (only available for Charge Control C) |
| 12 | + |
| 13 | +The shipped firmware was created using the Yocto project; an open-source collaboration initiative that provides templates, tools, and methods to help developers create custom Linux-based systems for embedded devices. It supports a wide range of hardware architectures and provides a consistent, reproducible environment for developing, building, and maintaining embedded systems. To get familiar with the Yocto project, you can find all the required information on the project's `website <https://www.yoctoproject.org/>`_. |
| 14 | + |
| 15 | +.. _firmware_update: |
| 16 | + |
| 17 | +Firmware Upgrade |
| 18 | +================ |
| 19 | + |
| 20 | +The following sections describe different ways to install a firmware upgrade on your chargebyte product. Please ensure that the power supply is stable during a firmware upgrade. In case of an unsuccessful update or of power loss during the installation of the update, the chargebyte device performs a rollback to the previous stable version of the charging firmware. For more information about the rollback mechanism, see the section :ref:`rollback_mechanism`. The update is finished when the board is rebooted. |
| 21 | + |
| 22 | +The currently installed firmware version can be checked by reading the content of the file :code:`VERSION` found under :code:`/usr/share/secc`. |
| 23 | + |
| 24 | +.. _download_firmware_images: |
| 25 | + |
| 26 | +Download EVerest Firmware Images |
| 27 | +-------------------------------- |
| 28 | + |
| 29 | +EVerest firmware images are released by chargebyte on our meta-chargebyte-everest repository, which is the Yocto layer to build the firmware images. |
| 30 | +The image files can be found in the `"Release" section <https://github.com/chargebyte/meta-chargebyte-everest/releases>`_ of the |
| 31 | +repository. Here you can find the latest firmware images and also older released versions. |
| 32 | + |
| 33 | +.. note:: |
| 34 | + |
| 35 | + Please read the release notes of the firmware image before downloading and installing it. In the |
| 36 | + release notes you can find information about the changes and new features of the firmware image and |
| 37 | + also the version information which "everest-core" tag the firmware image is based on. This information |
| 38 | + is especially important if you build up your cross-compile environment in section :ref:`cross_compiling`. |
| 39 | + Please check that your cross-compile environment is using the same "everest-core" tag as the firmware |
| 40 | + image you want to install. |
| 41 | + |
| 42 | +Device Access |
| 43 | +------------- |
| 44 | + |
| 45 | +There are different possibilities to access the device for configuration or update purposes. Please look at section :ref:`connecting-via-ssh-or-serial-interface` for further details. |
| 46 | + |
| 47 | +Update via USB |
| 48 | +-------------- |
| 49 | + |
| 50 | +**Preparation of the USB update** |
| 51 | + |
| 52 | +#. Download the firmware update image file onto your workstation. |
| 53 | +#. Plug a USB flash drive into your workstation. |
| 54 | +#. Format the USB flash drive as EXT2/3/4, FAT16/32, exFAT or NTFS. |
| 55 | +#. Copy the firmware update image file (:code:`*.image`) onto the USB flash drive's root directory. |
| 56 | + |
| 57 | +Please note that you should not place multiple :code:`*.image` files onto the root folder of the USB flash drive, since it is not guaranteed in which order the files are tried and applied. |
| 58 | + |
| 59 | +**Updating the Firmware** |
| 60 | + |
| 61 | +#. Connect the board to the power supply. |
| 62 | +#. Wait until the board is booted. |
| 63 | +#. Connect to the board via SSH or Debug UART to backup all your own implementation, configuration and databases files. |
| 64 | +#. Plug in the USB flash drive with the Firmware Update Image file in the USB port of the board. |
| 65 | +#. Observe the LED update indications and wait until the whole firmware update and reboot process is finished - it takes up to 5 minutes. |
| 66 | +#. When the firmware update process is finished and the USB flash drive can be unplugged. |
| 67 | + |
| 68 | +Update via SSH and SFTP |
| 69 | +----------------------- |
| 70 | + |
| 71 | +#. Connect to the board via SSH (e.g. PuTTY). |
| 72 | +#. Backup all your own implementation, configuration and databases files if necessary. |
| 73 | +#. Transfer the update image file via SFTP to the board and store it in the directory :code:`/srv` with e.g. filename my-update.image. On Windows systems you can use e.g. WinSCP or Filezilla. |
| 74 | +#. Run the following command via SSH console: :code:`rauc install /srv/my-update.image`. |
| 75 | +#. The update process should start and report progress and success via console messages. |
| 76 | +#. Reboot into the new system by running the following command via SSH console: :code:`reboot`. |
| 77 | +#. Re-login into the new system and delete the file :code:`/srv/my-update.image`. |
| 78 | + |
| 79 | +Update via SSH or Serial Console and HTTP or FTP |
| 80 | +------------------------------------------------ |
| 81 | + |
| 82 | +#. Connect to the board via SSH (e.g. PuTTY) or serial terminal. |
| 83 | +#. Backup all your own implementation, configuration and databases files if necessary. |
| 84 | +#. Place the update image file on a HTTP or FTP server which is reachable via network by your chargebyte device. |
| 85 | +#. Note the URL of the download. In case authentication is required, you must provide the credentials in the URL, e.g. :code:`http://username: [email protected]/update.image`. |
| 86 | +#. Run the following command via SSH console: :code:`rauc install <url>`, where you replace the URL with your actual URL. |
| 87 | +#. The update process should start and report progress and success via console messages. |
| 88 | +#. After success, reboot into the new system by running the following command via SSH console: :code:`reboot`. |
| 89 | + |
| 90 | +Update via OCPP |
| 91 | +--------------- |
| 92 | + |
| 93 | +The firmware update via OCPP commands :code:`UpdateFirmware` and :code:`FirmwareStatusNotification` is implemented. Such an update via OCPP automatically triggers a reboot of the charge point after successfully installing the new firmware. The central system is notified about the successful installation before the reboot of the charge point. |
| 94 | + |
| 95 | +Support for casync based Firmware Updates |
| 96 | +----------------------------------------- |
| 97 | +As mentioned in the previous sections, the firmware update mechanism uses `RAUC <https://rauc.io>`_ as update framework. The traditional method of updating a device is that a big firmware update image file is transferred to the device and then installed. However, this approach is sometimes not ideal, for example when during different firmware releases only few parts changed. To address such scenarios, RAUC itself supports casync based bundles. For more details, please refer to RAUC's own documentation: https://rauc.readthedocs.io/en/latest/advanced.html#rauc-casync-support. It is obvious that such kind of firmware updates require an established Internet connection (or a locally available HTTP/FTP server which can be reached by the charging station) - but the concept does not work for USB pen drive firmware updates. |
| 98 | + |
| 99 | +On casync-enabled chargebyte firmware versions, it is possible to pass a URL referring to a casync firmware update image directly to the RAUC framework via :code:`rauc install <URL>`. Please remember that RAUC will use the passed URL to construct a base URL for accessing the smaller chunks. For example the URL :code:`http://example.com/update.raucb` would lead to the assumption that all chunks can be accessed via the base URL :code:`http://example.com/update.castr/`. Note, that the chunk store is a whole directory with many small files inside, not a simple file - the file extension like directory naming might suggest this. |
0 commit comments