Hi everyone
I've been trying to get it to work for days a mqtt broker on an esp8266 with #if C code and calling it with RunNative in B4R.
If I program the esp8266 with Arduino code everything works. I tried three different brokers with C code for arduino in B4R
I also created a b4r library b4xlib which I included both the connection station and the broker.
But after programming with B4R it doesn't work.
Log client B4J
B4X:
(ConnectException) java.net.ConnectException: Connection timed out: no further information
What I don't understand is why if I program it with arduino everything works,
while with B4R with arduino code in C and RunNative it doesn't work.
p.s. (I know I should be using Raspberry for this)
Yes, it works!!
Thank you very much @candide for your interest and help.
I tried the 2 B4R projects, (test_rsMQTTBroker_basic) it works, now the client connects.
I have to do more tests to send the commands, but it's already something great that you made it work thank you very much.
The other project (test_rsMQTTBroker) connects to the router and then the esp8266 goes into error and restarts.
p.s. I had already tried this library but with RunNative and it didn't work.
thanks
after more tests done, this is the new version with some fix, i had issues with "std::string" strings.
now we have only one callback in case of connection lost, to make an action to recover the link and all others events are now only traces .
you can add or remove traces.
i tested transfer of message, it is working with simple topic ( i don't know if we have a limitation on the number of chars or on special chars)
Hi @candide
Incredible!
it works perfectly, now on the broker's log I see the clients connecting and sending data.
I use it to send short home automation messages (not chats)
Thank you very much for the effort to make a library.
p.s. I don't see the donation button on your profile
now we have only one callback in case of connection lost, to make an action to recover the link and all others events are now only traces .
you can add or remove traces.
hi candide,
I would like to ask you how do I add the event in B4R
B4X:
Sub OnPublish(ClientID As ULong, Topic() As Byte, Payload() As Byte)
Log("New Publish, ClientID: ",ClientID," Topic: ",Topic, " Payload: ", Payload)
End Sub
or replace it instead of OnLostConnection
I would like to make the esp8266 do some operations when a command arrives, as well as send a msg to the client
Thank you