- Tue May 19, 2015 3:35 am
#17832
I'm trying to send some Sensor Informations via UDP to the Computer. I thougth UART should be the limiting factor, so i set the Baudrate of the ESP module and my microcontroller to 921600. Right after that I'm starting an UDP server, connecting the PC to the Access Point. I programmed a timer, running at 200Hz on the controller. At each timer Interrupt i'm transmitting a data packet. If the data packets are longer than 5 bytes the packets get lost. It seems like the esp module needs too much time for transmitting and doesn't accept new packets. The Controller UART Firmware should't be the problem, i checkt the commands and data packets with an ftdi cable.
Here's my code:
in the main routine
Code: Select all //UART
UART_init(2); //UART PIC 9600
send_string_auto("uart.setup(0,921600,8,0,1,0)\r\n"); //UART ESP 921600
UART_init(1); //UART PIC 921600
send_string_auto("sv=net.createServer(net.UDP,3600)\r\n");
send_string_auto("sv:on(\"receive\",function(s,c) print(c) end)\r\n");
send_string_auto("sv:listen(8888)\r\n");
in the interrupt routine:
Code: Select allsend_string_auto("sv:send(\"TestTest\")\r\n");