I am working with the raspberry pi, and I have an application on the other end that is supposed to respond to button presses. The problem that I have is that I am not in the room of the Pi that is running and therefore I have no way to push the button. Is there a way that I can somehow emulate a button press via a ssh terminal that way my python program will pick up on it.
Why don't you run a Web server on your PI . Call (http) a script (php) from remote machine. And the script will do the work locally.
Related
For a digital design course, we have to use a microcontroller as the CPU of the system. The chip we plan to use is STM32L0C8T6. We want to integrate the SSH function into a keyboard. The way we plan to do it is to connect the STM32 with a Raspberry pi zero or 2 through UART or SPI. The Pi will connect to the WIFI and connect to other hosts through SSH. An LCD display is also connected to the STM32 which will work like the monitor, displaying all things you will see when ssh, like whatever is shown in the terminal when ssh.
My question is how to build the connection between the terminal and STM32. One possible way is to dump everything in the terminal into a file and send the file back to STM32 for display. I think this will be really slow. Are there any better ideas?
The question sounds wired, and I know we could connect LCD directly to the Pi, but this is the project requirement to have to follow. The LCD has to connect to the microcontroller.
Thank you so much!!!!
I have a raspberry pi 4 configured to do a console autologin and when it starts then I start an app.
Sometimes I need to do a desktop login to configure things like wifi, etc.
Is there any way, with PinOut or another way, to put a button that when the raspberry starts if said button is pressed then it turns on with desktop login and if not with console autologin?
Let me explain my problem: I have a raspberry Pi with Kodi installed and I use it with a IPTV service. This service only allow me to use it in one device at a time and sometimes I want to use it on my phone.
I'd like to be able to turn off my raspberry remotely so I can watch it in my phone whenever I want. I tried to create a web server that would allow me to run a script that would turn off the device but I can't access it because the raspberry IP takes me to some kodi stuff.
So to sum up, I'd like to go to my raspberry IP with Kodi installed, press a button and turn off the device. The web stuff I can take care of.
Any thoughts?
The only safe way to do this is to have a VPN tunnel that lets you access your internal network. This is much safer than opening up a port to Kodi on your router. It would just attract every bot and hacker out there.
Once you have a working VPN tunnel between your home network and your smartphone, just use a Remote Control App to shut Kodi down cleanly.
You can use a Kodi remote app for your mobile device. E.g. Kore (official remote app for Android) does have a shutdown button.
I think the best and easy way is to install dataplicity in your Raspberry Pi and access via dataplicity web or the app (Android or iOS) to the Terminal and use the command: sudo shutdown -h now or sudo poweroff
I have a nodejs server in my raspberry and I want people to be able to connecto to it just connecting to the raspi.
The ideal scenario is where in my phone I see the raspi SSID, I connect to it. Then I open chrome enter the ip:port of the raspi itself and it works. Nothing fancier.
What I don't know how to search for in the internet is how to set my pi in a way that it opens itself to the world and appears in the SSID list in my phone. I don't need internet sharing nor anything. Just accessing the nodejs server in the pi.
This can be easily achieved depending on the OS you are using in your pi. Use basically need to use hostapd and a DHCP Server.
You can use a script like create_ap.
I have a script on my raspberry that should get data from a site in the internet.
I want it to get this data as soon the raspberry boots up, so I added a line to the rc.local script to start my script, because according to the information I have this is the last init script to run. The my script runs in an infinite loop, so when I login it is supposed to be running but it is not. I made another script and added another line in the rc.local script start it too. My second script also runs in an infinite loop but it does not "talks" to the internet. After rebooting and logging in I found the my second script running but not my first.
The way I was connecting to my raspberry (in my working place):
the raspberry is connected to my router;
my local computer is also connected to the router;
the router is connecting to the internet;
Trying to find out what the problem is I brougth the raspberry to my house, but because I don't have a router there I connected the raspberry directly to my laptop. To my surprise when I logged in to the raspberry my to scripts were running.
So now I suppose that somehow the router connection (that is working very well with everything else) is stoping or preventing my first script from start.
Could anyone give me a hint to how I can prevent this problem or solve it?