Hello everyone,
I am having a hard time with communicating between a LoRa e5 mini board and something else (PC, RPi, Arduino) using UART.
Here is an output example :
hello from board
this is a very very very very long string, because i feel like it
well hello too
well helo too
that's a pretty long line too
that's a petty long line too
0123456789876543210
012345679876543210
Two first lines are issued from my board, then it is a line I am sending, and the line echoed back to me. It seems the problem is on the board reading side, but I can’t see what I am missing.
Here is the code that generated said output :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ztimer.h"
#include "stdio_base.h"
int main(void)
{
stdio_init();
size_t max_len = 240;
char msg[max_len];
stdio_write("hello from board\n", 17);
stdio_write("this is a very very very very long string, because i feel like it\n", 66);
while (1) {
//checking for input data
if (stdio_available()) {
//wait a bit, making sure we get everything
ztimer_sleep(ZTIMER_MSEC, 10);
//read and print back
ssize_t count = stdio_read(&msg, max_len);
for (int i = 0; i < count; i++) {
printf("%c", msg[i]);
}
printf("\n");
}
ztimer_sleep(ZTIMER_MSEC, 1);
}
return 0;
}
To connect to the board I tried pyterm, my own python script, the Arduino IDE Serial monitor, they all encounter this problem.
Interestingly, when I try tests/drivers/sx126x which includes a shell to try sx126x features, my input is correctly read, so I guess the problem is on some coding on parameters missing rather on RIOT OS itself
Does anybody have a clue ?
Edit : another (smallish) problem I encounter is it seems my data is not sent (from the board) until I send a \n I tried both printf and stdio_write, both seems to need that \n