MQTT server and client components for Delphi
pjde / delphi-mqtt Goto Github PK
View Code? Open in Web Editor NEWMQTT server and client components for Delphi
MQTT server and client components for Delphi
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
Hello, is there a way to run this component on android? Thanks.
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>
Googled a bit:
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.
With the latest release of ICS 9.0 these components have been merged as TIcsMQTTServer and TIcsMQTTClient.
i tried to compile and use it with XE10, but everytime i subscribe.. all incoming message was truncated first 2 char. Can you help me please?
thank you
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.
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);
Don't know why this module only cannot connect to broker.shiftr.io.
host : broker.shiftr.io
user : try
pass : try
please help.
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
Looks good!
How about publishing TBytes?
And for long stretches (days) of no connection - how about a disk buffer?
Thanks
-alfa
É 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;
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.
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;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.