Recent

Author Topic: problems of using the fp IDE on Raspbian with putty  (Read 1664 times)

Niklo

  • New member
  • *
  • Posts: 7
problems of using the fp IDE on Raspbian with putty
« on: January 26, 2020, 03:18:02 am »
Hello,
I recently installed free pascal on my Raspberry PI. The installation succeeded and I can start the free pascal IDE fp. As I have a windows laptop I use putty to login with ssh. Unfortunately I have severe problems to use the IDE in putty. I cannot use the mouse to select a menu and using the key combinations like alt e does not work, too.

The version I try is:
* Free Pascal IDE Version 1.0.12 [2019/02/04]
* Compiler Version 3.0.4+dfsg-22+rpi1
* GDB Version GNU gdb (Raspbian 8.2.1-2) 8.2.1
Free Pascal Compiler version 3.0.4+dfsg-22+rpi1 [2019/02/04] for arm

cat /etc/issue.net
Raspbian GNU/Linux 10
=> buster
uname -a
Linux wega 4.19.93-v7+ #1290 SMP Fri Jan 10 16:39:50 GMT 2020 armv7l GNU/Linux

In general the mouse works in putty. The midnight commander mc has not problems to be used with mouse in putty but I don't know how to get fp working in putty.
What is needed to run fp in putty?
Is there any experience with putty or any advice what I can try to get the key combinations working?
Kind regards,
  Roland

bee

  • Sr. Member
  • ****
  • Posts: 392
Re: problems of using the fp IDE on Raspbian with putty
« Reply #1 on: January 26, 2020, 05:21:38 am »
Why do you need to open the FP's console IDE on the Raspi? Why don't you just using a local editor that open a file then compile it on the raspi through ssh?

I'm usually using VS Code as the local editor for such case. Using VS Code (or any local editors such as Sublime or Notepad++) is much comfortable and faster rather than using FP's console IDE remotely. VS Code has official Remote Development extension that specifically used for such purpose. But I don't know whether it will work with raspi as the remote machine (architecture issue).

At least, you can open terminal, connect to your remote machine, and compile it from there. Don't forget when you save the file, set to automatically upload to the remote machine (there's a vs code extension for that as well).
-Bee-

A long time pascal lover.

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #2 on: January 26, 2020, 08:11:59 am »
Hello Bee,
thank you for your answer. You're absolutely right. I can use a normal editor like vi and compile and debug it later. I often use vi for programming in C/C++.
I want to use the fp ide because I used turbo pascal 30 years ago and the fp reminds me on it. So it's rather a nostalgic reason and I hoped that there is an easy posibility as other programms like the mc has no problems to use the ncurses user interface. So yes, I can already program with vi but if anybody has a clue how to get the fp running using the alt key combination and the mouse it would be great. :)
Kind regards,
  Roland

MarkMLl

  • Hero Member
  • *****
  • Posts: 623
Re: problems of using the fp IDE on Raspbian with putty
« Reply #3 on: January 26, 2020, 10:15:51 am »
I've just checked and I'm certainly able to use fp (i.e. the FPC IDE) remotely if the SSH client is running on a Linux (Debian Buster x86_64) system, including mouse and <Alt>e.

I'm not able to test it from a Windows client. Historically on Windows I've used Teraterm but I really can't remember whether I've tried to run fp over it, and in any case I believe that Putty is more actively maintained.

I don't know what is available in the context of fp or- in the more general case- an SSH server to monitor exactly what traffic (i.e. including mouse events) is being passed over the connection.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

devEric69

  • Full Member
  • ***
  • Posts: 247
Re: problems of using the fp IDE on Raspbian with putty
« Reply #4 on: January 26, 2020, 11:12:58 am »
In general the mouse works in putty. The midnight commander mc has not problems to be used with mouse in putty [snip]

You probably need, however, to install a program \ device \deamon, that drives the mouse for the Linux text terminal, on Raspbian. Eg with Ubuntu server, it should be like this: "out of the box", the mouse (a white rectangle that moves) doesn't work, even after having installed Midnight Commander (which indeed, is a like " semi-graphical desktop environment ").
use: Linux 64 bits (Ubuntu 18.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #5 on: January 26, 2020, 11:35:13 am »
Hello Mark,
thank you for your answer. I will try out later to boot my laptop with linux. Currently I played with the putty settings and for strange reasons the alt key combinations works now. Currently only the left mouse click is not accepted. I guess there is a putty setting that prevents the use of the left mouse key in fp.
Kind regards,
  Roland

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #6 on: January 26, 2020, 11:39:38 am »
Hi Eric,
thank you for your answer, too. You're right. Logging directly into the Raspberry PI console a mouse daemon is needed. For using ssh it works without a mouse daemon and so I can already select text in fp for copy text or using mc to select menu items.
For a strange reason the left mouse key is not working on fp with putty. I will later boot my laptop with Linux and will try it out, there. Probably there everything works fine but what needs to be changed in putty to get things working?
Kind regards,
  Roland

devEric69

  • Full Member
  • ***
  • Posts: 247
Re: problems of using the fp IDE on Raspbian with putty
« Reply #7 on: January 26, 2020, 12:02:27 pm »
Hello,

In putty, there is the X11 option. But it uses another graphical layer, afaik (anyway, if it works with that option, don't ask me why :-\ ).
use: Linux 64 bits (Ubuntu 18.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #8 on: January 26, 2020, 09:35:44 pm »
Hi,
now I booted my Laptop into Mint Linux and connected to my Raspberry PI with ssh. Now the mouse works fine. Unfortunately now I get the next problem. I can compile the code with fpc but in fp I get and error message: "Fatal: Can't find unit System used by Schwingkreis". See attachment.
On the command line it works but shows a warning:

roland@wega:~ $ fpc schwingkreis.pas
Free Pascal Compiler version 3.0.4+dfsg-22+rpi1 [2019/02/04] for arm
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for ARMHF
Compiling schwingkreis.pas
Assembling schwingkreis
Linking schwingkreis
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
24 lines compiled, 0.7 sec

What needs to be done to get rid of this warning during linking?
What needs to be done to be able to compile in fp ide?

Kind regards,
  Roland
« Last Edit: January 26, 2020, 09:43:52 pm by Niklo »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7928
Re: problems of using the fp IDE on Raspbian with putty
« Reply #9 on: January 26, 2020, 09:57:02 pm »
Somehow your distro didn't configure the IDE properly. The IDE has a compiler internally so it has a complete own configuration.

So configure the "units" path in the configuration (akin to the -Fu compiler parameter) and it will be fine. :)

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #10 on: January 26, 2020, 11:00:24 pm »
Hello Marcov,
thank you for your answer. Currently I don't know where exactly I should enter the path to the units.
Should I enter it in the IDE in Options->Directories and there in Unit directories?
/usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/
At least there is a directory /usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/
with a52, cdrom, fastcgi ... xforms.
Nevertheless adding this directory path to fp => Options => Directories and there to the Unit directory didn't help.

Kind regards,
  Roland

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7928
Re: problems of using the fp IDE on Raspbian with putty
« Reply #11 on: January 26, 2020, 11:30:40 pm »
Should I enter it in the IDE in Options->Directories and there in Unit directories?

yes
/usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/
[/quite]

The arm-linux prefixing is not standard FPC, so maybe something from your distribution. Append a * at the end, so that it ends in  "/*". This makes the compiler recurse.

Niklo

  • New member
  • *
  • Posts: 7
Re: problems of using the fp IDE on Raspbian with putty
« Reply #12 on: January 27, 2020, 07:33:31 am »
Hello Marcov,
thank you very much. Now it works to write and build my test pascal program in the fp ide on my raspberry PI.
Here the lines I put into Options => Directories => Units:
/usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/
 /usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/*
 /usr/lib/arm-linux-gnueabihf/fpc/3.0.4/units/arm-linux/rtl
I add two screenshots:

Best regards,
  Roland
« Last Edit: January 27, 2020, 07:40:26 am by Niklo »

PascalDragon

  • Hero Member
  • *****
  • Posts: 963
  • Compiler Developer
Re: problems of using the fp IDE on Raspbian with putty
« Reply #13 on: January 27, 2020, 09:05:46 am »
now I booted my Laptop into Mint Linux and connected to my Raspberry PI with ssh. Now the mouse works fine.

Note: for Putty you might need to adjust the console emulation in the Terminal options (e.g. Terminal -> Keyboard -> The Funktion keys and keypad). You might need to play around with it a bit...

Hartmut

  • Sr. Member
  • ****
  • Posts: 360
Re: problems of using the fp IDE on Raspbian with putty
« Reply #14 on: January 27, 2020, 12:36:50 pm »
Free Pascal Compiler version 3.0.4+dfsg-22+rpi1 [2019/02/04] for arm
...
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
...
What needs to be done to get rid of this warning during linking?

There is nothing you can do. It shall be fixed in FPC 3.1.1 and later.
See https://www.freepascal.org/faq.var#unix-ld219