Install the tfmplus python module <python -m pip install tfmplus>. The process will also install pyserial, which is required. Then get the example script tfmp_test.py out of the python/lib/site-packages/tfmplus/src/tests/ folder to see how the module works.
Note: This module uses the RPi GPIO15/Rx and GPIO14/Tx to connect the TFMPlus.
You can not connect multiple serial devices to an interface (although it may be possible with additional circuitry to multiplex devices - only one can work at a time).
You can of course SEND to multiple devices but only receive from one.
Try setting force_turbo=1 in config.txt. This will disable dynamic frequency scaling of the CPU. I have had four devices (all my three Zero W devices and one Raspi 4) which used to freeze, the Zeros when the Pi Cam was connected (and used to create timelapses), then they froze randomly after a couple of hours or after a couple of days and the Raspi 4 under ...
Using the following wiring diagram:
With the code from https://github.com/makertut/raspberry-hc-sr04 :
(NOTE: code requires TRIG and ECHO to be swapped to match circuit)
import RPi.GPIO as GPIO
TRIG = 24
ECHO = 23
You appear to be asking us to debug some random tutorial you found on the internet which you may or may not have followed correctly.
If this doesn't work you need to post details of your setup.
You asked, "How should I interface a solenoid to a RPi GPIO input?", and solicited some feedback on the schematic in your question:
Does the optocoupler circuit look like it will work (without destroying the GPIO)? Are there any potential pitfalls I have missed? Is there a more sensible approach to detecting the doorbell press?
As a minimum you should be discussing this with your IT support at work. Never trust free advice from the Internet where security and privacy is involved :-)
Saying that, here is my free advice:
The simplest way would be to use a broker based on the Internet that you can reach both from home and work.
A search will turn up a few free ones (I like Adafruit ...
You can have several solutions for your problem.
With an Access Point
You can create a wireless network (with an Access Point you can also have a DHCP server giving IPs to the devices - The Raspberry PI or the Arduino receiving the signals should have a static IP address) and all the devices will connect to that access point.
Using the Raspberry PI as an ...
This is an EE Question, not Pi specific.
What you propose should work (depending on current transfer ratio of opto-isolator - which should be adequate).
I can see only one potential issue - the snubber diode may impact on the ding on release.
If so, you could protect the opto-isolator by connecting the diode across the opto-isolator input (D2 in your diagram)...