citysu / csiread

A fast channel state information parser for Intel, Atheros, Nexmon, ESP32 and PicoScenes
MIT License
111 stars 29 forks source link

timestamp for data read with csiread.Picoscenes are all zeros? #39

Open evileleven opened 1 month ago

evileleven commented 1 month ago

for the same data. when use matlab to read it. it works fine. uiopen('C:\Users\evelyn\Downloads\wifi.csi',1) Start parsing PicoScenes CSI file: wifi.csi 141117 PicoScenes frames are decoded in 45.4099 seconds. wifi

But with csiread.Picoscenes, it could not give the timestamp. all 'timestamp' are zeros. `csidata = csiread.Picoscenes(dat_file, {'CSI': [245, 2, 1], 'MPDU': 1522})
csidata.read()
csidata.check()
print(csidata.raw['CSI']['CSI'].shape)

timestamp = csidata.RxSBasic['Timestamp']
rssi_a = csidata.RxSBasic['RSSI1']
rssi_b = csidata.RxSBasic['RSSI2']
csi = csidata.raw['CSI']['CSI']
csi = csi[:, :, :, 0] `

citysu commented 1 month ago

Use the official parser first. csiread.Picoscenes is not recommended because it's too old and lacks maintenance. At the moment it is just a reference for those who want to implement picoscenes parser in python with higher performance than the official implementation.

evileleven commented 1 month ago

Appreciate your immediate help. Sometimes, the file is too big making crush even for Matlab parse. When I install package, it give below error even with a total new python3.8 virtual environment. Do you have any idea for it?

In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:9, from ./picoscenes.cpp:1291: ./rxs_parsing_core/PicoScenesFrameTxParameters.hxx: In member function ‘void PicoScenesFrameTxParameters::applyPreset(const string&)’: ./rxs_parsing_core/PicoScenesFrameTxParameters.hxx:65:49: error: ‘const class std::map<std::__cxx11::basic_string, std::shared_ptr >’ has no member named ‘contains’ if (!FrontEndModePreset::getPresetMap().contains(presetName)) ^~~~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:11, from ./picoscenes.cpp:1291: ./rxs_parsing_core/CSISegment.hxx: At global scope: ./rxs_parsing_core/CSISegment.hxx:299:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/CSISegment.hxx:299:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/CSISegment.hxx:1:1: +#include // ./rxs_parsing_core/CSISegment.hxx:299:36: static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/CSISegment.hxx:299:91: error: template argument 2 is invalid static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/CSISegment.hxx:299:91: error: template argument 4 is invalid ./rxs_parsing_core/CSISegment.hxx:299:92: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/CSISegment.hxx:301:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/CSISegment.hxx:301:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/CSISegment.hxx:301:91: error: template argument 2 is invalid static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/CSISegment.hxx:301:91: error: template argument 4 is invalid ./rxs_parsing_core/CSISegment.hxx:301:92: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:12, from ./picoscenes.cpp:1291: ./rxs_parsing_core/RxSBasicSegment.hxx:69:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/RxSBasicSegment.hxx:69:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/RxSBasicSegment.hxx:1:1: +#include // ./rxs_parsing_core/RxSBasicSegment.hxx:69:36: static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/RxSBasicSegment.hxx:69:79: error: template argument 2 is invalid static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/RxSBasicSegment.hxx:69:79: error: template argument 4 is invalid ./rxs_parsing_core/RxSBasicSegment.hxx:69:80: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/RxSBasicSegment.hxx:71:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/RxSBasicSegment.hxx:71:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/RxSBasicSegment.hxx:71:79: error: template argument 2 is invalid static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/RxSBasicSegment.hxx:71:79: error: template argument 4 is invalid ./rxs_parsing_core/RxSBasicSegment.hxx:71:80: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<RxSBasic(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:13, from ./picoscenes.cpp:1291: ./rxs_parsing_core/ExtraInfoSegment.hxx:29:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<ExtraInfo(const uint8_t *, uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/ExtraInfoSegment.hxx:29:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/ExtraInfoSegment.hxx:11:1: +#include

./rxs_parsing_core/ExtraInfoSegment.hxx:29:36: static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/ExtraInfoSegment.hxx:29:80: error: template argument 2 is invalid static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/ExtraInfoSegment.hxx:29:80: error: template argument 4 is invalid ./rxs_parsing_core/ExtraInfoSegment.hxx:29:81: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/ExtraInfoSegment.hxx:31:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/ExtraInfoSegment.hxx:31:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/ExtraInfoSegment.hxx:31:80: error: template argument 2 is invalid static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/ExtraInfoSegment.hxx:31:80: error: template argument 4 is invalid ./rxs_parsing_core/ExtraInfoSegment.hxx:31:81: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<ExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:14, from ./picoscenes.cpp:1291: ./rxs_parsing_core/MVMExtraSegment.hxx:63:49: error: ‘function’ in namespace ‘std’ does not name a template type static void setHeaderManipulator(const std::function<void(IntelMVMParsedCSIHeader &)> &headerManipulator); ^~~~ ./rxs_parsing_core/MVMExtraSegment.hxx:63:44: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/MVMExtraSegment.hxx:11:1: +#include

./rxs_parsing_core/MVMExtraSegment.hxx:63:44: static void setHeaderManipulator(const std::function<void(IntelMVMParsedCSIHeader &)> &headerManipulator); ^~~ ./rxs_parsing_core/MVMExtraSegment.hxx:63:57: error: expected ‘,’ or ‘...’ before ‘<’ token static void setHeaderManipulator(const std::function<void(IntelMVMParsedCSIHeader &)> &headerManipulator); ^ ./rxs_parsing_core/MVMExtraSegment.hxx:72:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/MVMExtraSegment.hxx:72:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/MVMExtraSegment.hxx:72:88: error: template argument 2 is invalid static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/MVMExtraSegment.hxx:72:88: error: template argument 4 is invalid ./rxs_parsing_core/MVMExtraSegment.hxx:72:89: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/MVMExtraSegment.hxx:74:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/MVMExtraSegment.hxx:74:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/MVMExtraSegment.hxx:74:88: error: template argument 2 is invalid static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/MVMExtraSegment.hxx:74:88: error: template argument 4 is invalid ./rxs_parsing_core/MVMExtraSegment.hxx:74:89: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<IntelMVMExtraInfo(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ ./rxs_parsing_core/MVMExtraSegment.hxx:76:17: error: ‘function’ in namespace ‘std’ does not name a template type static std::function<void(IntelMVMParsedCSIHeader &)> headerManipulator; ^~~~ ./rxs_parsing_core/MVMExtraSegment.hxx:76:12: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? static std::function<void(IntelMVMParsedCSIHeader &)> headerManipulator; ^~~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:15, from ./picoscenes.cpp:1291: ./rxs_parsing_core/SDRExtraSegment.hxx:52:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<SDRExtra(const uint8_t *, uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/SDRExtraSegment.hxx:52:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/SDRExtraSegment.hxx:9:1: +#include

include "AbstractPicoScenesFrameSegment.hxx"

./rxs_parsing_core/SDRExtraSegment.hxx:52:36: static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/SDRExtraSegment.hxx:52:79: error: template argument 2 is invalid static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/SDRExtraSegment.hxx:52:79: error: template argument 4 is invalid ./rxs_parsing_core/SDRExtraSegment.hxx:52:80: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/SDRExtraSegment.hxx:54:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/SDRExtraSegment.hxx:54:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/SDRExtraSegment.hxx:54:79: error: template argument 2 is invalid static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/SDRExtraSegment.hxx:54:79: error: template argument 4 is invalid ./rxs_parsing_core/SDRExtraSegment.hxx:54:80: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<SDRExtra(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:17, from ./picoscenes.cpp:1291: ./rxs_parsing_core/PayloadSegment.hxx:57:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/PayloadSegment.hxx:57:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/PayloadSegment.hxx:1:1: +#include // ./rxs_parsing_core/PayloadSegment.hxx:57:36: static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/PayloadSegment.hxx:57:82: error: template argument 2 is invalid static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/PayloadSegment.hxx:57:82: error: template argument 4 is invalid ./rxs_parsing_core/PayloadSegment.hxx:57:83: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/PayloadSegment.hxx:59:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/PayloadSegment.hxx:59:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/PayloadSegment.hxx:59:82: error: template argument 2 is invalid static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/PayloadSegment.hxx:59:82: error: template argument 4 is invalid ./rxs_parsing_core/PayloadSegment.hxx:59:83: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<PayloadData(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:18, from ./picoscenes.cpp:1291: ./rxs_parsing_core/CargoSegment.hxx:17:46: error: ‘function’ in namespace ‘std’ does not name a template type static void registerAlgorithm(const std::function<std::optional<std::vector>(const uint8_t , size_t)> &compressorV, ^~~~ ./rxs_parsing_core/CargoSegment.hxx:17:41: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/CargoSegment.hxx:1:1: +#include // ./rxs_parsing_core/CargoSegment.hxx:17:41: static void registerAlgorithm(const std::function<std::optional<std::vector>(const uint8_t , size_t)> &compressorV, ^~~ ./rxs_parsing_core/CargoSegment.hxx:17:54: error: expected ‘,’ or ‘...’ before ‘<’ token static void registerAlgorithm(const std::function<std::optional<std::vector>(const uint8_t , size_t)> &compressorV, ^ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:18, from ./picoscenes.cpp:1291: ./rxs_parsing_core/CargoSegment.hxx:26:23: error: ‘function’ in namespace ‘std’ does not name a template type static const std::function<std::optional<std::vector>(const uint8_t , size_t)> &getCompressor() { ^~~~ ./rxs_parsing_core/CargoSegment.hxx:26:18: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? static const std::function<std::optional<std::vector>(const uint8_t , size_t)> &getCompressor() { ^~~ ./rxs_parsing_core/CargoSegment.hxx:30:23: error: ‘function’ in namespace ‘std’ does not name a template type static const std::function<std::optional<std::vector>(const uint8_t , size_t)> &getDecompressor() { ^~~~ ./rxs_parsing_core/CargoSegment.hxx:30:18: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? static const std::function<std::optional<std::vector>(const uint8_t , size_t)> &getDecompressor() { ^~~ ./rxs_parsing_core/CargoSegment.hxx:35:17: error: ‘function’ in namespace ‘std’ does not name a template type static std::function<std::optional<std::vector>(const uint8_t , size_t)> compressor; ^~~~ ./rxs_parsing_core/CargoSegment.hxx:35:12: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? static std::function<std::optional<std::vector>(const uint8_t , size_t)> compressor; ^~~ ./rxs_parsing_core/CargoSegment.hxx:36:17: error: ‘function’ in namespace ‘std’ does not name a template type static std::function<std::optional<std::vector>(const uint8_t , size_t)> decompressor; ^~~~ ./rxs_parsing_core/CargoSegment.hxx:36:12: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? static std::function<std::optional<std::vector>(const uint8_t , size_t)> decompressor; ^~~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:18, from ./picoscenes.cpp:1291: ./rxs_parsing_core/CargoSegment.hxx: In static member function ‘static bool CargoCompression::isAlgorithmRegistered()’: ./rxs_parsing_core/CargoSegment.hxx:14:16: error: ‘compressor’ was not declared in this scope return compressor && decompressor; ^~~~~~ ./rxs_parsing_core/CargoSegment.hxx:14:30: error: ‘decompressor’ was not declared in this scope return compressor && decompressor; ^~~~ In file included from ./rxs_parsing_core/ModularPicoScenesFrame.hxx:18, from ./picoscenes.cpp:1291: ./rxs_parsing_core/CargoSegment.hxx: In lambda function: ./rxs_parsing_core/CargoSegment.hxx:21:13: error: ‘compressor’ was not declared in this scope compressor = compressorV; ^~~~~~ ./rxs_parsing_core/CargoSegment.hxx:21:26: error: ‘compressorV’ was not declared in this scope compressor = compressorV; ^~~ ./rxs_parsing_core/CargoSegment.hxx:22:13: error: ‘decompressor’ was not declared in this scope decompressor = decompressorV; ^~~~ ./rxs_parsing_core/CargoSegment.hxx:22:28: error: ‘decompressorV’ was not declared in this scope decompressor = decompressorV; ^~~~~ ./rxs_parsing_core/CargoSegment.hxx: At global scope: ./rxs_parsing_core/CargoSegment.hxx:75:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^~~~ ./rxs_parsing_core/CargoSegment.hxx:75:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/CargoSegment.hxx:75:100: error: template argument 2 is invalid static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^ ./rxs_parsing_core/CargoSegment.hxx:75:100: error: template argument 4 is invalid ./rxs_parsing_core/CargoSegment.hxx:75:101: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> versionedSolutionMap; ^~ ./rxs_parsing_core/CargoSegment.hxx:77:36: error: ‘function’ is not a member of ‘std’ static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~~~ ./rxs_parsing_core/CargoSegment.hxx:77:36: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’? ./rxs_parsing_core/CargoSegment.hxx:77:100: error: template argument 2 is invalid static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^ ./rxs_parsing_core/CargoSegment.hxx:77:100: error: template argument 4 is invalid ./rxs_parsing_core/CargoSegment.hxx:77:101: error: expected unqualified-id before ‘>’ token static std::map<uint16_t, std::function<std::shared_ptr(const uint8_t , uint32_t)>> initializeSolutionMap() noexcept; ^~ ./picoscenes.cpp:8776:18: warning: ‘PyObject __pyx_f_10picoscenes_parse_SignalMatrix(const SignalMatrix<std::complex >)’ defined but not used [-Wunused-function] static PyObject __pyx_f_10picoscenes_parse_SignalMatrix(SignalMatrix<std::complex > const __pyx_v_m) { ^~~~~~~~~~~ error: command '/usr/bin/g++' failed with exit code 1