Python GUI send/receive USB raw data

+1 Roger Pettersson · November 26, 2014
Hi guys,

i was wondering if it is possible to send/receive data from the USB ? (eg. COM# ports) And if so, is it hard to implement it with the Python GUI ?

At the moment i am interfacing with the hyperterminal in order to talk to my microchip... so i want to step it up a bit, and get my own GUI to present data, and even make it easier interfacing with it.

Please let me know if it is possible.

// Roger

Post a Reply


Oldest  Newest  Rating
0 Roger Pettersson · November 26, 2014
Thank you, very nice indeed !

But, im very green on Python. I mean, i have just watched Python GUI intro series, which was very handy. So i will follow up on looking at the introductions videos here in this site for Python.

But, if i may ask. Have you tested the pyUSB out ? And do you find it easy going ?

Im just wondering, because i need to settle for some software to build the GUI, and time is of the essence, as always. Python sure seems like a nice way to go.
-1 Roger Pettersson · November 28, 2014
I have been looking at the introduction series for python and pycharm here on the site, all good and nice.

Now, the problem im struggling with is now, is the install process. I mean, im getting it up and running and all that. But i fail to download a lot of different modules, and that includes PyUSB. Even though i found an .exe files with PyUSB, the examples included wants me to install other types of modules and so forth. And the included autoinstall process in PyCharm works like on only 50% of the modules, and only on certain versions of Python, which i have 2 of. 

Having struggled a while and install various of modules and google for a couple of hours... i finally try some examples of the PyUSB out. And im only able to find any usefull of 1 out of 6 of the examples. I reads and gets my attached PCBs name, IDs and all that. But... the example also gives me 3 errors. So... i need to dig deeper in the PyUSB itself, and have the opcodes of the actual module. But i cant seem to find the opcodes.

I take it that the modules have some kind of inputs into them (given by the user) and the module then responds with some kind of output, correct ? But in order to know what input to give the module, i need to have some kind of reference or translation of the opcodes to use. For now, im totally in the void.

Can someone give me a brief explanations of how to interact with a module for Python ? Is there a datasheet ? 

Thanks and cheers ! Have a nice weekend !

Now im off with a whiskey and some:

0 Roger Pettersson · December 3, 2014
I just wanted to update, that i abandoned pyUSB and instead are trying to use pyserial. And by just trying the "list_port" and "miniterm" i can actually connect to my WLAN/USB card and receive raw data and print it out on python terminal. 

In short words, i succesfully send data from my WLAN/USB adapter via Hyperterminal software to my other WLAN/USB adapter via Python / pyserial module and read it. But i cant send data from Python (via WLAN/USB adapters) to my Hyperterminal... at least for now.

Im just stranded on how to translate and/or code to actually use pyserial at my free will.

If any have any pointers or information how i should start coding in pyserial or even interpret it, i would be most welcome !
  • 1



This section is all about snakes! Just kidding.

Bucky Roberts Administrator