Closed Moskus closed 1 year ago
In the code there's this line:
messageToSend.mdate = modem.getUnixTime()
... and that's what blocking the core. So this needs to be done in a different way.
Hi, I do not think this library is thread-safe because there serial communication with the module has to be inherently.... serial. You should only read/write to the module with one task, or implement your own logic with some sort of lock.
I'm stuck on creating a task that can upload data in parallell to gathering data. I can't for the life of me not get this to work. When the task ("gathering data" and "sending data") are running on the same core, everything works. When both are running on Core 0 or on different cores, it does not work, for some reason.
When they run on different cores, the upload (http.post()) halts the operation and I get errors (post error -2 among them).
In the function SendMessage() I create a task for uploading the jsonString:
... in setup() I create two tasks, one that reads the queue every 2 second and uploads it (using the task above) and one that creates random messages.
These tasks can be on different cores. but it's crucial that CreateMessagesTask and the SendJson task is on the same Core0, but it does not matter if it's on core 0 or 1.
No matter what I do I can't get the creating/gathering of data to run in parallell with sending on a different core. Is there some limitations of this library or the A7608 modem?
The code I'm using is attached: code.zip