Please find the code below.
I did, indeed, and it is stupid code.
struct student {
int id;
int marks;
};
dtostrf(stu.id,7, 2, val);
Why on earth are you expecting two decimals places from an int? Why are you using the Double To STRing Formatted function to convert an int to a string?
Why are you using SoftwareSerial, when the Teensy has more than one hardware serial port?
Why are you using write() to print data?
Most importantly, why do you ASSUME that every AT command will succeed? Why do you NEVER read ant response from the modem?
Why do you think you need to send a student ID and grade to the database every two milliseconds?