We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to use the following modules in p3
controlP5 (for GUI)
serial (to communicate with a device on COM port)
... the device is a GSM SIM900 module that can understand AT commands. when I create a session in PUTTY for COM port, for every AT command I type and press ENTER, I get an acknowledgement. For e.g.
AT
OK
where AT was the command I typed and OK was the acknowledgement I got.
In p3, I made a GUI that contains 2 textboxes and a button.
I also created a serial handle,
mpo = new Serial(this,Serial.list()[0],9600);
mpo is global object of class Serial
On clicking the button, the content in the textboxes is processed and if a condition is met, then some functions in serial module are called.
mpo.clear();
mpo.write("AT\n");
... I also have this function,
void serialEvent(Serial mp){
ins = mp.readString();
print(ins);
}
where ins is a global String object. This function, I suppose, is called whenever I send commands to module and not when the module acknowledges. So, it prints AT, but doesn't print OK... Is there any way this problem can be solved?
Answers
Please format your code. Edit your post (gear on top right side of any of your posts), select your code and hit ctrl+o. Leave an empty line above and below your block of code. Details here: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text
An MCVE will be useful here not bc we will be able to run it but to show your actual approach to handle those events.
Kf