Sending GPS pmtk packet via serial1

I have a globaltop pa6h GPS (same as adafruit ultimate gps) connected to serial
1 on a Mega. Sentences are being successfully read and displayed on the serial monitor. The system is running at 3.3 volts and the USB is connected to the FTDI pins via a 3.3 converter. I would like to know if it is possible to send PMTK packets to the GPS from within a sketch. Has anybody successfully done this?
Can the packet be sent at the same time as the GPS is streaming it output?
Any help or steers towards good info to help with this greatly appreciated.
Regards

is it possible to send PMTK packets to the GPS from within a sketch.

Yes, just print them:

    Serial.print( F("$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29") );

You have to calculate the "*29" checksum value if you send a different command. Here's a calculator.

Can the packet be sent at the same time as the GPS is streaming it output?

Not with SoftwareSerial. However NeoSWSerial can transmit and receive at the same time.

You may be interested in my GPS library, NeoGPS. It is smaller and faster than other GPS libraries, and has several examples. You can use it to send commands, and it will calculate the checksum for you. The Troubleshooting section may help, too.

Cheers,
/dev

/Dec many thanks.
I will have good look at this library.
What I would like to do in the short term is modify the GPS sentences, like your example to get RMC only, by transmitting to the GPS which is connected to serial1 I.e the second hardware serial on the Mega, using code within a sketch, rather than the window in the serial monitor. I don't want to use a library I just want to see the GPS displaying , for example, only RMC sentences after the packet has been sent. I am not concerned with checksum at the moment without I have to do something with it before transmitting to the GPS.
Any help on this appreciated.
Regards

I don't want to use a library I just want to see the GPS displaying

Ok, you have a Mega, so you can just "echo" the GPS data to Serial:

void setup()
{
  Serial.begin( 9600 );
  Serial1.begin( 9600 );
  Serial1.print( F("...whatever commands...") );
}

void loop()
{
  while (Serial1.available())
    Serial.write( Serial1.read() );
}

That just copies all the bytes from Serial1 to Serial.

without I have to do something with it before transmitting to the GPS.

Hmm, I'm not sure what that means.

Cheers,
/dev

Thank you /dev.

I tried your suggestion , as follows, but the gps did not acknowledge or respond to the packet.
Was my code correct in your eyes?

void setup()
{  Serial.begin( 9600 );
   Serial1.begin( 9600 );
  // Serial1.print( F("...whatever commands...") );
  Serial1.print( F("$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n") );  //There is no change in  output  , still get the default sentences 1,1,1,1,1,5.........etc
  //Serial1.print( F("$PMTK103*30\r\n") );} //tried this but no response

void loop()
{
  while (Serial1.available())
    Serial.write( Serial1.read() );
}

I tried a direct connection of the GPS using the Mini GPS Tool and with this I can change configuration of sentences etc as intended and this indicates to me that the GPS can respond correctly. This direct connection used the same USB to serial device as I'm using to connect to the mega FTDI pins so I assume that is good too. I think that points to either the code or the some behaviour of the two hardware ports within the Mega which I don't understood.
It could of course always be my finger trouble.
Ill keep looking and trying but any suggestions gratefully received.
Regards

the USB is connected to the FTDI pins via a 3.3 converter...

This direct connection used the same USB to serial device as I'm using to connect to the mega FTDI pins...

I don't think the GPS is connected to the Mega properly, because you don't need a USB-to-serial converter to connect the Mega to the GPS, and the Mega doesn't really have "FTDI pins".

You DO need to safely convert the Mega 5V signals for the 3.3V PA6H. The 5V Mega TX pin can damage the 3.3V PA6H RX pin if it is directly connected with just a wire. You can use cheap level-shifter modules or a circuit like this:
Level shift.png
(More details here.)

Please describe what pieces are connected and how they are connected. You might want to review How To Use This Forum.

Cheers,
/dev

Your checksum is still incorrect.

// change this
 Serial1.print( F("$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n") ); 
// to this
 Serial1.print( F("$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n") );

Thank you. SurferTim , I changed the checksum and the packet is still not acknowledge.
/dev , I will review the connections which were outlined in the opening post. I accept your comments but I did review how to use this forum before posting and I thought I had followed the recommendation, so please tell me which part of forum etiquette I got wrong? We all have to learn.
Regards

please tell me which part I got wrong?

Uhh... "Please describe what pieces are connected and how they are connected."

You have not done this. You have to do this at the pin level: what pin on the Arduino is connected to another pin on... a thing. This part is ok:

GPS connected to serial 1 on a Mega (pins 18 & 19). Sentences are being successfully read and displayed on the serial monitor.

But the rest of your descriptions make absolutely no sense:

The system is running at 3.3 volts and the USB is connected to the FTDI pins via a 3.3 converter.

The Mega does not run at 3.3V. The Mega doesn't have FTDI pins. It does have a USB port. But what "USB is connected"? The Mega? The PC? The FTDI adapter? And I'm a little confused about this:

I tried a direct connection of the GPS using the Mini GPS Tool

This is where you would have used a USB-to-3.3V Serial converter (aka FTDI adapter). You can't directly connect the GPS to the PC.

Adrift,
/dev