I found issues. I have tried a new code with some success. This is the transmitter portion.
#include <RH_ASK.h>
#include <Brain.h>
#include <SPI.h> // Not actually used but needed to compile
Brain brain(Serial);
RH_ASK driver;
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
void loop()
{
if (brain.update()) {
char *msg;
msg = brain.readErrors();
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
msg = brain.readCSV();
Serial.println(brain.readCSV());
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
}
}
The problem is I keep getting packet too long error in serial monitor. I am not sure if it has to do with the length I put for the array receiving it or not.
For the receiver code I simply did
uint8_t buf[59]
where 59 is the max number of characters contained in the packet being sent(I simply counted the number of commas and numbers in the longest packet sent by the headset). To add to my confusion, brain.h seems to define max packet length.
"#define MAX_PACKET_LENGTH 32"
Right now it is saying packet too long or adding random characters to the end of the string of numbers. But it is a start because it is sending the data from the headset over rf.