
I use this board(a9 gprs). I need to rely on its GPRS/SMS features
https://github.com/pulkin/micropython/t ... ts/gprs_a9
Code: Select all
time.sleep_ms(20)
print(uart.any())
data = uart.read()
print(f'_{data}_} {type(data)}'
It still filter out \xff. The only way to receive this \xff is the board is in time.sleep() while the data is coming. If the board is running,\xff will disspear no matter how long you sleep before reading.TheSilverBullet wrote: ↑Tue Aug 09, 2022 3:37 pmYou might wanna check a few milliseconds after you received the first part of your incoming message:Uhhh, just saw the remark regarding that ancient version. Cancel everything after Good Morning.Code: Select all
time.sleep_ms(20) print(uart.any()) data = uart.read() print(f'_{data}_} {type(data)}'
![]()
No, it still not work. I try difference combination of this timeout and timeoutchar.
Thanks you for looking at the code.Roberthh wrote: ↑Wed Aug 10, 2022 11:17 amIn uart.c, line 110, the else statement, looks wrong. Try to delete that. If mp_interrupt_char() is set to -1, a 0xff will not be put into the ringbuffer. For verification, you could set the mp_interrupt_char() to a different value and see, if the other value then is skipped.
Code: Select all
static void uart_rx_intr_handler(UART_Callback_Param_t param) {
// handles rx interrupts
ringbuf_t *ringbuf = uart_ringbuf + param.port - 1;
int* to_dupterm = uart_attached_to_dupterm + param.port - 1;
for (uint32_t i=0; i<param.length; i++) {
if (param.buf[i] == mp_interrupt_char) {
if (*to_dupterm)
mp_keyboard_interrupt();
}
else
ringbuf_put(ringbuf, param.buf[i]);
}
}