problems when connecting arduino mega 2560 with shield ethernet w5100

someone knows how to change the pin ss 10 to another pin ss for example pin 40. and how is it done? what changes must be made, and what libraries do I have to modoficate. Since I want to have several pin ss to control two shield. I want to control ethernet shield w5100 and also shield lora gps with arduino mega 2560. can someone help me please

someone knows how to change the pin ss 10 to another pin ss for example pin 40. and how is it done? what changes must be made, and what libraries do I have to modoficate. Since I want to have several pin ss to control two shield. I want to control ethernet shield w5100 and also shield lora gps with arduino mega 2560.

You can use any pin as the CS signal for an SPI device. The original Arduino Ethernet Shield uses pin 10 (which is also used as the slave select signal in the case the Arduino is used as an SPI slave) so the corresponding library has this pin fixed in it's code. You can edit the library if you think you must change that.

Unfortunately you didn't follow the instructions of the sticky post at the top of the forum as I cannot find links to the hardware you're using.

If you're using the Dragino LoRa/GPS shield that's rather bad as it also uses pin 10 as the CS of the LoRa transceiver. Changing the software library is probably the easier part because changing the shields to use another CS pin is much more work.

Thank you, what library should I change? , ¿ the spi.h ? , or the library in \ hardware \ arduino \ avr \ variants \ ethernet called pins_arduino.h, help I dont know that libraries modify , thank

Thank you, what library should I change?

Either the Ethernet library or the LoRa GPS library depending on which hardware you changed to use another CS pin (I guess the posting of the image means you're using the shield I linked to). Without modifying the hardware you won't get both shields working. So you have a software and a hardware incompatibility.