Git Product home page Git Product logo

delphi-mqtt's Introduction

delphi-mqtt

MQTT server and client components for Delphi

delphi-mqtt's People

Contributors

pjde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delphi-mqtt's Issues

Cannot connect to a local mosquitto broker

A duplicate I know.
Love you client/server. Works like a charm.
I now have a need to connect to a mosquitto broker running in a Linux server.
I cannot connect.
Ant thoughts.
Tom Duncan
Tassie, Australia

cannot intall

requires
rtl,
vcl,
OverbyteIcsD102Run;

contains
uMQTTComps in 'uMQTTComps.pas',
uMQTT in 'uMQTT.pas';

end.

i change to above can bulid success,but when i intall it was erro
image

Android

Hello, is there a way to run this component on android? Thanks.

Cannot open in Delphi 2007

When opening either the .dpk or the dproj file in D2007 I get:

unable to load project
...MQTTComponents.dproj
Only one top level element is allowed in an XML
Document.

Line: 2
<Delphi.personality><Source Nam

Googled a bit:

  • I should delete the dproj and use the dpr instead. However: the dpr is not included in the archive.

Ability to run in Lazarus?

Is this only viable in a Delphi environment, or would it be possible to port to Lazarus? Curious to know what kind of testing and interop has been done with other MQTT clients, too.

Cann't connect to mosquitto broker

Hi,

The delphi-mqtt demo (server2.exe) as a MQTT client,
Connect to mosquitto version 2.0.14,
mosquitto report:

1641645330: New connection from 127.0.0.1:50897 on port 1883.
1641645330: Client <unknown> disconnected due to malformed packet.

Value of parameter aClean not used

The value of the passed aClean parameter is not used .... Instead the class property Clean is used in these methods of TMQTTParser?

procedure SendBrokerConnect (aClientID, aUsername, aPassword : UTF8String; aKeepAlive : Word; aClean : Boolean);

procedure SendConnect (aClientID, aUsername, aPassword : UTF8String; aKeepAlive : Word; aClean : boolean);

SSL Support

Hi!
Are there any plans to support SSL?

As far as I see (correctly, but this solution worked for me so far) public object "Link" in uMQTTComponents has to be "TSSLWSocket" and the constructor has to be modified to create an SSLContext object.

(of cource, this solution has to be a little bit prettier to match the bpl idea)

greetings,
hauke

IP Public

É Possível conectar o servidor com IP Public?

{ TMQTTServer }

procedure TMQTTServer.Activate (Enable: boolean);
var
i : integer;
begin
if FEnable = Enable then exit;
if (Enable) then
begin
Server.Banner := '';
Server.Addr := '0.0.0.0'; // IP Public? ***************************************
Server.Port := IntToStr (FPort);
Server.Proto := 'tcp';
Server.ClientClass := TClient;
try
Server.Listen;
FEnable := true;
except
FEnable := false;
end;
if FEnable then SetTimer (Timers, 3, 100, nil);
end
else
begin
FEnable := false;
for i := 0 to Server.ClientCount - 1 do
try
TClient (Server.Client[i]).Close;
except
end;
try
Server.Close;
except
end;
KillTimer (Timers, 1);
KillTimer (Timers, 2);
KillTimer (Timers, 3);
end;
if Assigned (FOnEnableChange) then
FOnEnableChange (Self);
end;

Unsubscribe ACK only uses 1 byte for identifying messages

Row 584 and 585 in uMQTT.pas:

ReadByte (FRxStream);
id := ReadByte (FRxStream);

Should be replaced by:
id := ReadByte (FRxStream) * $100 + ReadByte (FRxStream);

otherwise Message ID (anID) will have 1 byte masked off when Message ID surpass 256.

Willretain flag has wrong bit position

The bit position of the "WillRetain" flag is according to MQTT v3.1.1: CONNECT message: Variable Header - Byte 8: Connect Flags
Bit 7: User Name Flag ($80)
Bit 6: Password Flag ($40)
Bit 5: Will Retain Flag ($20)
Bits 4-3: Will QoS ($18)
Bit 2: Will Flag ($04)
Bit 1: Clean Session ($02)
Bit 0: 0 (Reserved) ($01)

So the bit position of the "WillRetain" flag must be corrected to $20 in:
-> procedure TMQTTParser.SendConnect(aClientID, aUsername, aPassword : UTF8String;
if WillRetain then
x := x or $20;
-> procedure TMQTTParser.Parse(aStream: TStream);
wr := (fl and $20) > 0; // will retain
-> procedure TMQTTParser.SendBrokerConnect(aClientID, aUsername,
if WillRetain then
x := x or $20;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.