Hello dear Arduino enthusiasts
So far I've been able to solve all problems by researching but now I've run into an error that I've been unable to solve so far.
Hardware I'm Using
- Arduino Mega 2560
- CC3000 Wifi Shield
- SIM900 Shield
Functionality
The Project I'm working on reads multiple sensor values and sends out an alarm text message if a defined threshold is passed.
It also should read incoming text messages and immediatley answer with the present values to the phone number the text message came from.
The data should also get written localy on the SD card of the CC3000 and get passed on to a PHP script that stores the data in a MySQL database.
The Problem
All of the functions are working but sadly not at the same time. If I don't exclude the initialitiation of the cc3000 from the setup() loop, the SIM900 isn't able to read incoming data from the software serial.
However if I comment out the cc3000_setup() function from the setup() loop, the text message recieving function works perfectly.
Funny enought outgoing text messages seem to work with the wifi shield initialized.
Somehow there must be some kind of conflict between the cc3000.begin() and the mySerial.read() function.
I've tried searching for similar setups but haven't found much related to combining cc3000 and SIM900.
I'd be really grateful if you could have a look into the code and think of a possible solution.
My thought was to initialize the wifi shield everytime i want to call the http request and reset the shield totally after the request has been finished. I haven't found a function in the adafruit CC3000 library that resets the shield. The only function I've found is the cc3000.disconnect() but it doen't seem to be enought.
Thanks for having a look into this
Best regards
Paul
Final.ino (12.7 KB)