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

womp womp #17

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ __pycache__/
result
result/
.env
hytech.proto
dbc_to.proto
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
usage:
# Base person usage:
1. Download foxglove studio at https://github.com/foxglove/studio/releases
2. Connect to the Pi's network
3. Open foxglove studio
4. Open a connection to the Pi's IP on port 8765
5. Look at data

# dev usage:

to get into a dev environment locally (on linux):
1. install nix:
Expand Down Expand Up @@ -117,4 +124,4 @@ flowchart TD


kvaser u100 pinout:
![Alt text](image.png)
![Alt text](image.png)
8 changes: 4 additions & 4 deletions dbc_proto_bin_gen.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{pkgs, py_dbc_proto_gen_pkg, ht_can_pkg, protobuf}:
{pkgs, py_dbc_proto_gen_pkg, can_pkg, protobuf}:

pkgs.stdenv.mkDerivation rec {
name = "ht-proto-gen";

src = builtins.filterSource (path: type: false) ./.;

buildInputs = [ py_dbc_proto_gen_pkg ht_can_pkg protobuf ]; # Python as a build dependency
buildInputs = [ py_dbc_proto_gen_pkg can_pkg protobuf ]; # Python as a build dependency

# Define the build phase to execute the scripts
buildPhase = ''
# Run the Python script
dbc_to_proto.py ${ht_can_pkg}
dbc_to_proto.py ${can_pkg}
protoc --include_imports --descriptor_set_out=hytech.bin hytech.proto
'';

Expand All @@ -22,4 +22,4 @@ pkgs.stdenv.mkDerivation rec {
cp hytech.proto $out/proto
cp hytech.bin $out/bin
'';
}
}
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python311Packages.buildPythonApplication {
python311Packages.websockets
python311Packages.pprintpp
python311Packages.can
python311Packages.pyserial-asyncio
asyncudp_pkg
python311Packages.lz4
python311Packages.zstandard
Expand Down
13 changes: 13 additions & 0 deletions downv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Check if vcan0 is already down
if ! ip link show up | grep -q vcan0; then
echo "vcan0 is already down."
else
echo "Bringing down vcan0..."

# Bring down can0 interface
sudo ip link set down vcan0

echo "vcan0 has been brought down."
fi
76 changes: 38 additions & 38 deletions flake.lock

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

16 changes: 8 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
mcap.url = "github:RCMast3r/py_mcap_nix";
foxglove-websocket.url = "github:RCMast3r/py_foxglove_webserver_nix";
asyncudp.url = "github:RCMast3r/asyncudp_nix";
ht_can_pkg_flake.url = "github:hytech-racing/ht_can";
nix-proto = { url = "github:notalltim/nix-proto"; };
can_pkg_flake.url = "github:KSU-MS/Nix_CAN";
nix-proto.url = "github:notalltim/nix-proto";
};

outputs = { self, nixpkgs, utils, mcap-protobuf, mcap, foxglove-websocket
, asyncudp, nix-proto, ht_can_pkg_flake, ... }@inputs:
, asyncudp, nix-proto, can_pkg_flake, ... }@inputs:
let
makePackageSet = pkgs: {
py_data_acq_pkg = pkgs.py_data_acq_pkg;
Expand Down Expand Up @@ -48,7 +48,7 @@
py_dbc_proto_gen_overlay
py_data_acq_overlay
proto_gen_overlay
ht_can_pkg_flake.overlays.default
can_pkg_flake.overlays.default
mcap-protobuf.overlays.default
mcap.overlays.default
asyncudp.overlays.default
Expand Down Expand Up @@ -90,7 +90,7 @@
py_data_acq_pkg
py_dbc_proto_gen_pkg
proto_gen_pkg
ht_can_pkg
can_pkg
cmake
can-utils
];
Expand All @@ -100,7 +100,7 @@
in ''
path=${x86_pkgs.proto_gen_pkg}
bin_path=$path"/bin"
dbc_path=${x86_pkgs.ht_can_pkg}
dbc_path=${x86_pkgs.can_pkg}
export BIN_PATH=$bin_path
export DBC_PATH=$dbc_path

Expand All @@ -115,14 +115,14 @@
# Development Tools
py_dbc_proto_gen_pkg
proto_gen_pkg
ht_can_pkg
can_pkg
protobuf
];
shellHook =
''
path=${x86_pkgs.proto_gen_pkg}
bin_path=$path"/bin"
dbc_path=${x86_pkgs.ht_can_pkg}
dbc_path=${x86_pkgs.can_pkg}
export BIN_PATH=$bin_path
export DBC_PATH=$dbc_path
'';
Expand Down
42 changes: 0 additions & 42 deletions py_data_acq/broadcast-test.py

This file was deleted.

Loading