automating serial debug
max72
Posts: 1,155
I would like to ask your opinion about the following:
Sometimes I would like to be able to test an object or an algorithm using test data. I would like to simluate sensor reading using known values.
In my mind the ideal solution would be a scripting language (say Perl, or anything else) feeding the propeller with data using the serial port, taken from a text file, and reading and storing back the propellered data in another text file. This way I would be able check the data using a spreadsheet, scilab, octave, or anything else.
Any suggestion is welcome.
Massimo
Sometimes I would like to be able to test an object or an algorithm using test data. I would like to simluate sensor reading using known values.
In my mind the ideal solution would be a scripting language (say Perl, or anything else) feeding the propeller with data using the serial port, taken from a text file, and reading and storing back the propellered data in another text file. This way I would be able check the data using a spreadsheet, scilab, octave, or anything else.
Any suggestion is welcome.
Massimo
Comments
Do have a look at Hanno's ViewPort (hannoware.com/) which does something similar at a lower level. It uses a serial port for communications, but it uses code on the Propeller side, running in its own cog, to directly affect or monitor the I/O pins.
Somethimes I have the sensor handling working, but I'm not sure the calculations are bullt proof. Assuming I can handle and pre-process sensor data, I would like to test my algorithms against a series of test data.
For instance:
I have a GPS and an anemometer, and I'm sure the serial handling works.
I'm not sure my trig functions are ok, I'm not overflowing, I correctly handle sign and roll over.
My output data would be true vind and VMG, or with a set of GPS data I would expect way point data /distance, VMG, time to target, in case of a line XTE, time to line and so on..
If I can feed the propeller with fake data, let's say a set of speed/heading, and check it back against my expected data, I would be able to verify part of my code, independently of the sensor protocol.
In my understanding Viewport can change a data set, but not iteratively doing that.