Repository navigation
What is the intended workflow for validating a reading with the Bit Pirate? #198
Replies: 2 comments
|
Not a maintainer, so I can't speak to plans or the intended use cases. I can answer the decoder and WebSocket questions from the current code ( Attaching a decoder. I didn't find a hook for per-sensor decoders in the firmware. The supported route looks like off-device Python: the README and the Python wiki page point to the from bitpirate import BitPirate
bp = BitPirate.auto_connect()
bp.start()
bp.change_mode("uart")
bp.send("raw")That script sends Web CLI and high-rate streams. I don't see anything designed for sustained streams, and
So your guess is plausible but not proven. Nothing I read explains the board dropping off the LAN, which is a bigger failure than a closed socket, so a serial log from the moment it happens would be the most useful thing to attach. Two things to check in your script:
For validating a sensor, I'd use USB serial with |
|
Depends what "validate" means for your case, but the order I would use with a bus tool:
The one thing I would not use it for is calibration: a bus tool validates the transport and the register contents, not the sensor's absolute accuracy. |
Uh oh!
There was an error while loading. Please reload this page.
I have been trying the Bit Pirate (v1.8, ESP32-S3 DevKitC-1 on a Dock) as a bench tool and I would like to understand where it is meant to fit, because I am not sure I am using it the right way.
A concrete example: a TFmini LiDAR on UART (115200, RX 17 / TX 18). The
rawcommand shows a continuous stream of hex bytes. To know whether a reading was correct I had to decode the frames by hand (header 59 59, distance bytes, strength, checksum) and verify the checksum myself. The device shows me that bytes arrive, but nothing tells me whether the values are right, whether a frame is corrupted, or whether I am looking at a real reading or a wrong one.So I tried to do the decoding off-device. Since the web CLI talks over a WebSocket (/ws, text frames, commands ending with \n), I wrote a small Python script that connects to ws:///ws, sends
raw, parses the hex dump, rebuilds the 9-byte TFmini frames and checks the checksum. The first run worked: it printed two valid readings (227 cm / strength 82, then 228 cm / strength 80) and then the stream stopped. I interrupted it with Ctrl+C. On the next run the script could not even open the connection (TimeoutError on the TCP connect), and a ping to the board gave "Destination Host Unreachable", so the board had dropped off the LAN until I reset it and re-entered WiFi Connect mode with the button. I did not root-cause this. The TFmini sends about 100 frames per second, so my guess is that a continuous hex dump over the WebSocket is more than the board's web server can sustain, but that is only a guess.I know the firmware has other tools (logic analyzer, analog plotter, sniff, triggers, emulator, AT commands) and I have only scratched the surface. So my questions are honest ones:
raw/sniff?Thanks for the work on the project. I would like to use it well, and I think a short note on its practical limits would also help other newcomers.
All reactions