Hi.
I successfully installed FPC 2.6.0, Lazarus 0.9.30.4-1.1 and Indy 10 (the current development snapshot) on a raspberry pi updated and upgraded, a model B with 512MB ram, the only tweak needed was to reduce the GPU memory to 32MB using the memory_split option in raspi-config (I can post my notes on this if anyone is interested).
Anyway, the problem I have is binding to a server socket - in my case, I want to use a HTTP server, Indy's TIdHttpServer, ultimately to act as an X10 controller. The problem is that when a minimal program using TIdHttpServer tries to bind to port 80, I get "Socket Error #13: Access denied", followed by "Could not bind socket. Address and port are already in use", but I could not find anything already bound to port 80.
There are a couple of documented issues on Indy server problems (in
http://wiki.lazarus.freepascal.org/Indy_with_Lazarus) in a non-Pi environment, which arose with me on an identical setup (with the same code) on a desktop (Centos 6.3 with the latest stable FPC and Lazarus) but applying the fixes on a Pi does not resolve the problem (on the Centos, I also opened port 80 on its firewall and ran Lazarus as root). The fixes I applied are:
(1) Lazarus Main menu -> Project -> Compiler Options -> Other Page , add the "-dUseCThreads" parameter.
(2) Force the IdTCPServer to work in Id_IPV4 mode.
procedure TForm1.FormActivate(Sender: TObject);
var
Binding: TIdSocketHandle;
begin
//uses idGlobal
//explicitally adding a Binding object prevents TIdTCPServer
//from creating its own default IPv4 and IPv6 Binding objects
//on the same listening IP/Port pair...
Binding := IdTCPServer1.Bindings.Add;
Binding.IPVersion := Id_IPv4; //optional: forces the Binding to work in Id_IPV4 mode.
Binding.IP := '127.0.0.1';
Binding.Port := 6501; //customization
IdTCPServer1.Active := True;
end;
I don't know where to go next. I don't think the Raspberry Pi has a firewall, and am not aware of a restriction on non-root users (the "Pi" user) not being able to open a server socket, but I may well be wrong. It may be an issue specific to Raspberry Pi, but I thought I should ask here first. Does anyone have any ideas?
Thanks,
Ciaran