davepaul0 / DmxPy

Control USB-DMX Hardware through Python. Works with Raspberry Pi, supports Enttec DMX USB Pro
MIT License
32 stars 23 forks source link

Ported to python3 #1

Open CaptClaude opened 6 years ago

CaptClaude commented 6 years ago

I needed a simple DMX "library" and yours fit the bill. However, I needed it to work with python 3 because the code I want to use with it (Flask) is currently python 3 in all of my projects. So not knowing anything about anything I brute-forced it with Google and trial and error until it ran. It might not be pretty, but it works.

Interested? Nothing much has happened here in a while but I have seen your code floating around in use in other projects (OSC->DMX for instance). I don't know anything about pull requests or forking or anything. But you did the hard work first and I thought I'd give it back before I do something else with it.

CaptClaude commented 6 years ago

I do have it working but although I'm an engineer with 40+ years of making stuff happen, I'm a Python n00b and Python has a long, slow self-teaching learning curve. I'll compare what I did with what you did see if I can learn something. I could not make it work with a FTDI USB-RS485 dongle (that works fine for Modbus) so I bought a DMXKing ultraDMX Micro (which I am dying to disassemble) and it works great. The big difference seems to be that I moved to bytearrays and eliminated chr() completely. If I read some documentation correctly, Python 3 has (multibyte) unicode characters and I was getting errors that seemed to be related to that. Mostly I just Googled until it worked. I was planning a fork but I don't know how yet (n00b). Thanks!

random-dude commented 5 years ago

Hey ! Thanks for your work, it does indeed work a treat with the ENTTEC USB PRO. I've ported it to python3 and it has been thoroughly tested for 6+ hours by 12 attendants to an Arduino / Raspberry Pi workshop I conducted. So it does works quite well ^^ (note that it will not work with the uDMX based adapters such as the enttech open DMX or aliexpress cheapies which can be used with pyudmx) Thanks again !

python3 version : EDIT : code attached as a txt file to fix buggy code markdown DmxPy.py.txt

trevordavies095 commented 5 years ago

@random-dude Great work! Just a heads up though, you still have chr() on lines 20, 27 and 31.

I just opened a pull request #3 with the needed changes for Python 3.