Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump deps, misc cleanup of old IPC abstraction code of client #43

Merged
merged 2 commits into from
Jun 20, 2024
Merged
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
144 changes: 118 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
socketcan = "1.7.0"
paho-mqtt = "0.12.3"
socketcan = "3.3.0"
paho-mqtt = "0.12.5"
protobuf-codegen = "3.3.0"
protobuf = "3.3.0"
bitstream-io = "2.3.0"
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# Calypso
Custom CAN Decoder for all the data being streamed around the car
Custom CAN decoder to translate CAN messages to MQTT protobuf encoded packets with low latency and a YAML configuration structure.

### Recommended Extensions
View https://www.youtube.com/watch?v=BU1LYFkpJuk for more information

- rust-analyzer
- CodeLLDB
- Even Better TOML
- Error Lens
- Todo Tree
- crates

### Develop setup
#### Go to Settings in VSCode
search Rust-analyzer check and set the command from check -> clippy

Expand All @@ -23,19 +15,29 @@ add following information:
}
```

### NERO 1.0 Config
Utilizes a linux IPC to stream data to the NERO frontend
To test it on linux, please install:
- mosquitto broker: https://mosquitto.org
- can-utils
- mqttui: https://github.com/EdJoPaTo/mqttui


### Developing

Process for testing:
- run `mosquitto` and leave it open
- run `mqttui` and leave it open
- setup the can network:
- `sudo ip link add dev vcan0 type vcan`
- `sudo ip link set dev vcan0 up`

run ```/home/ner/Desktop/Calypso/target/release/calypso ipc /tmp/ipc.sock```
run ```cargo run localhost:1883 vcan0```

### SIREN and NERO 2.0 Config
Utilizes MQTT Web Socket to offload data from the car for our telemetry system
run ```/home/ner/Desktop/Calypso/target/release/calypso mqtt localhost:1883```
To send a can message:
- `cansend vcan0 <ID_IN_HEX>#<PAYLOAD_IN_HEX>`
Ex. `cansend vcan0 702#01010101FFFFFFFF`
Now view calypso interpret the can message and broadcast it on `mqttui`

### Synthesize Rust
`cd oxy`

`python3 typedpoc.py`

### Generate Proto

Expand Down
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ fn main() {
match Command::new("python3").arg("./calypsogen.py").status() {
Ok(status) if status.success() => {
println!("Python script executed successfully");
},
}
Ok(status) => {
eprintln!("Python script exited with status: {}", status);
std::process::exit(1);
},
}
Err(e) => {
eprintln!("Failed to execute Python script: {}", e);
std::process::exit(1);
},
}
}
}
}
16 changes: 0 additions & 16 deletions src/client.rs

This file was deleted.

6 changes: 1 addition & 5 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,4 @@ impl Data {
unit: unit.to_string(),
}
}

pub fn to_json(&self) -> String {
format!("{{\"value\": {:#?}, \"unit\": \"{}\"}}", self.value, self.unit)
}
}
}
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod client;
pub mod data;
pub mod decode_data;
pub mod master_mapping;
pub mod message;
pub mod mqtt;
pub mod master_mapping;
pub mod serverdata;
pub mod serverdata;
Loading
Loading