0

So I am planning to host a discord bot on a raspberry pi zero w and I do have a spare monitor( for the programming part), but the monitor wouldn't work when I plug it in and I also don't have one of those mouse+keyboard things, so I have done a bit of research and I have seen many headless setups on youtube, but how do I program it, can I do it with a USB connected to my mac or over wifi, I am open to any suggestions thanks in advance.

RalfFriedl
  • 2,180
  • 2
  • 11
  • 12

2 Answers2

2

You can easily program your Raspberry Pi Zero W via SSH. Should be configured Wi-Fi connection and SSH to be enabled.

Follow the next steps:

  1. Go to Raspiconfig, just type in terminal: sudo raspi-config enter image description here

  2. choose Interfacing Options and set SSH enable. This will help to connect to Raspberry Pi via SSH.

  3. After that, go back and go to Network Options and choose Wi-Fi. Fill name and password of the Wi-Fi. SSID - name of your Wi-Fi, Password - password to it.

  4. To be sure, that all configuration work as expected - reboot your Raspberry

sudo reboot

  1. Next, need to understand the ip address of the Raspberry to connect to. For this, you should write: sudo ifconfig and you will see. In this picture ip-address is 192.168.0.104 enter image description here
  2. Connect via SSH to pi@192.168.0.104.

If you have any questions - see full description here.

Roger Jones
  • 1,484
  • 8
  • 14
romankh3
  • 165
  • 1
  • 1
  • 13
1

You can easily program a Raspberry Pi over SSH. I guess you've already seen in headless setups how to configure your RPi to connect to your WiFi network and enable SSH. If not, here is a quick how-to:

Setup headless RPi

Add an empty ssh file in /boot/ directory

Inside the rootfs partition, edit the /etc/wpa_supplicant/wpa_supplicant.conf file so that it looks like this

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="YourWiFiSSID"
    psk="yourSecretWiFipassword"
}

Here's the official documentation on how to setup WiFi.

You can connect to your RPi from your mac over an SSH session. Once inside, in the terminal you can use a text editor (nano is the default one but you could download something else. I like vim.) to write your programs. Then you can run them in your SSH terminal.

Here's a quick overview of SSH.

David
  • 723
  • 5
  • 22