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.

asked Oct 17, 2017 at 9:05

1 Answer 1

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.

answered Oct 17, 2017 at 9:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.