Skip to content

Commit

Permalink
Merge branch 'main' of github.com:misko/spf
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Dec 10, 2023
2 parents 7503d7d + 8647db5 commit fce8cc1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
20 changes: 9 additions & 11 deletions spf/grbl/grbl_settings
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

$0=5
$1=25
$2=15
$3=0
$3=3
$4=0
$5=0
$6=0
Expand Down Expand Up @@ -30,18 +29,17 @@ $38=10
$39=0
$100=2148.000
$101=2148.000
$102=800.000
$103=800.000
$102=2148.000
$103=2148.000
$110=1000.000
$111=1000.000
$112=200.000
$113=200.000
$112=1000.000
$113=1000.000
$120=100.000
$121=100.000
$122=20.000
$123=20.000
$122=100.000
$123=100.000
$130=1500.000
$131=1500.000
$132=300.000
$133=280.000
ok
$132=1500.000
$133=1500.000
23 changes: 16 additions & 7 deletions spf/grbl_sdr_collect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from sdrpluto.gather import *
from grbl.grbl_interactive import GRBLManager
from model_training_and_inference.utils.rf import beamformer
from spf.rf import beamformer
import threading
import time
import numpy as np
Expand Down Expand Up @@ -106,12 +106,21 @@ def bounce_grbl(gm):
time.sleep(1)

# get some data
try:
signal_matrix = sdr_rx.rx()
except Exception as e:
print("Failed to receive RX data! removing file", e)
os.remove(args.out)
break
read_ok=False
tries=0
while not read_ok:
try:
signal_matrix = sdr_rx.rx()
read_ok=True
except Exception as e:
print("Failed to receive RX data! removing file : retry %" % tries, e)
time.sleep(0.1)
tries+=1
if tries>10:
breakpoint()
print("GIVE UP")
os.remove(args.out)
break
signal_matrix[1] *= np.exp(1j * sdr_rx.phase_calibration)
current_time = time.time() - time_offset # timestamp

Expand Down
2 changes: 1 addition & 1 deletion spf/sdrpluto/gather.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import adi
import numpy as np
from spf.software.model_training_and_inference.utils.rf import beamformer
from spf.rf import beamformer
from math import gcd
import matplotlib.pyplot as plt
import time
Expand Down

0 comments on commit fce8cc1

Please sign in to comment.