Home › Forums › Infrastructure and Equipment › esp32-bee-wifi-bluetooth › Reply To: esp32-bee-wifi-bluetooth
Thanks for the explanation – I do so appreciate that the code at 9600 baud works, and there is a lot of hard work gone into configuring it – as you say to work both first off and subsequent power ups.
Coming from a real time programming background I keep forgetting about the simplicity of Arduino. So I keep tripping over issues like this – it will be burnt into my brain someday – it would have been so nice for that explanation to be in place in the code where it goes through gyrations.
I would suggest its actually the architecture that is the real issue, not the lack of cycles which consume power just polling . I’ve used mega2560 with 115200 fast processing in the past.
https://forum.arduino.cc/t/serial-input-basics/278284
and from TinyGsmClientESP8266.h
1 2 3 4 5 |
while (stream.available() > 0) { TINY_GSM_YIELD(); int8_t a = stream.read(); if (a <= 0) continue; // Skip 0x00 bytes, just in case data += static_cast<char>(a); |
it needs to receive <NL> before processing the buffer.
My take is the issue is that the buffer handling/parsing is being processed at too high level – and not closer to the hardware. There is a lot of value in reducing power consumption in being able to process the serial stream to/from the MMW faster – so I believe its worth understanding. However I haven’t gone through the layers with TinGSM to understand it.
Some years ago while chatting with a Standford CSU Professor at a TinyOS conference, he said it was so hard to teach people real-time processing, and of course event based processing and finite state machines . Their solution, Berkley/Standford nesC (network embedded systems C) was harder to understand than the problem they where solving.