-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to ESP32 on Arduino code base #1
Comments
I don't know if there is a standard IP stack on Arduino. If there is one, porting the code to this stack should be possible.
Else, it'll require a per-platform adaptation code, which is a lot less fun. |
Thanks for your time and feedback. I have been building a passion project over the past few years and have run into the absolute need for MQTT5.0 to run on my client side ESP32 devices which run on Arduino code base. I specialize in front and backend programming but my experience with embedded systems is extremely low, I've managed to get by learning C++ and using great libraries however I think what you speak of is beyond my current knowledge. If it is something you would be interested in doing and helping creating a library for please let me know, I think it can be extremely useful as microcontrollers like the ESP32 have received great widespread public adoption recently and many people are using the Arduino code base due to the vast resources. |
I've looked at the Arduino network status and they have decided to over simplify the TCP/IP stack to remove all notion of layers and sockets. Said differently, their implementation lacks the primitives required to build a compliant MQTT 5.0 client. So, it'll be very hard to port to generic Arduino. If however, we only need to target Espressif CPU (ESP8266 and ESP32), then they have exposed a way to disable NAGLE algorithm, and, if I understand correctly, they have written non blocking socket code, so it might work for the very usual, simple case of a client connecting a broker to get/send status & commands. I was wondering, did you try to build the code as-is on your Arduino IDE ? Because if you are using an ESP32, it's very likely that you can directly include "lwip" since it's the default IP code on ESP32. And in that case it'll work (follow the eMQTT5 repository's client for an example code or the test code in this repository). |
Thanks for the reply and time man, I am going to look into what you said and play around with it. Will share my results, hopefully positive ! haha |
Hey man, I appreciate your in depth explanation and have attempted to implement it but I have not succeeded. All the other parts of my system are exactly where they need to be, except the MQTT5 capability for my ESP32 devices that are running on Arduino code base. I do not have the resources to tackle this and would be happy to remunerate you for doing some private work on this and building a library which I and many others could benefit from. Let me know what you think, thanks |
Sorry for late answer, I completely missed this message. I'm not using Arduino framework for my projects, so I can't estimate the effort required to port this. I've looked at competing options like espMqttClient and they seem to use lwip as I said earlier, but with some Arduino's wrapper on it (see here). This project is a MQTT v3.1.1 client. I'm sorry but I don't have enough time to complete an Arduino port (and I probably don't have a hardware that's compatible with Arduino's boards). I don't like Arduino's IDE mainly because they lack a debugger and the build system is hidden, so it make developing stuff very hard. I don't think it would make sense to build a hacky ESP32-only Arduino port that's using esp-idf underneath because that's how arduino is built on ESP32. Maybe you could try to port your code to PlatformIO using Arduino-ESP32 component (so your Arduino code is building just fine on ESP32), since it's running on esp-idf underneath where you can include this library. I've found this post that's explaining quite well the implication of this. I can probably support you for any question and you can document how you did it so all the users will profit from this. |
Arduino code base is really lacking any form of MQTT5.0 client libraries, I think this could extremely useful not just to me but too many other people running this software on a host of the latest boards.
The text was updated successfully, but these errors were encountered: