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.
2 Answers
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:
choose Interfacing Options and set SSH enable. This will help to connect to Raspberry Pi via SSH.
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.To be sure, that all configuration work as expected - reboot your Raspberry
sudo reboot
- Next, need to understand the ip address of the Raspberry to connect to. For this, you should write:
sudo ifconfigand you will see. In this picture ip-address is192.168.0.104
- Connect via SSH to pi@192.168.0.104.
If you have any questions - see full description here.
- 1,484
- 8
- 14
- 165
- 1
- 1
- 13
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.
- 723
- 5
- 22
