0

I am developing a 247 monitoring system with Arduino. The values need to be sent to server periodically as well as upon interrupt (Watchdog). To access the internet, I am using the SIM800 module. Now, Is it possible to HTTP inside an ISR? As far as I know, Serial communication should not be used in ISR. Then how can I communicate with SIM800? Any suggestion will be valuable.

2

No, you cannot do HTTP in an interrupt, and you certainly can't use SoftwareSerial in an interrupt.

To trigger a heavy task in an interrupt you just set a flag (variable) which means "this task is due to be performed". Your main loop then checks that variable, runs the task, and resets the variable ready for the next time the interrupt triggers.

In multithreading environments these flags are called semaphores (yes, from the old signalling system using flags on ships). One thread (the interrupt) signals to the other thread (loop()) that it can do something.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.