-
Notifications
You must be signed in to change notification settings - Fork 3
Software designs
This page contains the software designs descriptions for the bGeigieCast.
The bGeigieCast is an extension for the bGeigieNano kit. With this module the bGeigieNano can be used as a fixed sensor, as well as the mobile sensor which we are all used to.
The main functions of the bGeigieCast are toggling between mobile and fixed mode, sending average measurements to the API every 5 minutes and configuring the wifi. More about the functional descriptions can be found on the software specification page.
The bGeigieCast is seen as a sub-component of the whole bGeigieNano system. Hardware wise, it will be plugged in the XBee socket on top of the Arduino FIO. This way it will communicate over hardware serial 2 (uart2). It also adds 3 external interfaces, the mode button (hardware), the bluetooth connection (which is the same as the BLEBee module) and a wifi access point for configurations.
The controller is the core of the system. It will get the data from the bGeigieController and pass it on to the bluetooth and API connector.
Interface | Description |
---|---|
espMode | Button to toggle the mode of the bGeigieCast |
Interface (Component) | Reason |
---|---|
dataReports (bGeigieController) | To retrieve measurements from the bGeigieController |
reporterControl (Reporter) | To report readings to bluetooth / API |
serverControl (ConfigServer) | To setup the config server |
The reporter will receive data from the controller to report to the bluetooth and API connector.
Interface | Description |
---|---|
reporterControl | Interface to control the reporter, command it to report readings |
Interface (Component) | Reason |
---|---|
bluetoothControl (Bluetooth) | To send the readings over bluetooth |
APIControler (APIConnector) | To send the readings to the API |
Component that handles the configuration access point. Can start and stop the web server, uses the esp config component to store new settings.
Configurations that can be set:
- Access point name (SSID)
- Access point password
- WiFi name (SSID)
- WiFi password
- API key
- Which API to use (development / production)
Interface | Description |
---|---|
serverControl | Functions to start, stop and manage the web server |
deviceConfig | Web interface to set new configurations |
Interface (Component) | Reason |
---|---|
config (EspConfig) | Set new configurations, use existing configurations for initializing and provide information on the web server |
Configuration component, offers some functions to store / retrieve configurations, or reset.
Interface | Description |
---|---|
config | Functions to initialize, retrieve, store or reset data |
This component does not require any other components.
Component to control the bluetooth connection, send data over bluetooth. Contains all information about the bluetooth service, characteristics and descriptors.
Interface | Description |
---|---|
liveData | Bluetooth endpoint to connect e.g. the safecast drive app |
bluetoothControl | Functions to initialize and publish readings |
This component has no required interfaces
The ApiConnector offers basic functions to manage the connection. It will keep track of readings that were not able to be send to the API (e.g. disconnected, api down).
Interface | Description |
---|---|
APIControl | Functions to start, stop and manage the API connector |
Interface (Component) | Reason |
---|---|
config (EspConfig) | Get the WiFi SSID, WiFi password, API key and server endpoint information |
api (API) | Interface provided by the safecast API, tt.safecast.org |
The system in build with a state machine, where the main controller can be in only one state at the time. There are 3 "main" modes:
- Config server - Does nothing but host a configuration server to connect to and change the wifi / api settings
- Active (Mobile) mode - Used when you take the bgeigie out for a drive / walk
- Active (Fixed) mode - Used when you put the bGeigie on the wall as fixed sensor
There is also the reporter, which will handle the incoming readings, processing them and reporting the reading over bluetooth and to the API.
Overview of all events in the controller state machine and how they are triggered:
Event name | Description | Used in state |
---|---|---|
e_button_pressed | Press the mode button for less than 4 seconds | MobileMode FixedMode PostInitialize ServerActive |
e_button_long_pressed | Press the mode button for more than 4 seconds | Active |
e_controller_initialized | After controller has been initialized | Initialize |
e_post_init_time_passed | 3 seconds passed in the post-init state | PostInitialize |
e_server_initialized | Config server has been initialized | SetupServer |
Overview of all events in the reporter state machine and how they are triggered:
Event name | Description | Used in state |
---|
Overview of all events in the reporter state machine and how they are triggered:
Event name | Description | Used in state |
---|
Some overall view of the data flow.