I have been working on this off and on for over a year and am nearly ready to give up, then thought the massed expertise of the forum might be able to help. I am making a sound level controller using a mobile phone focused html/website for the AMD200 Amplifier by Australian Monitor. I'm using an ESP8266 as the micro and a RS485 converter connected to the tx/rx pins on the ESP8266. All this works fine and I can happily send messages to a USB RS485 dongle on my laptop.
The Problem is getting the AMD200 to understand/react to the messages I am sending. This is the extract from the manual on the protocol.
" The protocol is an ASCII protocol – all characters in the string are ASCII chars.
A binary value ranging between hexadecimal 00 and FF is transmitted as two
ASCII chars. All command strings start with the % character and end with a
carriage return – shown as in this document and equal to the single
ASCII value of 13 (0x0D).
To adjust the virtual volume control of the mic/line inputs, BGM source or
Master. %PVAL:xxyy<CR>
“xx” represents the parameter ID to be adjusted and “yy” is the new value.
Parameter ID’s
01 = Mic/Line 1 Volume
02 = Mic/Line 2 Volume
03 = Mic/Line 3 Volume
04 = Mic/Line 4 Volume
05 = Mic/Line 5 Volume
06 = Mic/Line 6 Volume
07 = Mic/Line 7 Volume
08 = Mic/Line 8 Volume
09 = Stereo BGM Volume
0C = Master Volume
The value of yy can range between 0x00 (off) and 0xE1 (225 = +12 dB of
gain).
This allows half dB steps throughout the range where for example:
0x00 = Off
0x01 = -100 dB
0xC9 = 0 dB
0xE1 = +12 dB
To request the current level of a source:
%PVAL:xx??<CR> where “xx” is the source.
When a volume is adjusted from another source e.g. ICON-CP the
AMD100/200 will send: %PVAL=xxyy<CR> where “xx” is the source and “yy” is the
current value."
So now I am into second guessing myself, do I send ASCII codes, binary codes, something else? I have tried multiple options and nothing works.
I am happy to post my code but don't want to make this a huge post as it is my first time posting. The section that is relevant is this:
'''
// Line 7 which is Lecturn (for now)
// Message should be %PVAL:05 actiually going for Line 7 for now
// = 25 50 56 41 4c 3a 30 35 0D
// = 25 50 56 41 4c 3a 30 37 0D
void slider1 (Control *sender, int type) {
if (sender->value.toInt() != vol1) {
vol1 = sender->value.toInt();
uint16_t vol_conv = vol1 * 2.25;
char tbs[30];
sprintf(tbs, "25 50 56 41 4c 3a 30 37 %02X 0D", vol_conv); //converts to Hex and pads to make sure there are 2 characters
Serial.println(tbs);
}
'''
All thoughts woud be most welcome