The Raspberry PLC that you ordered from industrial shields has finally been delivered to your doorstep. You are excited to work with it and explore the possibilities that this PLC offers. You realize that in order to program or work with it, you need a keyboard, a display monitor or an ethernet cable ; but all you have is your laptop and your home wifi. Read on!
This tutorial will explain how to connect your Raspberry PLC with your home wifi and enable the SSH protocol in the very first boot, so that all you have to do is prepare the SD card, insert it in the PLC and power it up to be able to control it via your laptop using SSH protocol. Follow the steps below:
Step 1: Prepare the SD card by installing the Raspberry os. You can download the Raspberry imager from their official site and install the Raspberry os lite.
Create the following two files in the boot drive of the SD card:
Step 2: Create an empty file named ssh with no extension. This file will enable the ssh protocol in the PLC.
Step 3: Create a file named wpa_supplicant.conf and add the following lines to it. Make sure you edit the country_code; SSID and Password fields. This file will set up the wifi on boot up of the PLC. ( Do not change the spacing or indentation)
Note: If you are creating these files on windows, you will have to wrap the names in " " . This will ensure the integrity of the file's extension and if there is none, it will ensure that too. For eg. "ssh". Do it for both the files.
You can now insert the SD card in the PLC, but do not switch it on yet.
Step 4: We now need to find the IP address of the PLC. There are a few ways to go about this. One, you can try to connect to raspberry.local using the following command in the terminal or cmd depending on your OS:
if that does not work, the work around is to run the following command and look for all the devices currently in your local wireless network. This command shares the physical address and the IP address of all the devices in the network.
having noted the list, you can now turn on the PLC and wait for around 3 to 5 mins for the PLC to boot up completely. Once you are sure the boot up is complete, you can run the above mentioned command once again and check which ip address is new. This address will be of the PLC.
Step 5: With this information you can now connect to the PLC with the following command:
And now you can configure your PLC however you like.