Hello!
I have been getting this intermittent error when using the QA401H on both linux (raspberry pi) and macOS. I think I finally found a good repro today.
this is the output of QA401H:
---
Time 09:19:09.334
POST Request:http://localhost:9401/Acquisition
Acquisition started. Fs: 48000 FFTSize: 32768 Resolution: 1.465Hz Window: Hann Rounding: True Atten Enabled: False
Exception occurred in DoAcquisition(): Object reference not set to an instance of an object.
Return: { "SessionId":"0" }
Status: 200 (Elapsed: 11.22 mS)
---
Time 09:19:09.351
GET Request:http://localhost:9401/RmsDbv/20/20000
Bad Request: Exception: (Object reference not set to an instance of an object.)
Status: 400 (Elapsed: 4.63 mS)
note that the exception seems to occur already in the acquisition step, but the acquisition returns OK.
repro:
- plug in QA401
- start the QA401H process
- QA401H configures the QA401 FPGA
PUT Request:http://localhost:9401/Settings/Default
GET Request:http://localhost:9401/Status/Version
PUT Request:http://localhost:9401/Settings/Input/Max/6
POST Request:http://localhost:9401/Acquisition
- QA401H logs error message (see above) but returns success
GET Request:http://localhost:9401/RmsDbv/20/20000
- QA401H returns 400, see above
- restart QA401H process
- QA401H does not reconfigure FPGA
- run same commands again
- everything runs as expected
Here is the full output of the steps outlined above:
publish | dotnet QA401H.dll
Server started listening on port 9401
Version: 1.0
Loading FX2 with file 16C04E27.hex [b58731ad] (Match)
Usb re-opened
Loading FPGA File: qa401.bit [eeba84b2] (Match)
FPGA File DateTime: 04/04/2019 11:32
…
Done loading FPGA
===USB DESCRIPTORS===
Endpoint: 0x1 Max Packet Size: 64 bytes
Endpoint: 0x81 Max Packet Size: 64 bytes
Endpoint: 0x2 Max Packet Size: 512 bytes
Endpoint: 0x4 Max Packet Size: 512 bytes
Endpoint: 0x86 Max Packet Size: 512 bytes
Endpoint: 0x88 Max Packet Size: 512 bytes
Waiting for HTTP…
From your web browser, go to http://localhost:9401
Press ‘X’ to exit
Time 09:31:23.47
PUT Request:http://localhost:9401/Settings/Default
Return: { “SessionId”:“0” }
Status: 200 (Elapsed: 6.85 mS)
Time 09:31:23.60
GET Request:http://localhost:9401/Status/Version
Return: { “SessionId”:“0”, “Value”:“1” }
Status: 200 (Elapsed: 1.45 mS)
Time 09:31:28.966
PUT Request:http://localhost:9401/Settings/Input/Max/6
Return: { “SessionId”:“0” }
Status: 200 (Elapsed: 6.27 mS)
Time 09:31:28.980
POST Request:http://localhost:9401/Acquisition
Acquisition started. Fs: 48000 FFTSize: 32768 Resolution: 1.465Hz Window: Hann Rounding: True Atten Enabled: False
Exception occurred in DoAcquisition(): Object reference not set to an instance of an object.
Return: { “SessionId”:“0” }
Status: 200 (Elapsed: 11.67 mS)
Time 09:31:28.998
GET Request:http://localhost:9401/RmsDbv/20/20000
Bad Request: Exception: (Object reference not set to an instance of an object.)
Status: 400 (Elapsed: 7.17 mS)
publish | dotnet QA401H.dll # NOTE: process manually restarted here!
Server started listening on port 9401
Version: 1.0
Usb is already configured
Waiting for HTTP…
From your web browser, go to http://localhost:9401
Press ‘X’ to exit
Time 09:36:31.743
PUT Request:http://localhost:9401/Settings/Default
Return: { “SessionId”:“0” }
Status: 200 (Elapsed: 7.00 mS)
Time 09:36:31.758
GET Request:http://localhost:9401/Status/Version
Return: { “SessionId”:“0”, “Value”:“1” }
Status: 200 (Elapsed: 1.29 mS)
Time 09:36:38.85
PUT Request:http://localhost:9401/Settings/Input/Max/6
Return: { “SessionId”:“0” }
Status: 200 (Elapsed: 7.72 mS)
Time 09:36:38.100
POST Request:http://localhost:9401/Acquisition
Acquisition started. Fs: 48000 FFTSize: 32768 Resolution: 1.465Hz Window: Hann Rounding: True Atten Enabled: False
Acquisition completed. Elapsed 0.78 seconds.
Return: { “SessionId”:“3200886713” }
Status: 200 (Elapsed: 784.94 mS)
Time 09:36:38.892
GET Request:http://localhost:9401/RmsDbv/20/20000
Return: { “SessionId”:“3200886713”, “Left”:“4.580997138893466”, “Right”:“4.6104584993685” }
Status: 200 (Elapsed: 2.43 mS)
Setup info:
- QA401 version: 1.0 but the bug has been present in previous versions as well.
- macOS version: Big Sur (11.6) but has been seen on another mac version as well.
- Linux version: Raspberry Pi OS which is based on Debian
Since it’s been seen on multiple OSes and versions, I would guess it is not related to the OS version but unix in general.
Hope this helps!
Philip