Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rewriting HTTP Server from Arduino
#1
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.
Reply
#2
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upload big file on the server HTTP protocol Timych 1 2,377 May-15-2020, 07:12 AM
Last Post: snippsat
  http.server start delay pastacolsugo 1 2,947 Apr-18-2018, 08:58 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020