openbikesensor / OpenBikeSensorFirmware

Overtaking distance measurements for cyclists
https://www.openbikesensor.org/
GNU Lesser General Public License v3.0
110 stars 26 forks source link
arduino esp32 firmware

OpenBikeSensor

GitHub version GitHub version GitHub downloads GitHub commits since latest release (by date)

GitHub version GitHub version GitHub last commit GitHub downloads

GitHub downloads OpenBikeSensor - CI Open Issues Contributors quality gate bugs Discourse Discourse Matrix

Platform for measuring and collecting data on a bicycle. Currently, we measure the distance with either HC-SR04 or JSN-SR04T ultrasonic sensors connected to an ESP32.

Description

Inspired by the Berlin project Radmesser. This version uses a simple push button at the handle bar to confirm distance-measures were actually overtaking vehicles. It has its own GPS, and a SD card for logging, so it does not require any additional hardware (like a smartphone).

Starting with version v0.3 the firmware also exposes the measured data via BLE bluetooth. You can use this to feed data to the SimRa App or any other app collecting heart-rate BLE data.

Initial ESP installation

There are various ways to flash the ESP, if you are an expert feel free to choose whatever way you want. The official way to install the firmware is via a browser. To do this open https://install.openbikesensor.org/ with either your Chrome or Edge browser and follow up from there. A more none technical documentation can be found at https://www.openbikesensor.org/docs/firmware/. The old technical documentation with different variants in the former documentation on github.

Updating

For a more none technical description of the process switch to https://www.openbikesensor.org/docs/firmware/.

Updating to 0.14.x

Updating to 0.14.x will require you to download the latest release firmware.bin and flash it using the file upload section in the firmware update screen.

The reason for this is that Github changed their SSL Certificate Root and the old Firmware did not trust the new certicate. Once you are at 0.14.x, updates will work as usual again.

Step By Step with version v0.7.x and above

  1. Check if the Flash App is already installed. Go to Update Flash App if no, or an outdated version is installed, push Update to vX.Y.ZZZ. The latest version of the "Flash App" gets then installed directly from GitHub, and you are redirected to the Update firmware page. You might need to look twice - the Update firmware page looks similar to the Update Flash App page.

  2. On Update Firmware push "Update to vX.Y.ZZZ". The version is downloaded directly to your OBS device from GitHub. After the Download the device reboots and does some housekeeping so be patient within one or two minutes the device boots up with the new version.

Details

The update mechanism consists of 2 parts. A small firmware called Flash App is used to read the new firmware from the SD card and flash it to the obs.

So as a 1st step you need to make sure that the Flash App part is installed on you ESP, you can do so by using "Update Flash App" button and start the update b pressing "Update to vX.Y.ZZZ". The data is directly downloaded from GitHub, so the ESP needs to have access to the internet via your WiFi. You can also download the flash.bin directly from the GitHub releases page. The direct update from GitHub has currently no progress bar so be patient.

Now you need to download the OBS Firmware and place it as /sdflash/app.bin on the SD Card. This is also fully automated behind the "Update Firmware" button, There you can again directly download the latest version and start the internal update process with the "Update to vX.Y.ZZZ" button. Make sure it is a version newer v0.6.x. At the time of writing there is no such version released yet. Do not downgrade to a version prior v0.6.x, once the Flash App was installed. A hint on the "Update Firmware" page will show the version of the Flash App you have installed or if the Flash App is not installed hint you to install the Flash App 1st. With the "File Upload" option you can also update to locally built versions. Make sure they are pos v0.6 versions! The 1st update includes a repartitioning of the ESPs flash where you do not see any indication of progress. Be patient all does not take more than one or two minutes after the upload was completed.

The About page gives you some insight of the current partitioning a more detailed documentation will come.

older versions

Updates from older versions are described in the former documentation on github and on https://www.openbikesensor.org/docs/firmware/. Consider making a backup and start with a fresh installation.

Find the more documentation

You can find the OpenBikeSensor documentation under:

Getting Started Coding

  1. You need a OpenBikeSensor in order to try work on the Firmware. Head over to our Hardware Guide to assemble one.
  2. Clone this repo: git clone https://github.com/openbikesensor/OpenBikeSensorFirmware.git and cd into it.
  3. Choose between developing with recommended VSCode, or CLion (license required), respectively Arduino IDE (discouraged).
  4. Happy Coding! :tada: We are open for your pull request.

License

Copyright (C) 2020-2021 OpenBikeSensor Contributors
Contact: https://openbikesensor.org

This file is part of the OpenBikeSensor firmware.

The OpenBikeSensor firmware is free software: you can
redistribute it and/or modify it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation, either version
3 of the License, or (at your option) any later version.

The OpenBikeSensor Website and Documentation is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with the OpenBikeSensor Website and Documentation. If not, see
<http://www.gnu.org/licenses/>.

Supporters

JetBrains supports the development with one license for their IDEs.