Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
17 changes: 8 additions & 9 deletions n4-flight-software/include/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/* debug parameters for use during testing - set to 0 for production */
#define DEBUGGING 1 /*!< allow debugging to terminal. Set to 0 pre flight to disable serial terminal printing and improve speed */
#define LOG_TO_MEMORY 0 /*!< allow data logging to memory. Set to 1 to log data to external flash memory. Must be set during flight */
#define DEBUG_TO_TERMINAL 1 /*!< allow create task that prints data to terminal. Set o 0 before flight */
#define DEBUG_TO_TERMINAL 1 /*!< allow create task that prints data to terminal. Set to 0 before flight */

#if DEBUGGING
#define debug(x) Serial.print(x)
Expand Down Expand Up @@ -49,22 +49,21 @@
#define ALTIMETER_QUEUE_LENGTH 10 /*!< length of the altimeter queue */
#define GYROSCOPE_QUEUE_LENGTH 10 /*!< length of the gyroscope queue */
#define GPS_QUEUE_LENGTH 24 /*!< length of the gps queue */
#define TELEMETRY_DATA_QUEUE_LENGTH 10 /*!< length of the telemetry data queue */
#define TELEMETRY_DATA_QUEUE_LENGTH 22 /*!< length of the telemetry data queue */
#define FILTERED_DATA_QUEUE_LENGTH 10 /*!< length of the filtered data queue */
#define FLIGHT_STATES_QUEUE_LENGTH 1 /*!< length of the flight states queue */

/* MQTT constants */
//const char MQTT_SERVER[30] = "192.168.1.101";
const char MQTT_SERVER[30] = "broker.emqx.io";
const char MQTT_TOPIC[30] = "n4/flight-computer-1"; /* make this topic unique to every rocket */
#define MQTT_PORT 1883 /*!< MQTT broker port */
const char MQTT_SERVER[20] = "10.16.1.118"; /*!< MQTT broker IP address */
const char MQTT_TOPIC[20] = "n4/telemetry";
#define MQTT_PORT 1882 /*!< MQTT broker port */

#define BROKER_IP_ADDRESS_LENGTH 20 /*!< length of broker ip address string */
#define BROKER_IP_ADDRESS_LENGTH 50 /*!< length of broker ip address string */
#define MQTT_TOPIC_LENGTH 10 /*!< length of mqtt topic string */

/* WIFI credentials */
// const char* SSID = "Galaxy"; /*!< WIFi SSID */
// const char* PASSWORD = "luwa2131"; /*!< WiFi password */
// const char* SSID = "Nakuja"; /*!< WIFi SSID */
// const char* PASSWORD = "987654321"; /*!< WiFi password */

#define CALLIBRATION_READINGS 200 /*!< number of readings to take while calibrating the sensor */

Expand Down
4 changes: 2 additions & 2 deletions n4-flight-software/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32doit-devkit-v1]
[env:nodemcu-32s]
platform = espressif32
board = esp32doit-devkit-v1
board = nodemcu-32s
framework = arduino
monitor_speed = 115200
lib_deps =
Expand Down
14 changes: 12 additions & 2 deletions n4-flight-software/src/data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,27 @@ typedef struct Altimeter_Data{
double AGL; /*!< altitude above ground level */
} altimeter_type_t;

/**
* A structure to represent the chute pyro state
*/
typedef struct ChutePyro_State{
uint8_t pyro1_state; /*!< main chute pyro state */
uint8_t pyro2_state; /*!< drogue chute pyro state */
} chutepyro_type_t;

/**
* A structure to represent telemetry data. This is the data transmitted to ground
*/
typedef struct Telemetry_Data {
uint32_t record_number; /*!< current row number for flight data logging */
uint8_t operation_mode; /*!< operation mode to tell whether we are in SAFE or FLIGHT mode */
uint8_t state; /*!< current flight state. See states.h */
altimeter_type_t alt_data; /*!< altimeter data */
uint8_t operation_mode; /*!< operation mode to tell whether we are in SAFE or FLIGHT mode */
accel_type_t acc_data; /*!< accelerometer data */
gyro_type_t gyro_data; /*!< gyroscope data */
gps_type_t gps_data; /*!< gps data */
altimeter_type_t alt_data; /*!< altimeter data */
chutepyro_type_t chute_state; /*!< state of the main and drogue chute pyro (whether ejected or active) */
uint32_t battery_voltage; /*!< altimeter data */
} telemetry_type_t;

#endif
Loading