I am trying to use both GPS and GSM module together to get GPS data and send it over PPP connection to GSM module to send it to Google IOT server. I am facing some problems like if i use one module at a time it works perfectly but using both together ppp connection fails to connect and sometimes MQTT fails if PPP succeeds, I think both of the modules are interfearing with each other. Please help me with it, On changing the update interval of GPS module connection status varies.
Let’s start with what micro-controller are you using? and i expect that both of your devices will be on the different serial lines.
now to solve your issue, what you have to do is make the micro-controller do some multitasking, so all the delays should be removed from your main Void Loop() . you need to make functions to do all the things properly.
the GSM, GPS module works great together. i have used GSM,GPS,Bluetooth, Some Sensors, LCD and a lot more things together and all of them worked at the same time (at-least that’s what human eye sees). The trick here is to make your code functional and use Millis(), a timer functionality to do the job.
i hear you asking how does it work and your confused.
Let me explain it to you.
i give you a clock, and ask you to do multiple tasks, but each and every task is based on a specific time, lets say, every 1Min, i ask you to send a message to your mom, every 2 Min i ask you to call your dad, and this process should keep on happening, now if you see this whole process in terms of not Minutes but Milliseconds, you see your actually doing multiple tasks on the tick of a time. That’s the catch here, all you have to do is, ask the micro-controller to do a specific task on a tick of a time. and when theres no heavy delays in the main loop, it all seems to be like multitasking.
i guess this makes a lot of things clear, let us know how it all works.
Thank you very much sir, I got it working their was some code and power issues after your inputs i was able to tackle them.