I am pleased to announce that espBode 2.0 is now working! This represents a complete rewrite from the ground up. While it definitely owes a debt to the earlier espBode versions, this is not simply an edit of those; it is an entirely new program, written to take advantage of C++, and hopefully much more robust.
So far, I only have the code for the FY6900 with recent firmware, but the way I have implemented the code, it should be trivial to add any other FY models.
The key difference among these models seems to be the format and magnitude of the value they send and receive for the various parameters. For the FY6900 that I have, with firmware 1.5, it takes a floating point value to set frequency (in Hz), amplitude (Vpp), offset (V), and phase (°). For example, to set the frequency on channel 1 to 103.27 Hz, one sends the command "WMF103.27".
It would make way too much sense for it to return the same sort of value when reading parameters. And indeed, it does return the frequency as a floating point number (in Hz): Send the command "RMF" to the FY6900 (read main-channel frequency), and it returns 00000103.270000 - zero-filled before and after, but as noted above, the zero-fill is not required when setting the value.
Unfortunately, reading amplitude, phase, and degrees does not return the value in a floating-point format, but rather as an integer ... and the magnitude is not consistent. it returns amplitude as an integer that equals the Vpp * 1000, but it returns both offset and phase as integers that equal the value * 1000. Go figure! (I have not looked to see what duty cycle or other such commands do, since those are not used in the Bode plot, but I am guessing there are other delightful inconsistencies there.)
My implementation uses a "translation table" that tells the software what sort of value to send and to receive, and how it needs to be adjusted for magnitude. Thus, changing from the current FY6900 to, say, a FY6600 requires only determining the format of the send and receive values, and filling in the table accordingly.
I should add that, while I have tested this version (and gotten a beautiful Bode plot of a single-transistor Class A amplifier, attached below), I have not yet tested this exhaustively. Moreover, bateau020 has been giving extraordinarily helpful feedback, particularly with respect to things that are going on at the network level (e.g., responses that might "work" but are ultimately in danger of crashing the wifi); there may be more tweaks needed in response to that feedback. And beyond all of that, there is still work to be done to document everything - I have included a lot of comments, but there is some code that still needs comments, and I need to revise all of the comments to be a more standard format.
Still ... I am beyond delighted to have a working version, and I would very much welcome any input, suggestions, questions, etc. Github repository is here:
https://github.com/awakephd/espBode/tree/version-2.0.