Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial and USB ports
#12
The com ports will work in linux with qb64. 
But you need to use a shell command to open them, and open the device file not com port like normal.


Shell "  stty -F /dev/ttyS0 9600 raw -ixon -ixoff -crtscts cs8 -echo -parenb -cstopb -icanon min 0 time 0"
Open "/dev/ttyS0" for binary as #1

You might have to mess around with the stty command.
I tried using this on laptop with usb serial, desktop with built in serial port, and orange pi uart ports. Just find the ports in the dev folder and adjust stty command and open command.

This is just how I found I can make it work is with the stty command and open in binary mode.
I have a timer set to check port 10x per second and if any data is there it reads it otherwise just checks 10x a second waiting so it doesn't waste crazy cpu cycles.

I can't use strings, I use a _byte variable to read.
So you use get to grab byte by byte.
Can send strings though.
It was a trick to figure out but now it's not bad.
Reply


Messages In This Thread
Serial and USB ports - by Keith - 03-28-2025, 05:20 PM
RE: Serial and USB ports - by Pete - 03-28-2025, 06:54 PM
RE: Serial and USB ports - by Keith - 03-29-2025, 04:52 PM
RE: Serial and USB ports - by Parkland - 03-30-2025, 01:56 AM
RE: Serial and USB ports - by Keith - 03-30-2025, 08:42 AM
RE: Serial and USB ports - by eoredson - 04-03-2025, 10:14 PM
RE: Serial and USB ports - by Keith - 04-04-2025, 08:34 AM
RE: Serial and USB ports - by eoredson - 04-04-2025, 09:57 PM
RE: Serial and USB ports - by hsiangch_ong - 04-05-2025, 07:03 AM
RE: Serial and USB ports - by Keith - 04-05-2025, 09:56 AM
RE: Serial and USB ports - by hsiangch_ong - 04-07-2025, 09:09 AM
RE: Serial and USB ports - by Parkland - 04-25-2025, 07:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Connection address weird ports? Parkland 1 420 04-25-2025, 09:45 PM
Last Post: DSMan195276
  USB Camera? james2464 33 6,420 02-27-2025, 12:02 AM
Last Post: SpriggsySpriggs
  Struggling with serial comms Wolstan Dixie 8 2,484 05-20-2022, 09:58 PM
Last Post: moci

Forum Jump:


Users browsing this thread: 1 Guest(s)