Hi, I'm having trouble sending messages and values with my RF 433MHz Transmitter/Receiver Module.
I have a few days ago successfully sent values from my Arduino Uno to a Feather HUZZAH ESP8266 and an Arduino Nano, but I had problem sending a message from the feather (both have 1 reciever and 1 transmitter). They never sent at the same time so no interference. I did manage to send from the feather to the Arduino Nano though but the signal was very weak so maybe 1/20 arrived (distance 10 cm). No difference when changing to the other reciever or transmitter.
I have no extra antennas but distance is not a problem, it's just a experiment.
The big problem is now that I can't send anything from anywhere and I don't know where to continue. I have tried everything!!
- Sending from all 3 (one at the time), the other 2 listening
- Tried 5V powersupply from different sources, all the MCUs and battery with bread board power supply.
- Bought new RF 433, (total 4 recievers and 4 transmitters)
- Reinstalled RH_ASK.h
- Changing pins on rx/tx and even PTT
- Different delays
- Different size of package 4 (like in 4 bytes in 'test'), 8, 32, 255
I have taken away my original project and only try to send the most simple stuff
Reciever (32 byte package)
#include <RH_ASK.h>
#include <SPI.h>
RH_ASK rf_driver (2000,7,8,10);
void setup()
{
Serial.begin(115200);
rf_driver.init();
}
void loop()
{
recTest();
recTest2();
recTest3();
}
void recTest()
{
uint8_t msgRecieved[32];
uint8_t buflen = sizeof(msgRecieved);
if (rf_driver.recv(msgRecieved, 32))
{
Serial.println(" ");
Serial.print("Recieved: ");
Serial.println((char*)msgRecieved);
}
else
{
Serial.print(".");
delay(200);
}
}
void recTest2()
{
uint8_t msgRecieved[32];
uint8_t buflen = sizeof(msgRecieved);
if (rf_driver.recv(msgRecieved, &buflen))
{
Serial.println(" ");
Serial.print("Recieved: ");
Serial.println((char*)msgRecieved);
}
else
{
Serial.print("-");
delay(500);
}
}
void recTest3()
{
uint8_t msgRecieved[RH_ASK_MAX_MESSAGE_LEN];
uint8_t buflen = sizeof(msgRecieved);
if (rf_driver.recv(msgRecieved, &buflen))
{
Serial.println(" ");
Serial.print("Recieved: ");
Serial.println((char*)msgRecieved);
}
else
{
Serial.print(",");
delay(1000);
}
}
Sender
#include <RH_ASK.h>
#include <SPI.h>
RH_ASK rf_driver;
void setup()
{
Serial.begin(115200);
rf_driver.init();
}
void loop()
{
sendTest();
//sendTest2(); // pick one
}
void sendTest()
{
const char *msg = "Test";
rf_driver.send((uint8_t *)msg, 4);
rf_driver.waitPacketSent();
Serial.print("Message sent: ");
Serial.println(msg);
delay(500);
}
void sendTest2()
{
const char *msg = "Test";
rf_driver.send((uint8_t *)msg, 4);
rf_driver.waitPacketSent();
Serial.print("Message sent: ");
Serial.println(msg);
delay(1000);
}
I have been trying for days! What am I missing?? :o
Below is picture of wiring (WRONG in picture. I accidently moved 1 cable on arduino when taking the photo, there is not 2 wires to ground)