I can give you few ideas, not exact tutorial here.
There are many protocols you can use to achieve this.
UART of Rpi Pico <--> UART of Rpi4 ( dont forget cross connect RX & TX of each other pi's.)
Use a http server on pi4 using python code , and add http client on pico
... There are endless possibilities like these.
If you want very ...
@WJLee9559 the smtp part of the tutorial is only if you want the Raspberry Pi to send you mail. If you do not need that just delete ssmpt and skip to the part with the Python program. If you do need it, the error is telling you that your file does not exist. Try to run sudo touch /etc/ssmtp/ssmtp.conf then edit it in nano. Don't forget to run touch and nano ...
That's a typo, there should not be spaces between the two dashes.
sudo dpkg --configure –a
^^ no space there
Always a good idea to check the manual page when using a new command: man dpkg (see also man man).
rc.local has been deprecated for some time - here's one description explaining its current state. You shouldn't use rc.local because it's not supported any longer.
There are two common alternatives for running your script at startup:
1, cron with the @reboot invocation,
2. create a "unit file" to run under systemd
As a general comparison between ...
This is a brief answer; I won't try to address potential issues in Python, but I will make one suggestion wrt your cron job running @reboot.
Many of the cron issues reported here have to do with the fact that cron does not monitor availability of resources prior to running an @reboot job. In other words, the system (or specifically systemd in most modern ...
They do not have to be specifically for a raspi. Also, an rpi4 will work, but it is waaay overkill. The same project an be done with a pi zero. With sensors, if they are 5v you need a level shifter. I recommend a 3.3 volt sensor as level shifters are not requierd for 3.3v components. The 74LVC245 level shifter will work for the sensor (If you choose for a ...
Install the desktop environment (the full Pi OS, not the "Lite" one), then you'll be able to use pynput.
Otherwise, use an input library which supports mice and don't require X, e.g. SDL. Here's a tutorial for making a small game with PySDL2, which shows how to process SDL events. You'll have to add SDL_MouseButtonEvent to the event loop.
First off, gksudo is deprecated, and not needed in your case. You should use sudo instead. The failure you're seeing has nothing to do with sudo, you're likely running your script before a GUI environment has started, so there is no display to connect to.
Second, you try to run /home/admin/myapp/main.py as the pi user. Normally, pi won't even have read ...