RAKWireless / rak_common_for_gateway

215 stars 126 forks source link

Rpi not connecting through Eth0 #4

Closed Erik-Koning closed 4 years ago

Erik-Koning commented 4 years ago

Hello,

I have tested two different raspberry pi boards with this code, and both were unable to connect to the internet via Ethernet. in sysconf/set_ip.sh static ip addresses are set. By removing the static ip i am able to connect. What is the reason for the static ip addresses?

RAKWireless commented 4 years ago

The Eth0 has a default static IP address 192.168.10.10, not DHCP, that's why you can't connect RPi through Eth0 directly. But Wlan0 is DHCP. Why it is? For the first time you configure RPi, there is a default SSID which is created in RPi and you can connect this SSID to configure RPi. But after that, you may change RPi's WiFi from AP mode to Client mode, that means you can't connect with RPi easily if you haven't another WiFi router and know what's the current IP address of RPi. In this case, Eth0 will be a good choice as a configuration port, and the static IP address can let you connect with RPi easily. Surely, you can change the static IP address according to your requirment in the congfiguration UI, or you can modify RPi configuration file to use DHCP for Eth0.