Python Forum

Full Version: Rewriting HTTP Server from Arduino
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good day everyone,

I'm trying to rewrite some existing Arduino code to python. Basically the arduino just receives an http post request then parses the request and sends it as a text message. Then when it receives a text message it sends it to a server where all it's text messages are stored.

void loop()
{
if(serial.available())
{
//check for new sms
}
if(server.available())
{
//send sms code
}
}

I can do it with sample code above. But I want to rewrite it in python. While the HTTP server is idle it should be checking for incoming sms. But when I turn on the http server I can't do anything else other than send sms based on the post request received.

I'm using sim800l to send a text message and http.server library to handle http requests.
The 'C' code you show is just a shell, and  won't actually do anything.
I assume you have the docs for the sim
You can use Python Flask
Here's a small sample of how to do it on the sim800