enfield
Posts: 5
Joined: Thu Sep 19, 2013 9:55 pm

FreeBasic serial port access

Thu Sep 19, 2013 10:42 pm

It appears that the RPi version of FreeBasic compiles COM1 as ttyS0 instead of ttyAMA0. I've tried several workarounds, all to no avail.

If anybody knows the secret of making FreeBasic talk to the com port I'd love to learn it.

Thanks!

Enfield

User avatar
DavidS
Posts: 4308
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: FreeBasic serial port access

Thu Sep 19, 2013 11:48 pm

You did not say what OS you are running, and I am not familiar with FreeBASIC beyond some very early DOS versions.

That said if you are using RISC OS, why not just use BBC BASIC, then in your BASIC Program use SYS "OS_SerialOp",3, SYS "OS_SerialOp",4, SYS "OS_SerialOp",5, and SYS "OS_SerialOp",6? You are aware that BBC BASIC is built into RISC as an integral component, are you not?

I must admit that I have never had any reason to do standard serial IO on the RPi so I do not know if there are any bugs here or not.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

enfield
Posts: 5
Joined: Thu Sep 19, 2013 9:55 pm

Re: FreeBasic serial port access

Fri Sep 20, 2013 1:18 am

Sorry 'bout that. It's Raspbian Wheezy, release of 2013-07-26.

I'll have a look at risc os and BBC basic (at least that approach shouldn't require spending half a day chasing dependencies!)

-Enfield

be80be
Posts: 18
Joined: Sat Aug 31, 2013 1:39 am

Re: FreeBasic serial port access

Fri Sep 20, 2013 1:24 am

You could add this

Code: Select all

sudo vi /etc/udev/rules.d/80-alamode-rules
KERNEL==”ttyAMA0″,SYMLINK+=”ttyS0″ GROUP=”dialout”
KERNEL==”ttyACM0″,SYMLINK+=”ttyS1″ GROUP=”dialout”
But I didn't have to do that on Raspbian wheezy

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: FreeBasic serial port access

Fri Sep 20, 2013 1:59 am

I've never used FreeBasic, but http://www.freebasic.net/wiki/wikka.php ... yPgOpenCom says you should be able to use /dev/ttyAMA0 directly?

enfield
Posts: 5
Joined: Thu Sep 19, 2013 9:55 pm

Re: FreeBasic serial port access

Fri Sep 20, 2013 3:59 pm

AndrewS wrote:I've never used FreeBasic, but http://www.freebasic.net/wiki/wikka.php ... yPgOpenCom says you should be able to use /dev/ttyAMA0 directly?
I tried that, but it didn't produce any results.

The compiler seemed to be OK with it, just no output.

?

enfield

enfield
Posts: 5
Joined: Thu Sep 19, 2013 9:55 pm

Re: FreeBasic serial port access

Fri Sep 20, 2013 7:18 pm

be80be wrote:You could add this

Code: Select all

sudo vi /etc/udev/rules.d/80-alamode-rules
KERNEL==”ttyAMA0″,SYMLINK+=”ttyS0″ GROUP=”dialout”
KERNEL==”ttyACM0″,SYMLINK+=”ttyS1″ GROUP=”dialout”
But I didn't have to do that on Raspbian wheezy

I added the file you suggested, but got no output using /dev/ttyS0 or COM1.

I suspect that this may well just be a bug in this specific version, as I have no trouble with serial in Puppy or Mint.

Thanks very much for your efforts, though.

-enfield

enfield
Posts: 5
Joined: Thu Sep 19, 2013 9:55 pm

Re: FreeBasic serial port access

Tue Sep 24, 2013 1:42 am

Gentlemen-

I put a 'scope on the Pi's serial TX pin and found there really was a signal. Long story short: the display I was sending to was off frequency. It had previously been used at 1200 baud and worked, but it just couldn't frame the data at 19,200.

Thank you for your efforts, and yes, I do feel like a fool!

speedfixer
Posts: 14
Joined: Tue Apr 16, 2019 3:54 am
Location: California

Re: FreeBasic serial port access

Tue Apr 16, 2019 9:36 pm

You should not have to poke at the environment/kernel to make it work correctly.

Head over to: https://www.freebasic.net/forum/

and ask.

You will get help very quickly.

david
If you don't try - you lose - a u t o m a t i c a l l y

Heater
Posts: 12739
Joined: Tue Jul 17, 2012 3:02 pm

Re: FreeBasic serial port access

Tue Apr 16, 2019 9:40 pm

speedfixer, you are only 6 years late with that fix !

speedfixer
Posts: 14
Joined: Tue Apr 16, 2019 3:54 am
Location: California

Re: FreeBasic serial port access

Wed Apr 17, 2019 4:43 pm

The 'fix' suggested was not a fix.
If better advice is available, it should be given.

People still search for things, that's how I found this.
If you don't try - you lose - a u t o m a t i c a l l y

Heater
Posts: 12739
Joined: Tue Jul 17, 2012 3:02 pm

Re: FreeBasic serial port access

Wed Apr 17, 2019 5:15 pm

Actually I agree with you. Many here complain when people reply to old threads but I argue that it's OK if the new information is relevant and still useful.

I was just making a jest from your user name and the timeliness of the reply :)

speedfixer
Posts: 14
Joined: Tue Apr 16, 2019 3:54 am
Location: California

Re: FreeBasic serial port access

Wed Apr 17, 2019 11:00 pm

I fear I may be too old to recognize humor so subtle.
Both my sons have the same problem with me.

I know I'm old because I remember when I would have ...


What were we talking about?

david
If you don't try - you lose - a u t o m a t i c a l l y

Return to “Other programming languages”