OpenSensorHub (OSH) software allows one to easily build interoperable and evolutive sensor networks with advanced processing capabilities and based on open standards for all data exchanges. These open-standards are mostly OGC standards from the Sensor Web Enablement (SWE) initiative and are key to design sensor networks that can largely evolve with time (addition of new types of sensors, reconfigurations, etc.).
The framework allows one to connect any kind of sensor and actuator to a common bus via a simple yet generic driver API. Sensors can be connected through any available hardware interface such as RS232/422, SPI, I2C, USB, Ethernet, Wifi, Bluetooth, ZigBee, HTTP, etc... Once drivers are available for a specific sensor, it is automatically connected to the bus, and it is then trivial to send commands and read data from it. An intuitive user interface allows the user to configure the network to suit its needs, and more advanced processing capabilities are available via a plugin system.
OSH embeds the full power of OGC web services (Sensor Observation Service or SOS, Sensor Planning Service or SPS) to communicate with all connected sensors in the network as well as to provide robust metadata (owner, location and orientation, calibration, etc.) about them. Through these standards, several SensorHub instances can also communicate with each other to form larger networks.
Low level functions of SensorHub (send commands and read data from sensor) are coded efficiently and can be used on embedded hardware running Java SE®, Java ME® or Android® while more advanced data processing capabilities are fully multi-threaded and can thus benefit from a more powerful hardware platform (e.g. multi-processor servers or even clusters).
OpenSensorHub is licensed under the Mozilla Public License version 2.0.
Refer to the Documentation Site for instructions on how to install and use OSH, as well as get the latest news.
You can also go to this Demo Page to see OSH in action with a few example sensor streams (Video, GPS, orientation, weather, etc.) visualized within simple javascript clients.
This other Technical Page contains example SWE service calls for you to see the standard compliant XML and data that OSH generates.
OpenSensorHub can be built using Gradle, either from the command line or within Eclipse. Please see the Developer's Guide for detailed instructions.
Refer to the Developer's Guide for instructions on how to setup your development environment.
The Developer's guide includes information on how to build with Eclipse or Gradle.
You can also find useful information in the Javadocs and Design Documentation on the Wiki.
Several sensor driver examples are also available in the source code to help you get started.
Join our Discord to offer feedback!
This application supports multiple languages using Java's built-in ResourceBundle mechanism. The user interface text is dynamically updated based on the user's selected language preference.
- User interface strings are stored in properties files located in
sensorhub-webui-core/src/main/resources/org/sensorhub/ui/. - The default language file is
messages.properties(English). - Each supported language has its own properties file named
messages_xx.properties, wherexxis the two-letter ISO 639-1 language code (e.g.,messages_es.propertiesfor Spanish). - When the application starts, it loads the appropriate resource bundle based on the user's saved language preference or the default system locale.
- UI components then fetch strings from this bundle using keys (e.g.,
resourceBundle.getString("adminUI.title")). - A language selector is available in the application header, allowing users to switch languages dynamically. The selected preference is saved for future sessions.
To add support for a new language, follow these steps:
- Identify the ISO 639-1 Code: Determine the two-letter code for the language you want to add (e.g.,
ptfor Portuguese,itfor Italian). - Create a New Properties File:
- Navigate to the
sensorhub-webui-core/src/main/resources/org/sensorhub/ui/directory. - Make a copy of the
messages.propertiesfile. - Rename the copied file to
messages_xx.properties, replacingxxwith the new language code (e.g.,messages_pt.properties).
- Navigate to the
- Translate the Strings:
- Open the newly created
messages_xx.propertiesfile. - Translate all the string values (the text after the
=sign) into the new language. Keep the keys (the text before the=sign) exactly the same as inmessages.properties. - Example for
messages_pt.properties:adminUI.title=OpenSensorHub [pt] # Replace with actual Portuguese translation adminUI.sensorsTab=Sensores [pt] # Replace with actual Portuguese translation # ... and so on for all other keys
- Open the newly created
- Update Supported Locales (Code Change):
- Open the
AdminUI.javafile located insensorhub-webui-core/src/main/java/org/sensorhub/ui/. - Locate the
buildHeader()method. - Add the new
Localeand its display name to thesupportedLocalesmap. For example, for Portuguese:supportedLocales.put(new Locale("pt"), "Português");
- Locate the
isSupportedLocale(Locale locale)method inAdminUI.java. - Add the new language code to the checks. For example, for Portuguese:
return locale.getLanguage().equals(Locale.ENGLISH.getLanguage()) || locale.getLanguage().equals("es") || locale.getLanguage().equals(Locale.FRENCH.getLanguage()) || locale.getLanguage().equals(Locale.GERMAN.getLanguage()) || locale.getLanguage().equals("pt"); // Add new language here
- (Optional but recommended for robustness) If
AppSessionInitListener.javais actively used and registered, update itsisSupportedmethod similarly and potentially the logic for adding the new locale toevent.getSession().setLocale(loadedLocale);checks if you want fine-grained control over supported language tags there.
- Open the
- Test: Rebuild and run the application. Select the new language from the language selector and verify that all UI text is correctly translated.
By following these steps, you can extend the application's internationalization capabilities.
