-
Notifications
You must be signed in to change notification settings - Fork 0
connect network
The SDRlab has an ethernet port that can allow for remote access through ssh.
The SDRlab can use an Ethernet LAN to communicate with your PC. Before following these steps, find out whether your institution already provides a way for you to connect new Ethernet devices to your LAN, and what IP address they will be assigned. If you’d rather set up a local network yourself, you’ll need to run a DHCP server on your host PC. Here I describe my test setup, which is just my PC connected to the SDRlab by a direct Ethernet cable.
(Note that it probably won’t work if you have Linux installed in a virtual machine, unless you play around with the network settings in Windows and/or the virtualisation software - please let Vlad know if you’ve gotten this to work successfully.)
In Arch Linux, I’m using =dhcpd= as my server, with the following basic config file (with all comments stripped out):
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option broadcast-address 192.168.1.255;
}and I start the server when working with the SDRlab using
sudo systemctl start dhcpd4.serviceI don’t want the DHCP server running constantly, so when I’m done, I stop it using
sudo systemctl stop dhcpd4.serviceor just shut down the PC, since the service is not set to auto-start.
In Ubuntu (Debian) setting the Dhcp changes a little such that the steps are: (from https://linuxhint.com/install_dhcp_server_ubuntu/)
Update the APT package repository cache
$ sudo apt updateInstall isc-dhcp-server package
$ sudo apt install isc-dhcp-serverRestart the isc-dhcp-server service
$ sudo systemctl restart isc-dhcp-serverBackup copy of the original configuration file
$ sudo mv -v /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.backupCreate a new blank configuration file /etc/dhcp/dhcpd.conf
$ sudo nano /etc/dhcp/dhcpd.confType in the following lines and save the file by pressing <Ctrl> + x followed by y and <Enter>.
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option broadcast-address 192.168.1.255;
}Restart the isc-dhcp-server
$ sudo systemctl restart isc-dhcp-serverSee, the isc-dhcp-server service is running correctly
$ sudo systemctl status isc-dhcp-serverRestart the RP to check if it received the IP as explained in the Arch Linux and also heck that the PC (client) has an IP address in the range of the RP (from 192.168.1.0 to 192.168.1.255).
Open DHCP Server is reported to work, but I haven’t personally tried it. If you have successfully set it up, please update this wiki!
Another option is DHCP Server for Windows, which is user-friendly and also free:
- Download DCHP server for Windows.
- Configure it with the steps found at http://www.dhcpserver.de/cms/running_the_server/
Insert the new SD card, connect the Ethernet, start your DHCP server, and power on the SDRlab. The green LED should turn on immediately, then yellow LEDs will blink randomly for a few seconds. Finally a red LED will blink periodically; this means that the SDRlab is running and has at least mostly booted.
Now you’ll need to see what IP address your DHCP server has assigned to the SDRlab.
-> In Arch Linux, I can do this using
sudo cat /var/lib/dhcp/dhcpd.leasesand the most recent timestamp is probably for your SDRlab.
E.g. the relevant lease in my case is
lease 192.168.1.163 {
starts 6 2020/05/30 14:16:33;
ends 6 2020/05/30 14:26:33;
cltt 6 2020/05/30 14:16:33;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:26:32:f0:7c:40;
uid "\001\000&2\360|C";
set vendor-class-identifier = "udhcp 1.31.0";
}so my SDRlab’s IP address is 192.168.1.163 .
If you can’t see a relevant lease in your DHCP server, you didn’t see the same LED pattern, or if this is your first time using a Red Pitaya/SDRlab, you may wish to set up a debug console using the serial port. If there was a problem in any of the steps so far, the console will help you identify what it was.
-> In Windows, assuming you are using DCHP server for Windows, you can go to the trace or open the DHCP status in order to see the assigned IP.
If you have activated the HTTP support as part of step 3 during the DHCP configuration wizard, then you can use your internet browser to open the DHCP status web site: https://127.0.0.1/dhcpstatus.xml. Also easily accessible through the tray icon, right mouse, Open status. This should show the configured and operating connections and also all currently active clients. Once you power on the SDRlab and it is assigned an IP address, it will show up after reloading the page.
Now that you have an IP address, you can SSH into the SDRlab.
In linux, it’s simply ssh root@192.168.1.163 in my case.
The first time you try to connect, you should get a warning about the host’s authenticity - just type yes to proceed if you’re confident you’re not going to be hacked!
In Windows, you may wish to use PuTTY or another SSH client.
On your host (your Linux/Windows desktop PC), run
git clone https://github.com/vnegnev/marcos_extras.git -b BRANCH
cd marcos_extras
./marcos_setup.sh IP DEVICE
# example: ./marcos_setup.sh 192.168.1.163 rp-122where:
- BRANCH is
ocra-1.0if you are a normal user, anddevelif you need cutting-edge updates. - IP is the IP address of your SDRlab.
- DEVICE is your SDRlab hardware, either rp-122 or rp-125 .
WARNING: if you are running the SDRlab on your institutional network, you should set up a password or other form of login security! Otherwise, automated bots can (and will) log into your SDRlab and mess with it.