Recent

Author Topic: TvsComPort on MacOS Sierra problem  (Read 1789 times)

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
TvsComPort on MacOS Sierra problem
« on: December 12, 2024, 03:13:38 pm »
Hi everybody,

I have a problem using TvsComPort on MacOS Sierra

On Open The program freeze.

Same code works without problem on Windows 7, 10 64b and Linux 64b

Code: Pascal  [Select][+][-]
  1.  RS232.SynSer.Connect(RS232.Device); // Device exists and is working
  2.  
  3.  if( RS232.SynSer.Handle = THandle(-1) ) then
  4.  begin
  5.   ShowMessage('Problem with RS232');
  6.  
  7.   RS232.Active := False;
  8.   exit();
  9.  end;
  10.  
  11.  RS232.Active := true;
  12.  try
  13.   RS232.Open; // Freeze on Mac, work on Windows 7, 10 and Linux 64
  14.   except
  15.   on E: Exception do
  16.   begin
  17.    ShowMessage('Problem Opening RS232: ' + E.Message);
  18.    RS232.Active := False;
  19.    exit();
  20.  end;
  21.  
  22.  

Any idea?

Thank you.

B->
Regards,
Dzandaa

ackarwow

  • Full Member
  • ***
  • Posts: 127
    • Andrzej Karwowski's Homepage
Re: TvsComPort on MacOS Sierra problem
« Reply #1 on: December 12, 2024, 06:33:15 pm »
Hi everybody,

I have a problem using TvsComPort on MacOS Sierra

On Open The program freeze.

Same code works without problem on Windows 7, 10 64b and Linux 64b

(...)

Any idea?

Thank you.

B->

Hi @Dzandaa
I had similar problem testing your Test AVR program on MacOS. I don't know what is causing this problem...  :(

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1255
Re: TvsComPort on MacOS Sierra problem
« Reply #2 on: December 13, 2024, 01:48:33 am »
hello,
this problem is resolved here in TLazserial.  The last version of TLazserial works on macos.
Friendly, J.P
« Last Edit: December 13, 2024, 01:55:09 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: TvsComPort on MacOS Sierra problem
« Reply #3 on: December 13, 2024, 01:06:40 pm »
Hi,

@JP:

I tried but have the same problem.
I also compiled your test program, just to see if I can open the port, but same problem again.

B->
Regards,
Dzandaa

sstvmaster

  • Sr. Member
  • ****
  • Posts: 301
Re: TvsComPort on MacOS Sierra problem
« Reply #4 on: December 13, 2024, 02:09:01 pm »
Maybe you must add your user to the dialout group, like under linux? I dont know if this is required under macos. Just a guess.
greetings Maik

Windows 10,
- Lazarus 3.6 (stable) + fpc 3.2.2 (stable)
- Lazarus 4.99 (trunk) + fpc 3.3.1 (main/trunk)

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1255
Re: TvsComPort on MacOS Sierra problem
« Reply #5 on: December 13, 2024, 03:54:08 pm »
What kind of serial port have you ? With a usb serial port  , i have no problem on MacOs Catalina 10.15
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: TvsComPort on MacOS Sierra problem
« Reply #6 on: December 13, 2024, 03:55:51 pm »
Hi,

@sstvmaster:
No, it is not like linux :)
@JP:

It's an USB Port

I can open the port with other programs.
Problem just with Lazarus.

I track the error in unit synaser:
Code: Pascal  [Select][+][-]
  1.  FHandle := THandle(fpOpen(FDevice, SerialFlags));    

There it freeze.

B->
Regards,
Dzandaa

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1255
Re: TvsComPort on MacOS Sierra problem
« Reply #7 on: December 13, 2024, 04:04:09 pm »
your device is in the wheel group ?
 
Quote
sudo ls -lt /dev/tty.*
crw-rw-rw-  1 root  wheel   18,   4 13 déc 16:01 /dev/tty.usbserial-C40
crw-rw-rw-  1 root  wheel   18,   2 13 déc 16:01 /dev/tty.usbserial-C30
crw-rw-rw-  1 root  wheel   18,   0 13 déc 15:57 /dev/tty.Bluetooth-Incoming-Port
~ %
Have you do this on the Synser/NonBlock property  of TLaserial component ?
On OS-X you must set the new property  SynSer/NonBlock to True  in the properties of TLazserial component.
« Last Edit: December 13, 2024, 04:17:37 pm by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: TvsComPort on MacOS Sierra problem
« Reply #8 on: December 13, 2024, 04:23:21 pm »
Hi,

@JP:

Found the problem, i forgot to set the NonBlock parameter :)

Sorry...

@ackarwow:

I'll post the modified test version later on your AVRPascal post.

Thank you for your help.

B->
Regards,
Dzandaa

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: TvsComPort on MacOS Sierra problem
« Reply #9 on: December 16, 2024, 11:22:29 am »
Hi,

@JP:

I noticed that the NonBlock property does not exist in the Windows TLazSerial object,
which creates a "small" problem in the .lfm when recompiling a project from Mac to Windows.

Wouldn't it be better to have the same parameters even if they are useless?

Best wishes.

B->
Regards,
Dzandaa

 

TinyPortal © 2005-2018