this post was submitted on 06 Mar 2024
9 points (100.0% liked)

Python

6420 readers
35 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

I'm sorry if this isn't the place to ask this, I also asked over at [email protected].

So what I want to do is this: Two RasPis are at different locations. They're on different networks but have internet access. Pressing a button on one of the Pis turns on an LED over at the other Pi via GPIO. How can I make the communication work? My first thought was Telegram bots as I'm familiar with those for notifications but you can't have Telegram bots communicate with each other, sadly. Is there a good (and secure) solution to this? Preferably using Python code and without continuous costs like server hosting, etc?

Thanks!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 8 months ago (1 children)

The easiest & cheapest option would be to expose one of the devices to the internet on a known port and connect from the other device to that one with SSH.

Once you've got a connection, you can do pretty much anything you want, including writing to a pipe or even a file and polling it.

If you don't want to expose either, then you need a third party to facilitate the connection that is on the Open internet, though that server can be yours too. Even a โ‚ฌ4/mo box at Hetzner would do it.

If these options sound good, let me know and I can be more detailed.

[โ€“] illectrility 1 points 8 months ago

All of the answers I got so far were great. I'll probably use a messaging service though but thank you very much