AntonMarinski
Posts: 22
Joined: Sat Sep 10, 2016 10:31 am

Keyboard Input w/o Keyboard

Fri Mar 03, 2017 9:03 am

Hi,
This may sound stupid, but is there a way to make Python (not necessary) input things on my keyboard. I am trying to make a headless online radio player. The pi opens the URL, but then I have to hit enter for it to start playing. Is there a way to make it automatic?
Thanks in advance!
Anton

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Keyboard Input w/o Keyboard

Fri Mar 03, 2017 9:33 am

There are two separate questions there.

1. Yes you can automate keypresses from python. Try python-uinput http://tjjr.fi/sw/python-uinput/

2. You can setup MPD, music player daemon, to run as a headless media player which you can control from a smart phone app or perhaps from some buttons connected to the GPIO pins. It works with many internet radio stations, you just need to find the stream's URL. https://www.musicpd.org/
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Keyboard Input w/o Keyboard

Fri Mar 03, 2017 10:04 am

AntonMarinski wrote:Hi,
This may sound stupid, but is there a way to make Python (not necessary) input things on my keyboard. I am trying to make a headless online radio player. The pi opens the URL, but then I have to hit enter for it to start playing. Is there a way to make it automatic?
Thanks in advance!
Anton
I deleted your other post asking the same question on the Beginners forum. Please don't duplicate posts.
thanks,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AntonMarinski
Posts: 22
Joined: Sat Sep 10, 2016 10:31 am

Re: Keyboard Input w/o Keyboard

Fri Mar 03, 2017 10:37 am

scotty101 wrote:There are two separate questions there.

1. Yes you can automate keypresses from python. Try python-uinput http://tjjr.fi/sw/python-uinput/

2. You can setup MPD, music player daemon, to run as a headless media player which you can control from a smart phone app or perhaps from some buttons connected to the GPIO pins. It works with many internet radio stations, you just need to find the stream's URL. https://www.musicpd.org/
Thanks!

Return to “Python”