Hi
I want to disable all interrupts, when during request.post command.
I coded this, using disable_irq() and enable_irq() commands, but caused reboot.
irq_state=machine.disable_irq()
print(“IRQ STATE: “,irq_state)
for iS in setSample:
print(iS,”for:”,headers,” – “,url)
r=requests.post(url, json=iS, headers=headers)
r=””
machine.enable_irq(irq_state)
How should I do for disabling all interrupts during a certain period?
Regards
Hi.
I’m sorry for the delay in my response.
You seem to be using those functions correctly.
I’ve searched for a while and some people had the same issue, but I didn’t find an answer: https://loboris.eu/forum/showthread.php?tid=102
Do you really need to disable interrupts? What exactly you need to do?You can only perform very short tasks with interrupts disabled (I think) – like changing the state of a flag variable. Then, immediately enable interrupts again. After that, you should have a condition that checks the state of that flag variable and if an interrupt has been detected, perform the request.
I hope this helps.
Regards,
Sara
Hi Sara
sorry I didn’t see your answer.
My problem was solved.
I don’t know why but if I disconnect ESP8266 to PC (Using USB),
ESP8266 is more stable and doesn’t generate any error.
I can not understand why but now it works and I don’t lose any data.
Regards