A communication apparatus comprising: a wireless LAN interface; a reception unit configured to receive a participation request from a target device through the wireless LAN interface, in a state where a first wireless network to which the communication apparatus belongs as a master station has been established, for requesting participation in the first wireless network, the target device not belonging to the first wireless network; a determination unit configured to determine whether the number of slave station apparatuses belonging to the first wireless network as a slave station is the same as a predetermined upper limit or smaller than the predetermined upper limit; a first transmission unit configured to transmit first wireless setting information to the target device through the wireless LAN interface, in response to a first case where the participation request is received and then it is determined that the number of the slave station apparatuses is smaller than the upper limit, the first wireless setting information being currently used in the first wireless network; and a communication execution unit configured to perform a communication of target data, in response to the first case, with the target device through the wireless LAN interface by using the first wireless network to which both the communication apparatus and the target device belong, after the first wireless setting information is transmitted to the target device; characterized in that the communication apparatus further comprises a second transmission unit configured to transmit second wireless setting information to the target device through the wireless LAN interface, in response to a second case where the participation request is received and then it is determined that the number of the slave station apparatuses is the same as the upper limit, the second wireless setting information being used in a second wireless network different from the first wireless network; and the communication execution unit is configured to perform a communication of the target data, in the second case, with the target device through the wireless LAN interface by using the second wireless network to which both the communication apparatus and the target device belong, after the second wireless setting information is transmitted to the target device. a wireless LAN interface; a reception unit configured to receive a participation request from a target device through the wireless LAN interface, in a state where a first wireless network to which the communication apparatus belongs as a master station has been established, for requesting participation in the first wireless network, the target device not belonging to the first wireless network; a determination unit configured to determine whether the number of slave station apparatuses belonging to the first wireless network as a slave station is the same as a predetermined upper limit or smaller than the predetermined upper limit; a first transmission unit configured to transmit first wireless setting information to the target device through the wireless LAN interface, in response to a first case where the participation request is received and then it is determined that the number of the slave station apparatuses is smaller than the upper limit, the first wireless setting information being currently used in the first wireless network; and a communication execution unit configured to perform a communication of target data, in response to the first case, with the target device through the wireless LAN interface by using the first wireless network to which both the communication apparatus and the target device belong, after the first wireless setting information is transmitted to the target device; characterized in that the communication apparatus further comprises a second transmission unit configured to transmit second wireless setting information to the target device through the wireless LAN interface, in response to a second case where the participation request is received and then it is determined that the number of the slave station apparatuses is the same as the upper limit, the second wireless setting information being used in a second wireless network different from the first wireless network; and the communication execution unit is configured to perform a communication of the target data, in the second case, with the target device through the wireless LAN interface by using the second wireless network to which both the communication apparatus and the target device belong, after the second wireless setting information is transmitted to the target device.