0

I forgot what was wifi setting of my respberry -3. I want to connect that, but my device is not connecting to the wifi. Is there any way I can change the wifi setting of my device. I am able to mount the flash of my device on linux.

Ibrar Ahmed
  • 101
  • 3
  • can you telnet or ssh to the RPi using the ethernet port? – jsotola Oct 13 '18 at 01:28
  • Possible duplicate of [How do I set up networking/WiFi/static IP address?](https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address), specifically "Headless WiFi setup". – Dmitry Grigoryev Oct 16 '18 at 12:50

2 Answers2

1

If it is just the ESSID and password, you can edit /etc/wpa_supplicant. The corresponding fields there are very clear:

network={
    ssid="___"
    psk="___"
}

"psk" refers to the password. Don't change anything else, and make a backup copy of the file before you change it.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • How to get to /etc directory, I don't have access to my device. If I mount that I see only these files COPYING.linux bcm2709-rpi-2-b.dtb fixup.dat overlays LICENCE.broadcom bcm2710-rpi-3-b-plus.dtb fixup_cd.dat start.elf LICENSE.oracle bcm2710-rpi-3-b.dtb fixup_db.dat start_cd.elf bcm2708-rpi-0-w.dtb bcm2710-rpi-cm3.dtb fixup_x.dat start_db.elf bcm2708-rpi-b-plus.dtb bootcode.bin issue.txt start_x.elf bcm2708-rpi-b.dtb cmdline.txt kernel.img – Ibrar Ahmed Oct 12 '18 at 20:00
  • In your question you wrote, *"I am able to mount the flash of my device on linux"*. The root filesystem containing `etc` is on the second partition of the card. However, if you are **not** using linux you will not see that partition unless you install software that can access `ext4` filesystems. – goldilocks Oct 12 '18 at 20:52
  • After mounting I see a boot device and it contains the files i mentioned above. I don't think is proper mount. – Ibrar Ahmed Oct 12 '18 at 21:22
  • Your card contains two partitions: _boot_ and _rootfs_. You have have to access your _rootfs_ to change the config file. (If you are not able to mount your card get yourself a real OS!) – jake Oct 13 '18 at 02:53
1

To summarize the suggestions from the comments, you wrote:

I am able to mount the flash of my device on linux.

You do not tell us what Operating System you are using so I assume it is Raspbian. This OS is installed on two partitions: the first partition is labeled boot and is formated as vfat, the second partition is labeled rootfs and is formated as ext4. You can show it with:

rpi ~$ sudo blkid

The linux OS you are using is able to read ext4 file systems so you can mount the second partition with (if for example the SD Card is attached to /dev/sdb):

rpi ~$ mkdir rootfs/
rpi ~$ sudo mount /dev/sdb2 rootfs/

Now you can access rootfs/etc/wpa_supplicant/wpa_supplicant.conf and modify it as @goldilocks suggested in his answer. If you have done, finish with:

rpi ~$ sudo umount rootfs/
rpi ~$ rmdir rootfs/

and boot the SD Card with your RasPi.

Ingo
  • 40,606
  • 15
  • 76
  • 189