How do I communicate with Raspberry Pi?
Hi all,
I am new to working with the cloud and have a question. I recently set up linode and put my webserver file and its dependencies on linode via the nanode. When I try and run my file I get an error saying one of my modules can only be run on raspberry pi. This module is where I control GPIO pins. How can I communicate between my flask webserver on linode and my raspberry pi at home?
3 Replies
this is an interesting project you have.
there are probably quite a few different ways to approach it.
this is what I would try first.
step 1. set up an vpn between your pi and your linode. if wireguard is supported on your pi and linode, I would use that. it's uncomplicated which is great for something that provides security.
Otherwise openvpn the next best choice.
the vpn is one way to give your linode the ability to initiate connections to your pi securely.
step 2. one way would be to run the full website on your pi and use your linode as a reverse proxy, I would say that would be the easiest.
Another way could be some sort of http api to expose the gpio pins that the webapp on your linode can query.
probably many many different ways to do it. it sounds like fun.
it is definitely fun and useful. I believe using MQTT would be a useful way to do this. I am in the process of figuring out how to publish and subscribe to topics using linode as a broker for these messages, if you have any pointers they'd be much appreciated.
I don't, read a bunch of docs and tutorials and experiment, if you get stuck there should be forums/irc/slack/whatever specific to MQTT or IoT that will be able to help.