serial TX issue
bnikkel
Posts: 104
in Propeller 1
Hello everyone,
I have a JDY-40 2.4ghz module. i am having zero luck sending commands to it using the flip but i am receiving "START" from it when i first connect power.
I can communicate with the module perfectly using the arduino terminal, 9600 baud with both NL and CR after sending AT+BAUD command
but i just cant seem to figure out what im missing with the propeller? Thanks in advance for any help.
I have a JDY-40 2.4ghz module. i am having zero luck sending commands to it using the flip but i am receiving "START" from it when i first connect power.
I can communicate with the module perfectly using the arduino terminal, 9600 baud with both NL and CR after sending AT+BAUD command
but i just cant seem to figure out what im missing with the propeller? Thanks in advance for any help.
#include "simpletext.h" #include "simpletools.h" // Include simple tools #include "fdserial.h" fdserial *program; int m = 0; //----------------------------------------------------------------- int main() { pause(100); // RX-TX program = fdserial_open(0, 2, 0, 9600); // p0-p1 transmit to receiver pause(100); print("RUNNING\n"); pause(100); //dprint(program, 'AT+BAUD'); //change text //fdserial_txChar(program, "AT+BAUD\r\n"); //Command byte //dprint(program, "%s%d%d", "AT+BAUD", 13, 10); //change text //dprint(program, "%s%c%c", "AT+BAUD", 0x0D, 0x0A); //change text //dprint(program, "AT+BAUD%c%c", 13, 10); //send specific text //dprint(program, "AT+BAUD%c%c", 0x0D, 0x0A); //send specific text fdserial_txChar(program, "AT+BAUD"); //Command byte fdserial_txChar(program, 0x0D); //Command byte fdserial_txChar(program, 0x0A); //Command byte while(1) { m = fdserial_rxChar(program); print("m= %c, %d,\n",m, m); pause(100); } int i=0; for( i=0; i<=17; i++ ) { m = fdserial_rxChar(program); print("m= %c, %d,\n",m, m); pause(100); } print("DONE!\n"); } //---------------------------------------------------------------
Comments
print("RUNNING\n\r");
print("RUNNING\r\n");
I found this on page 4 of the datasheet.
i have tried so many combinations i have lost count. i am also able to send and receive with the propeller using it as just a wireless transmitter, but i can not send to it when i try to program it. if that makes sence?
inverted serial communication?
program = fdserial_open(0, 2, 1 , 9600);
Ltech, if i invert will that also change the RX? i know i can currentlty receive with (0,2,0,9600)?
Pin 12 needs to be grounded to send AT commands and the commands need to be ended with CR/LF or \r\n
dprint(program, "AT+BAUD\r\n");
Mike
Mike
I ran across this before.
The fdserial_txChar function is fine and will transmit the characters as is.
Mike
Mike
I think that fdserial_txChar(...) Only writes the single "A" character to the program device... "T+BAUD" just get dropped into the bit bucket. (Just my guess, as you've seemed to have fixed the problem by sending out the characters one at a time).
dgately
JDY-40 PROGRAM (1).c:72:1: error: 'for' loop initial declarations are only allowed in C99 mode
dgately