Parallel Port Access with Free Pascal - windows

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows - PiGpio.zip (1/1)

Bo Berglund

begin 644 PiGpio.zip
M4$L#!!0``@`(`#Q/F4CB2,%-K@L``",F```*````4&E'<&EO+G!A<\U9_U/B
MR!+_>?DK^JJL.CA920*Z*K=7AP(N=2H4X%GU?C@JD(GF;4A22=!UM_9_?Y^>
M228!T=-7WKY'N9#T]/27S_3T]/2N`B^ED7<6>6&[\JU")Z<7UF%SG\Y&@R&-
MQ8V7I/$#=6/O3L1ULOTDI(4=T"H1E(:TM`,O6OEV*F@1K2A,;T5,<3[+CH6=
M5"HTO?426H2.(/RF(DF%0V'@/]!)'-K.(ES2?+&46B&D3H[GNB(600H!2R8E
MT/-`@<`T/5:A&YA,CC2,O&7DBR7(=NJ%`51:AMFD,WL>QC3Y&OI^F'B*NO_>
M-/!')R&=B/C&7P7.<87>4\=Q6+QPO4#0>.19Y&(N_('>>SH=72E$X+=#7J`X
M[,`A]CV&-TQI2@T'[XW6>VO_.0T>6YEH#5+RH#%D,;?"=B`P\C!N'>WMM0RJ
M@HP?D/)1:84;`SAH-4]V:17=V[&3U"K?*]]VEHQT./^W&RV^?]OYM/N]4O$"
M6.G:"U&I-!I8#P'=`.7>"VXHC-@:K$^0QJ&?T/VMD,O(EN6+QCQ+[RMKA<UC
M.XGF(L8*CP9D[;%(Y5P)W_E#&8"2NGLQ)]NY\Q8R@&Y$2@C`^S#^+&T)I%H&
M]Q8.P2D!A[J]_N"R)S&'+W`^J1"=^G:"ISI-'I*KU/.3=J4"'Q)$!HU[9S,)
MZD?ZMC/H8[Z:3#O-OF$8(/;.)SV\6D;V>MD=]+^W&XTL$+/?`Q5D*J`!B?&%
M)Q!/VI-QX487=L3+D5!DWP!UUTU$6H<?0A&`7<LX.I@_I-)H('4KOD".R7*P
MEQ*.W`=L*7^AME%)!35R1OB1TR%DU#GKS2:#?_5`9N%M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UTH[8;W,.HJJCR3S+5A?Z_^N?7+Q&R$
ML,QDSZG6*7A#A$$_<!W_OI5]7VY5;KD9,9$O>_E5*E_8)TKM0Y3:X.4I^4$@
M_[=05]M-5-NZ%B_8S'4V&?WBBY?J8^)%QQ(6,5*-H=)II+SEK:?J[I-^7]YA
M9>6PT'>??VI1(':O4OD/4$L!`A0`%``"``@`/$^92.)(P4VN"P``(R8```H`
M)````````0`@`````````%!I1W!I;RYP87,*`"````````$`&```VCLMR)[1
G`0#:.RW(GM$!T(SN6EJDT0%02P4&``````$``0!<````U@L`````
`
end

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Koenraad Lelong-4
In reply to this post by Zaaphod
Op 24-07-16 om 16:29 schreef James Richters:

> Bo,
> I also have a raspberry pi project..  I got a hifi-berry card for it and it
> is streaming audio to a central audio system, I'm using VLC media player and
> an app on my cell phone to control it,  I have not made use of the GPIO on
> them yet, but I would really like to learn how this can be accomplished with
> FPC, since I am more familiar with pascal than any other language, it would
> be great to learn how to do this!  I have a particular application in mind.
> I have a relay board that will turn relays on and off with TTL level
> signals, what I wish to do is have a remote way to turn certain amplifiers
> on and off.   There are 24 amplifiers going to 44 speakers (4 are
> subwoffers) in and around my house, sometimes I'll want just downstairs and
> outside amps on, other times I'll want just one room on, or all amps on....
> etc.    The amps are all in my crawlspace under the first floor, and that's
> where the raspberry pi is.  I also have some volume control chips that are
> controlled by clocking data into them, I could chain them all together and
> be able to control all of them with just one clock and one data bit.
> Any advice on how to get started on controlling GPIO with a raspberry pi
> with FPC would be greatly appreciated!
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Bo Berglund
> Sent: Sunday, July 24, 2016 2:22 AM
> To: [hidden email]
> Subject: Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows
>
> On Fri, 22 Jul 2016 14:19:20 +0000, Mark Morgan Lloyd
> <[hidden email]> wrote:
>
>> Or go the whole hog and
>> port the program onto a Raspberry Pi: Bo's doing something like you're
>> asking.
>
> Yes, indeed! I now have something like 7-8 operational RPi units for
> different purposes and in several places I have used the GPIO pins to
> control and read back digital stuff from FPC programs. Very convenient.
>
> Last I did was to attach a 4-way relay board to a RPi and put a smapp FPC
> command line program on it, which gets called from a PHP script on the
> Apache webserver on the Pi.
> Now I have a webpage, with which I can switch on/off the relays with in
> order to control the operational state of some measuring equipment sitting
> half way across the workd!
>
> You could do a LOT with FPC and a Raspberry Pi!
>
> Examples:
> The Pi also runs an OpenVPN server so I can access it with PuTTY and/or
> TightVNC to program it if I need to.
>
> My Pi also has a port mapping utility which makes it possible for me to
> remotely access a WiFi network device on a WiFi access point close to the
> RPi again from a long distance away. THis was created with FPC and Indy10 on
> the RPi.

While Bo's contribution is valid, I have the impression that the
raspberry is going to the pigpiod. Newer raspbian images have a switch
(in raspi-config/advanced options) to enable a gpio-server. Using that
it is possible to access all gpio-functions (gpio, serial, spi, pwm,
...) as a normal user. See http://abyz.co.uk/rpi/pigpio/index.html.
There is a snag : the communication with the server happens via the
network, so it could be that your pi will be hijacked, unless you take
precautions.

FWIW, I ported the library to fpc, together with the test/demo software
(x_pigpiod_if2).
The fact that the communication goes via the network opens possibilities
though. I tested my port on my laptop, connected to the pi. So
applications running on a remote PC could control the pi's IO.

I have no public place to publish this software, so if anyone is
interested, please ask.

Koenraad.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Bo Berglund
On Tue, 26 Jul 2016 11:45:51 +0200, Koenraad Lelong
<[hidden email]> wrote:

>FWIW, I ported the library to fpc, together with the test/demo software
>(x_pigpiod_if2).
>The fact that the communication goes via the network opens possibilities
>though. I tested my port on my laptop, connected to the pi. So
>applications running on a remote PC could control the pi's IO.
>
>I have no public place to publish this software, so if anyone is
>interested, please ask.
>

I would be interested and I could put it up on my webserver if you
like a public spot.


--
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

ezrashumla
yes thank you



-----Original Message-----
From: Bo Berglund <[hidden email]>
To: fpc-pascal <[hidden email]>
Sent: Tue, Jul 26, 2016 10:49 pm
Subject: Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

On Tue, 26 Jul 2016 11:45:51 +0200, Koenraad Lelong
<[hidden email]> wrote:

>FWIW, I ported the library to fpc, together with the test/demo software
>(x_pigpiod_if2).
>The fact that the communication goes via the network opens possibilities
>though. I tested my port on my laptop, connected to the pi. So
>applications running on a remote PC could control the pi's IO.
>
>I have no public place to publish this software, so if anyone is
>interested, please ask.
>

I would be interested and I could put it up on my webserver if you
like a public spot.


--
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist - fpc-[hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Bo Berglund
On Tue, 26 Jul 2016 16:23:12 -0400,
[hidden email] wrote:

>yes thank you

You responded to the wrong post...



--
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

ezrashumla
i think it is the ight place i also like to rcv the software  for directly controling i/o ports for fpc on wimdows
Thank you
Ezra



-----Original Message-----
From: Bo Berglund <[hidden email]>
To: fpc-pascal <[hidden email]>
Sent: Wed, Jul 27, 2016 1:56 am
Subject: Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

On Tue, 26 Jul 2016 16:23:12 -0400,
[hidden email] wrote:

>yes thank you

You responded to the wrong post...



--
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist - fpc-[hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Zaaphod

>i think it is the ight place i also like to rcv the software  for directly controling i/o ports for fpc on wimdows
>Thank you
>Ezra

 

Ezra,

here’s the link to the FPC files.   https://github.com/Zaaphod/FPC-Parallel-Port 

The InpOut32 driver is here: http://www.highrez.co.uk/downloads/inpout32/

I am able to control the parallel port directly under Windows 7 Professional on this motherboard https://www.amazon.com/gp/product/B00IW99S4A It has on board parallel port on a header. 

 

James


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Zaaphod
In reply to this post by Bo Berglund
>>FWIW, I ported the library to fpc, together with the test/demo software
>>(x_pigpiod_if2).
>>The fact that the communication goes via the network opens
>>possibilities though. I tested my port on my laptop, connected to the
>>pi. So applications running on a remote PC could control the pi's IO.
>>
>>I have no public place to publish this software, so if anyone is
>>interested, please ask.
>>
>
>I would be interested and I could put it up on my webserver if you like a
public spot.
>

I would also be interest in this

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Bo Berglund
In reply to this post by Bo Berglund
On Tue, 26 Jul 2016 21:48:55 +0200, Bo Berglund
<[hidden email]> wrote:

>On Tue, 26 Jul 2016 11:45:51 +0200, Koenraad Lelong
><[hidden email]> wrote:
>
>>FWIW, I ported the library to fpc, together with the test/demo software
>>(x_pigpiod_if2).
>>The fact that the communication goes via the network opens possibilities
>>though. I tested my port on my laptop, connected to the pi. So
>>applications running on a remote PC could control the pi's IO.
>>
>>I have no public place to publish this software, so if anyone is
>>interested, please ask.
>>
>
>I would be interested and I could put it up on my webserver if you
>like a public spot.

I have received the code now but the project contained in the zip does
not build on my RPi3 with Raspbian and Lazarus 1.6 FPC 3.0.

I get the following error message:

Compile Project, Target: x_pigpiod_if2: Exit code 256, Errors: 1
/usr/bin/ld: warning: link.res contains output sections; did you
forget -T?
/usr/bin/ld: cannot find -lpigpiod_if2
x_pigpiod_if2.lpr(21,0) Error: Error while linking

The file it complains about is pigpiod_if2 and is not contained in the
zipfile. But there is a pigpiod_if2.pas file that seems to define a
lot of functions contained in a file with this name...
I do not know if it is an external binary library, which must be
supplied or where it resides.

--
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Parallel Port Access with Free Pascal - windows

Zaaphod
In reply to this post by Zaaphod

I have updated my unit for accessing parallel ports on Windows with Freepascal to now select the correct .dll  file depending on how the program is compiled.

It now uses

 inpout32.dll if you compile for Win32

inpoutx64.dll if you compile for Win64

I also added a new sample program that can be compiled for Win32 or Win64 which also demonstrates some of the other procedures and functions available.

 

Here are links:

here’s the link to the FPC sample files.   https://github.com/Zaaphod/FPC-Parallel-Port 

The InpOut32 and InpOutx64 drivers are here: http://www.highrez.co.uk/downloads/inpout32/

 

James


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
12