X-communication between a website and a propeller C3
JChris
Posts: 58
Hello,
I am trying to achieve some form of data exchange between a website, that I developed in PHP, and a C3 development board.
However, I am experiencing some difficulties in receiving the data, on the propeller side, and I wonder whether somebody faced the same issue and managed to solve it.
Practically speaking I am sending the data onto a serial port of the PC. The propeller is plugged on this same port through a USB serial adapter. In this case, port 17, with 8N1 communication parameters (see below).
The baud rate has been set at 38400 on both sides (PC and propeller) and I tried different values (ranging from 9600 to 115200) without seeing any difference.
Checking with the ProScope data logic analyzer I was able to validate that the 8 bytes I was sending were actually well received on Pin 31 of the propeller.
The thing is: I cannot get this data read by the propeller from the input buffer.
To avoid possible conflicts on pin 30 and 31, I am using a LCD connected to pin 1 to display the result, i.e. the bytes I am trying to fetch from the buffer.
The RX method (in the FullduplexSerial library) is used to fetch the data but it gets stuck and I am not able to retrieve anything from the input buffer. It seems that RX waits forever for a character to come.
Any thoughts on what could be wrong? Any help would be appreciated.
Extract from the PHP sender
Spin receiver program
I am trying to achieve some form of data exchange between a website, that I developed in PHP, and a C3 development board.
However, I am experiencing some difficulties in receiving the data, on the propeller side, and I wonder whether somebody faced the same issue and managed to solve it.
Practically speaking I am sending the data onto a serial port of the PC. The propeller is plugged on this same port through a USB serial adapter. In this case, port 17, with 8N1 communication parameters (see below).
The baud rate has been set at 38400 on both sides (PC and propeller) and I tried different values (ranging from 9600 to 115200) without seeing any difference.
Checking with the ProScope data logic analyzer I was able to validate that the 8 bytes I was sending were actually well received on Pin 31 of the propeller.
The thing is: I cannot get this data read by the propeller from the input buffer.
To avoid possible conflicts on pin 30 and 31, I am using a LCD connected to pin 1 to display the result, i.e. the bytes I am trying to fetch from the buffer.
The RX method (in the FullduplexSerial library) is used to fetch the data but it gets stuck and I am not able to retrieve anything from the input buffer. It seems that RX waits forever for a character to come.
Any thoughts on what could be wrong? Any help would be appreciated.
Extract from the PHP sender
Spin receiver program
Comments
Any other suggestion?
That reads a single byte from the PC FDS variable, and outputs that single byte to the LCD FDS variable.
LESSON learned: never plug the propeller on a USB Hub when transferring data between a PC and a propeller board.
Thanks for your help
My propeller is always connected to my PC via a powered hub!
Jim