Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-06 Thread Michael Schnell
On 04.07.2017 00:06, Mark Morgan Lloyd wrote: ... if you're in any sort of tight loop you need to call APM to get any of the usual GUI stuff to work. Including any messages sent by worker threads such as "TThread.Queue", "TThread.Synchronize", "Application.QueueAsnycCall" and "SendThreadMessage

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-03 Thread Mark Morgan Lloyd
On 03/07/17 21:00, Bo Berglund wrote: On Sun, 2 Jul 2017 12:27:45 +, Mark Morgan Lloyd wrote: You were asking a few days ago about Application.ProcessMessages but >didn't respond to my attempt to tease out your understanding of what was >happening. Have you sorted that out to your satisfa

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-03 Thread Bo Berglund
On Sun, 2 Jul 2017 12:27:45 +, Mark Morgan Lloyd wrote: >You were asking a few days ago about Application.ProcessMessages but >didn't respond to my attempt to tease out your understanding of what was >happening. Have you sorted that out to your satisfaction? I made a Lazarus GUI program to

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-02 Thread Mark Morgan Lloyd
On 02/07/17 11:45, Bo Berglund wrote: The Lazarus relaying program using FPC serial and Indy TIdTcpclientcomponents works just fine! Now also with millisecond logging. Assuming you mean the standard serial.pp: yes, it was because of accurate logging etc. that I worked on it a few years ago.

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-02 Thread Bo Berglund
On Thu, 29 Jun 2017 10:39:05 +0200, Bo Berglund wrote: >Issues: >For some unknown reason (so far) the remote side loses connection to >the target system (no response after initially being able to talk to >it). In fact this is reproducible 100%, the first handshake works and >the system can be set

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-29 Thread Paulo Costa
On 29-Jun-17 15:43, Koenraad Lelong wrote: Op 29-06-17 om 10:25 schreef Bo Berglund: On Sun, 18 Jun 2017 20:36:11 +0200, Koenraad Lelong wrote: Do you know the SDPO-package ? That has a serial component (SDPOSerial). This has a OnRxData event. Do you mean SDPO or 5DPO (letter S or number 5

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-29 Thread Koenraad Lelong
Op 29-06-17 om 10:25 schreef Bo Berglund: On Sun, 18 Jun 2017 20:36:11 +0200, Koenraad Lelong wrote: Do you know the SDPO-package ? That has a serial component (SDPOSerial). This has a OnRxData event. Do you mean SDPO or 5DPO (letter S or number 5 at the start)? I googled for SDPO but the hi

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-29 Thread José Mejuto
El 29/06/2017 a las 10:39, Bo Berglund escribió: 3) I also noted in the comments in TurSeriale.pas: "The Windows port driver does receive callbacks in chunks that are typically 8 bytes long. With ReceiveMode = rmRAW, TSeriale will simply pass this chunks on to the application with

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-29 Thread Bo Berglund
On Wed, 28 Jun 2017 10:55:47 -0700 (MST), turro75 wrote: >I don't know if useful, here You can find a terminal + serial to eth or >reversed based on lnet, custom serial component and richmemo > >https://github.com/Turro75/TCPLogger_V2.git > > Thanks

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-29 Thread Bo Berglund
On Sun, 18 Jun 2017 20:36:11 +0200, Koenraad Lelong wrote: >Do you know the SDPO-package ? That has a serial component (SDPOSerial). >This has a OnRxData event. Do you mean SDPO or 5DPO (letter S or number 5 at the start)? I googled for SDPO but the hits were for 5DPO... -- Bo Berglund Devel

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-28 Thread turro75
I don't know if useful, here You can find a terminal + serial to eth or reversed based on lnet, custom serial component and richmemo https://github.com/Turro75/TCPLogger_V2.git Ciao Valerio -- View this message in context: http://free-pascal-ge

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-27 Thread Michael Schnell
On 27.06.2017 14:37, Lukasz Sokol wrote: But I'd put the serial port handling calls, blocking or not, into a thread separate from main anyway. Of course. (The "short message says this, too.) (p.s. why not reply on the group still? :) ) I did send the message to the group, as well, but those

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-27 Thread Michael Schnell
On 27.06.2017 12:10, Lukasz Sokol wrote: The serial handling thread would poll the serial port ... As already pointed out above (in a very short message) no need for polling, just use blocking OS calls. -Michael ___ fpc-pascal maillist - fpc-pasca

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-27 Thread Michael Schnell
On 27.06.2017 00:28, Bo Berglund wrote: I have the concern that I am using Application.Processmessages, which I believe cannot be used in a console program. How can I replace it? TThread.Queue is available in an appropriately done "console application". As already discussed several times in th

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-27 Thread Lukasz Sokol
On 26/06/17 23:28, Bo Berglund wrote: [...] > > NEXT: > It looks like I will have to rewrite my relaying program now used in > Windows for the conversion to TCP from RS232 to also work as the > replacement for ser2net on RPi3. This way I can monitor the data > better and check time intervals etc.

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-27 Thread Mark Morgan Lloyd
On 26/06/17 22:30, Bo Berglund wrote: My problem here is the fact that the RPi is headless so the GUIprogram I have written with Lazarus will not work. Instead I have tomake a console version that can run on RPi for the test and here Ihave the concern that I am using Application.Processmessag

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-26 Thread Bo Berglund
On Sun, 18 Jun 2017 09:04:49 +0200, Bo Berglund wrote: >So I installed >serial2net on the RPi, making it publish the serial port as a TCP port >(#2091). This part works OK, so whatever is sent on the TCP socket >connection gets transferred to the RS232 serial line and vice versa. My statement ab

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-23 Thread Michael Schnell
On 22.06.2017 00:30, Bo Berglund wrote: 1) How do I enter a loop in a GUI application? In a command line application it is just going to be part of he main program code. Use a Thread. 2) How do I stop the program from running at 100% CPU utilization (on Windows)? Blocking read. -Michael __

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-22 Thread Mark Morgan Lloyd
On 21/06/17 22:45, Bo Berglund wrote: Two issues here:1) How do I enter a loop in a GUI application? In a command lineapplication it is just going to be part of he main program code. I'm not saying it's the right or the best way, but in the interest of giving you something to work with I do

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-22 Thread Mark Morgan Lloyd
On 21/06/17 23:00, Bo Berglund wrote: On Thu, 22 Jun 2017 00:30:27 +0200, Bo Berglund wrote: I looked at the socket unit, which has the advantage that it is part>of FPC. But the documentation is very confusing...>For example I was looking at fpconnect:>https://www.freepascal.org/docs-html/rtl/

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-21 Thread Bo Berglund
On Thu, 22 Jun 2017 00:30:27 +0200, Bo Berglund wrote: >I looked at the socket unit, which has the advantage that it is part >of FPC. But the documentation is very confusing... >For example I was looking at fpconnect: >https://www.freepascal.org/docs-html/rtl/sockets/fpconnect.html >and noted tha

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-21 Thread Bo Berglund
On Wed, 21 Jun 2017 08:02:00 +, Mark Morgan Lloyd wrote: >> What about Linux (Raspberry Pi)? Is the com port name simply ttyUSB1or do I >> have to use the full /dev/ttyUSB1? > >You *definitely* have to use the name as given. You're opening a file in >the filesystem tree, not an internally-r

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-21 Thread Mark Morgan Lloyd
On 21/06/17 05:30, Bo Berglund wrote: On Wed, 21 Jun 2017 01:57:36 +0200, José Mejuto wrote: The problem I have is that it seems only to work for COM1 or COM3, as>> soon as I use a higher numbered port like COM33 then it fails.>> What have I missed here?>> Is serial only able to work with the l

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Bo Berglund
On Wed, 21 Jun 2017 01:57:36 +0200, José Mejuto wrote: >> The problem I have is that it seems only to work for COM1 or COM3, as >> soon as I use a higher numbered port like COM33 then it fails. >> What have I missed here? >> Is serial only able to work with the low numbered ports (single >> digit

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread José Mejuto
El 21/06/2017 a las 1:37, Bo Berglund escribió: The problem I have is that it seems only to work for COM1 or COM3, as soon as I use a higher numbered port like COM33 then it fails. What have I missed here? Is serial only able to work with the low numbered ports (single digit)? Hello, COM port

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Bo Berglund
On Tue, 20 Jun 2017 09:18:50 +, Mark Morgan Lloyd wrote: > >I tend to use the lower-level serial.pp unit. The patches I contributed >a couple of years ago specifically added a couple of read-with-timeout >functions. I'm back with a question: I used the serial example in the hardware access

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Bo Berglund
On Tue, 20 Jun 2017 09:18:50 +, Mark Morgan Lloyd wrote: >I tend to use the lower-level serial.pp unit. The patches I contributed >a couple of years ago specifically added a couple of read-with-timeout >functions. > Mark, thanks for your input! I had a look at the serial unit and I found t

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Paulo Costa
On 20-Jun-17 10:45, Michael Schnell wrote: On 20.06.2017 11:18, Mark Morgan Lloyd wrote: I tend to use the lower-level serial.pp unit. The patches I contributed a couple of years ago specifically added a couple of read-with-timeout functions IMHO, freeing the user from the necessity to poll o

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Michael Schnell
On 20.06.2017 11:18, Mark Morgan Lloyd wrote: I tend to use the lower-level serial.pp unit. The patches I contributed a couple of years ago specifically added a couple of read-with-timeout functions IMHO, freeing the user from the necessity to poll or do a thread to wait for serial events is

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-20 Thread Mark Morgan Lloyd
On 20/06/17 06:45, Michael Schnell wrote: On 18.06.2017 18:16, Bo Berglund wrote:> No RS232 work with FPC/Lazarus> earlier and in Delphi I used AsyncPro components, but these are so> complex that one is lost amongst all properties to set...AsyncPro is free and easy to use but not perfectly bug-fr

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-19 Thread Michael Schnell
On 18.06.2017 18:16, Bo Berglund wrote: No RS232 work with FPC/Lazarus earlier and in Delphi I used AsyncPro components, but these are so complex that one is lost amongst all properties to set... AsyncPro is free and easy to use but not perfectly bug-free. Unfortunately no fpc/Lazarus port ye

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-19 Thread Bo Berglund
On Mon, 19 Jun 2017 09:25:59 -0400, Paul Breneman wrote: >I've used com0com *and* hub4com successfully for several things in the >past. See #3 here: > http://www.ctrlterm.com/related.htm > In the README file with com0com they write: "INSTALLING == NOTE (x64-based Windows Vista/Wind

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-19 Thread Paul Breneman
On 06/19/2017 08:43 AM, Bo Berglund wrote: On Sun, 18 Jun 2017 19:16:05 -0400, Paul Breneman wrote: Why do you need FPC code? Here are free drivers that work in Windows: http://com0com.sourceforge.net/ ... I would really like to use an available program rather than spening time to deve

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-19 Thread Bo Berglund
On Sun, 18 Jun 2017 19:16:05 -0400, Paul Breneman wrote: >Why do you need FPC code? Here are free drivers that work in Windows: > http://com0com.sourceforge.net/ I tried again and failed again. I installed com0com and had an error in my face during installation: SetupUninstallOEMInf(oem11.inf

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-19 Thread Bo Berglund
On Sun, 18 Jun 2017 19:16:05 -0400, Paul Breneman wrote: >Why do you need FPC code? Here are free drivers that work in Windows: > http://com0com.sourceforge.net/ Because I am programming in Pascal (Delphi and FPC) and I had failed to find any working ready-made solutions. It looks like I hav

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Andreas
I know this is off topic, but does Synapse work on Android? I am planning on using FpcUpDeluxe to write an android app that has a TCP client, but am still looking for the TCP component. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Paul Breneman
On 06/18/2017 03:04 AM, Bo Berglund wrote: I need to implement a serial to TCP gateway in order to communicate between a Windows based control software and a system controller box. The software and the controller only talk serial to each other and the protocol is proprietary and binary. Now I hav

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Snorkl e
Synapse and fpc works great with serial port, I have a daemon I wrote 4 years ago that reads serial data from a phone PBX runs 24X7 and never an issue. On Jun 18, 2017 11:17 AM, "Bo Berglund" wrote: > On Sun, 18 Jun 2017 09:46:06 -0500, Snorkl e > wrote: > > >Couldn't you read the serial port d

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Koenraad Lelong
Op 18-06-17 om 18:16 schreef Bo Berglund: Hi, Do you know the SDPO-package ? That has a serial component (SDPOSerial). This has a OnRxData event. Just a thought. I used it in the past without problems. HTH Koenraad. ___ fpc-pascal maillist - f

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Bo Berglund
On Sun, 18 Jun 2017 09:46:06 -0500, Snorkl e wrote: >Couldn't you read the serial port data and then stream it with Synapse to >the remote location? >You can use Synapse to read the serial port data and sent via TCP/IP. > Probably, but I was hoping for some ready-made example to get going a bit

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Snorkl e
Couldn't you read the serial port data and then stream it with Synapse to the remote location? You can use Synapse to read the serial port data and sent via TCP/IP. On Jun 18, 2017 2:05 AM, "Bo Berglund" wrote: > I need to implement a serial to TCP gateway in order to communicate > between a W

[fpc-pascal] Serial to TCP gateway in FPC?

2017-06-18 Thread Bo Berglund
I need to implement a serial to TCP gateway in order to communicate between a Windows based control software and a system controller box. The software and the controller only talk serial to each other and the protocol is proprietary and binary. Now I have a situation where the controller is on a re