dmroeder / pylogix

Read/Write data from Allen Bradley Compact/Control Logix PLC's
Apache License 2.0
599 stars 182 forks source link

ESP32 micropython support #145

Closed ivancho523 closed 4 years ago

ivancho523 commented 4 years ago

Hello How can I use this library with an ESP32, what changes should I make to be able to use it in a microcontroller? is it possible to use it with micropython?

TheFern2 commented 4 years ago

Hi, we don't explicitly support micropython. I am not even sure if micropython has all the core modules that pylogix needs like socket, etc.

Also you need ethernet for pylogix to communicate with the plc, wireless communication won't do.

By all means let us know if you do get it working. I just gave micropython a quick read and it does come with some core modules but prefixed with a u see below. So you will have to change those modules like socket to usocket if there's a module needed and not on micropython you'll have to learn how to compile and optimize that module for micropython.

http://docs.micropython.org/en/latest/library/index.html

Best thing I can say is just to buy a linux based microcontroller that has raspbian like raspberry pi or zero or something alike there are several clones. This way you save a lot of time and frustration.

Edit: It looks like all modules needed are in micropython just look at all the pylogix files imports and prefix the ones needed to u. I think math is the only one that doesn't need to change.

As always all of this will be experimental, I don't think we've had any other member using a similar microcontroller.

TheFern2 commented 4 years ago

Closing ticket, if you need any further assistance let us know.

TheFern2 commented 1 year ago

@ivancho523 probably 3 years too late but nevertheless better late than never. We officially support micropython 1.20+. Check out the documentation for more information.