Posts: 2,910
Threads: 305
Joined: Apr 2022
Reputation:
167
Okay, so you are saying if that after it counted '31' characters received, in the example, telling it to exit to loop would make no difference because when it cycled back, to monitor for the next message, it would forever hang until that message was sent, and if never sent, hang indefinitely.
Hopefully the handshake suggestion by tantalus makes a difference. If not, and you can get a C solution for that part going, as DSMan mentioned, and he does have a Linux system, you might still be able get it working, without any chewing gum and bailing wire.
Pete
Posts: 21
Threads: 6
Joined: Jun 2024
Reputation:
2
04-04-2025, 12:03 AM
(This post was last modified: 04-04-2025, 02:14 AM by Parkland.)
Alright, learning as I go here but this is what worked so far.
Shell " stty -F /dev/ttyS5 9600 raw -ixon -ixoff -crtscts cs8 -echo -parenb -cstopb -icanon min 0 time 0"
And I'm able to send data from qb64pe out, and recieve raw characters, without a hang on 'GET' statement waiting for data.
It's amazing how many times I've used com ports for what I considered pretty advanced projects and never asked much questions.
For example i can 'PUT' whatever string i want without error, but can only 'GET' into a numerical byte array.
But, it does work, with this, I can use the orange pi UART serial from qb64 programs.
I will probably arrange a subroutine where it checks several times a second for more data using 'GET', and if there is any just load the rest without delay. that way it's functional and not super CPU intensive.
I suppose theres probably a way to adjust buffer sizes so it needs less checking too, another days project.
Just adding that after the shell stty command, I open the serial device file, in my case /dev/ttyS5. then open as binary.