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

ESP32 support #7

Open
yanoom opened this issue May 29, 2019 · 8 comments
Open

ESP32 support #7

yanoom opened this issue May 29, 2019 · 8 comments

Comments

@yanoom
Copy link

yanoom commented May 29, 2019

Hi,
I'm looking for a socket.io client for ESP32.

How complicated would it be to adapt this project to ESP32? (estimations regarding what's there to do...)

=)
thanks

@danni
Copy link
Owner

danni commented May 30, 2019

I don't actually know what the difference is between ESP32 and ESP8266. I haven't done much work in micropython lately. In general this entire codebase could probably do with updating to be consistent with the most recent versions of micropython, in terms of using asyncio, etc.

@carterw
Copy link

carterw commented May 30, 2019

There isn't any difference between the Python API for networking on the ESP32 and the ESP8266 far as I can tell.

socket.io, on the other hand, is a layer of protocol that sits on top of websockets and it requires code on both the client and the server side. In principle someone who knows what they are doing could get a Python socket.io client running over this websocket implementation on an ESP32.

@yanoom
Copy link
Author

yanoom commented May 30, 2019

Thanks for your answers!

@carterw - I will try to use this socket.on on websockets for ESP8266 on my ESP32...

Do you have recommendation for the easiest way to start a testing-server, to test my client?
So far I'm going with this:
Python socket.io wsgi server

=)

@danni
Copy link
Owner

danni commented May 30, 2019

Thanks Carter. I did write a socket.io implementations years ago. Tested against Python and the node reference implementation.

Again the code is nearly 2 years old and I haven’t been keeping it up to date, so I don’t know how well it works against latest uPython. Send PRs :)

@carterw
Copy link

carterw commented May 31, 2019

I use node.js for everything on the server side (JavaScript on the server). I did successfully experiment with this socket.io package, it includes a JavaScript client that you can pull in to a browser app. It works. They communicate and you can send messages back and forth between browser app and server that trigger events on both sides.

If it were me, and seeing as how I have a working example on both ends, I would look at the JavaScript client code and try to port it to MicroPython as a first attempt. If you are seeing a good socket.io Python client that works with a server implementation and you can make it run, that might be a better place to start.

@carterw
Copy link

carterw commented May 31, 2019

Thanks Carter. I did write a socket.io implementations years ago. Tested against Python and the node reference implementation.

Sounds very useful. The ESP32 devices don't have a lot of memory and I have found that it is hard to cram network infrastructure in there and still have enough room to run significant application code. I have some event-driven client code that runs on a modified version of your repository here and had to be careful to make it all fit.

@step21
Copy link

step21 commented Jul 24, 2019

Thanks Carter. I did write a socket.io implementations years ago. Tested against Python and the node reference implementation.

Sounds very useful. The ESP32 devices don't have a lot of memory and I have found that it is hard to cram network infrastructure in there and still have enough room to run significant application code. I have some event-driven client code that runs on a modified version of your repository here and had to be careful to make it all fit.

You could try to get one of those modules with extra PSRAM. On the other hand if you are doing everything with javascript, I heard there was now embedded js for esp too.

@carterw
Copy link

carterw commented Jul 24, 2019

There are modules available with more memory for sure, but I am resisting moving to them because they are larger and more expensive. What I do now is make pared-down custom firmware for specific application use cases rather than attempt to have a large general-purpose image.

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

No branches or pull requests

4 participants