Skip to content
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

MQTT/XToys integration #56

Open
RupertB-ES opened this issue Aug 17, 2023 · 5 comments
Open

MQTT/XToys integration #56

RupertB-ES opened this issue Aug 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@RupertB-ES
Copy link

I believe there is a LUA implementation of MQTT -any plans on this or other routes to integrate with XToys?

@CrashOverride85 CrashOverride85 added the enhancement New feature or request label Aug 17, 2023
@CrashOverride85
Copy link
Owner

XToys isn't something I've used before, so not quite sure how it works, and how to go about integrating yet.
The Pico-W uses LwIP for IP connectivity, and that does come with an MQTT client, so for MQTT, it's probably going to involve that rather than Lua

@RupertB-ES
Copy link
Author

This is what caught my eye https://github.com/xHasKx/luamqtt

@CrashOverride85
Copy link
Owner

I think the problem's going to be that it depends on luasocket, which depends on a BSD-style sockets API, which LwIP used by the Pico SDK doesn't really provide. Plus I think trying to run Lua scripts of that size/complexity just isn't going to work well (if at all).
I think the way to get mqtt support in Lua would be to add a wrapper around the LwIP MQTT client to expose it in the Lua environment.

Also I need to have a think about how it would work when running Lua script locally, as at present, the box will only connect to WiFi when in remote access mode.

@RupertB-ES
Copy link
Author

I guess there are 2 routes - initially could the LUA client just handshake with a python app and let python do the work but in the longer term having the LUA client "phone home" and start the wifi in code would be the better way performance headroom permitting.

@CrashOverride85
Copy link
Owner

Yeah, doing something via the python app might be an option too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants