Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
listening to USB
#1
Hi,

I have made some progress into the not-so-easy listening to input from USB busses.
The setup:
RPi 3, python

I have 3 (identical) numerical keypads attached to 3 USB ports.

I have succeeded in reading vendor & product number and the bus numbers of the USB busses (each boot they are different,
but that is not a problem) Of course vendor & product number are 3x the same.

3 people will be typing 1-digit numbers on the keypads, each one and they stop.(actually answering multiple choice questions)
What i have to do is figure out who typed which number.

I imagine that if i can associate the bus number to the typed number and then parse,
i'm on my way.

But how do i get started, what method ...?

Thanks
Paul
Reply
#2
you might want to take a look at: http://www.binarytides.com/python-packet...ode-linux/
This was written for Linux, (socket api runs differently on windows), but it may give you some ideas.
also: https://www.laurapickens.net/projects/20...t_sniffer/
and rfc's 791 (https://www.rfc-editor.org/info/rfc791).
Reply
#3
OK, thanks, will do !

Paul
Reply
#4
Update:
USB stuff is not relaxing !
Starting from the above links, and after about 100 related searches, i finally came across somebody with the same problem.
Even then, you sort of have to reverse-engineer from there.
https://www.domoticz.com/wiki/Assign_fix...o_USB_port
https://unix.stackexchange.com/questions...tatic-name

It has been done, but a lot of uncharted territory for me !
The trick is to assign new names to the 3 USB ports with identical devices. = "rules"
- How do i get the RPi to incorporate my new rules ? (in etc/udev/rules.d/)
- And, most importedly, how do i get python to listen specifically to USb port 1 , 2 and 3 ,
using those new names ?

No white smoke yet, still working...
Paul
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Listening music from url ebolisa 1 1,667 Nov-25-2020, 07:53 AM
Last Post: ebolisa
  Waiting and listening test 2 2,140 Nov-13-2020, 04:43 PM
Last Post: michael1789
  How can I make this server stop listening for connections to sockets Emekadavid 0 3,433 Jun-03-2020, 02:28 PM
Last Post: Emekadavid
  Array of Listening Sockets abarnes 1 2,614 Sep-28-2017, 07:26 PM
Last Post: abarnes
  listening to user input even after opening an application in mac sharma16aug 4 4,919 Jan-24-2017, 10:43 AM
Last Post: sharma16aug

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020