Closed yalatoom closed 7 months ago
Line 15 should say:
detector_config = DetectorConfig(
and not
detector_config = a121.DetectorConfig(
Line 15 should say:
detector_config = DetectorConfig(
and notdetector_config = a121.DetectorConfig(
Thank you. It solved that error but received another error:
Traceback (most recent call last):
File "/home/pi/Desktop/A121.py", line 46, in <module>
main()
File "/home/pi/Desktop/A121.py", line 24, in main
detector.calibrate_detector()
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/a121/algo/distance/_detector.py", line 538, in calibrate_detector
self._calibrate_offset()
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/a121/algo/distance/_detector.py", line 768, in _calibrate_offset
self.client.stop_session()
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/a121/_core/communication/exploration_client.py", line 292, in stop_session
timeout_s=self._link.timeout + 1,
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/_core/communication/message_stream.py", line 64, in wait_for_message
for message in self._stream:
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/_core/communication/message_stream.py", line 85, in _get_stream
self._error_callback(e)
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/a121/_core/communication/exploration_client.py", line 131, in _close_before_reraise
raise exception
File "/home/pi/.local/lib/python3.7/site-packages/acconeer/exptool/_core/communication/message_stream.py", line 82, in _get_stream
self._link.recv_until(self.protocol.end_sequence)
File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 15 (char 14)
Try lowering the baudrate to get a more stable connection:
# Open the connection to the sensor
client = a121.Client.open(serial_port=serial_port, override_baudrate=115200)
Try lowering the baudrate to get a more stable connection:
# Open the connection to the sensor client = a121.Client.open(serial_port=serial_port, override_baudrate=115200)
Thank you. That solve my issue and it works now.
I tried to use this code based on your example to calculate distance:
but get this error:
AttributeError: module 'acconeer.exptool.a121' has no attribute 'DetectorConfig'
I am using Raspberry Pi and connected "SparkFun Qwiic Pulsed Coherent Radar Sensor - Acconeer XM125" with USB port to my Raspberry Pi.