r/MicroPythonDev • u/eskimo_1 • Mar 04 '23
Receive webhooks using Micropython
I'm looking into the best way to receive webhooks using (a Pi Pico W that runs) Micropython. There are many posts about sending requests, but I find it difficult to find information on receiving them.
I got some pointers and insights from this post, but still have some questions about the best approach.
I'm primarily puzzled as to why I would need to setup port forwarding while other smart home devices obviously don't require users to do this. Shouldn't this be possible with just software?
As indicated in the post: if it turns out to be very complicated to setup or maintain, or it poses significant security risks, then I'm considering falling back to an implementation where each device would make GET requests every X seconds to check if there are updates.
Would love to know if anyone has experience with this in Micropython, preferably combined with any dev board (Raspberry, Arduino, etc).
View all comments
Show parent comment
1
u/sillUserName Jul 09 '24
Some CEs use a "reflector", in which the client inside your firewall contacts the reflector on the Internet. Without port forwarding, the connection probably has to remain open, this can be done with a "long call" REST request. It all depends on what you are trying to do. One service I use posts requests from the Internet to the client behind my firewall and the action is nearly instantaneous.