{"id":30420,"date":"2024-01-16T11:52:14","date_gmt":"2024-01-16T19:52:14","guid":{"rendered":"https:\/\/digilent.com\/blog\/?p=30420"},"modified":"2024-01-29T09:56:48","modified_gmt":"2024-01-29T17:56:48","slug":"connecting-the-adp3450-to-the-internet-and-set-up-for-remote-access","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/connecting-the-adp3450-to-the-internet-and-set-up-for-remote-access\/","title":{"rendered":"Connecting the ADP3450 to the Internet and Set Up for Remote Access"},"content":{"rendered":"<h2><\/h2>\n<p>Imagine you&#8217;re enjoying a serene holiday in Japan, the tranquility only interrupted by news of a sudden disaster striking your PCB back home. Panic sets in \u2013 do you rush to book the first flight back? Or perhaps frantically video call someone across timezones to walk them through a debug session, all while pulling your hair out in stress? None of that is necessary. Why? Because you have the ADP3450 already set up at home. With this powerful tool, you can remotely access and debug your system with precision and ease, all from the comfort of your current location \u2600\ufe0f<\/p>\n<h4>Prerequisites<\/h4>\n<ul>\n<li>An <a href=\"https:\/\/digilent.com\/reference\/test-and-measurement\/analog-discovery-pro-3x50\/start\">ADP3450<\/a> running in Linux mode (see the other tutorial to find out how to do this!)<\/li>\n<li>A compatible Wireless dongle (I used a TP-Link TL-WN823N)<\/li>\n<li>If you\u2019re on Windows:\n<ul>\n<li><a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\">PuTTY<\/a> for connecting to the serial terminal on the ADP3450. You can get the latest MSI package. If you\u2019re in doubt which one you need, it\u2019s probably 64-bit x86!<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Setting up the wireless adapter<\/h2>\n<p>The first thing we need to do is connect to the ADP serial terminal. Once your ADP is running in Linux mode, use:<\/p>\n<ul>\n<li><code>screen \/dev\/tty.yourdeviceid 115200<\/code> if you\u2019re on macOS or Linux<\/li>\n<li>Or if you\u2019re on Windows, use PuTTY to connect to the correct COM port (which you can find from the Device Manager) with a baud rate of 115200.<\/li>\n<li>You can see more details of connecting to the ADP serial terminal in the previous tutorial.<\/li>\n<\/ul>\n<p>Once connected, we can list the available network adapters with:<\/p>\n<ul>\n<li><code>ip l<\/code><\/li>\n<\/ul>\n<p>You should see three wireless adapters, <code>lo<\/code> the local loopback interface, <code>eth0<\/code> the ethernet port and <code>sit0<\/code> a virtual network adapter.<\/p>\n<p><!-- notionvc: 66987929-4ce3-44fa-9860-7505153508bb --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-600x158.png\" alt=\"\" width=\"600\" height=\"158\" class=\"alignnone size-medium wp-image-30421\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-600x158.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1024x269.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1536x404.png 1536w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2048x539.png 2048w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<ul>\n<li>Now plug in the USB wireless dongle. This should be plugged into the bottom left USB port on the back of the ADP.\n<ul>\n<li>You will see a stream of output appear on the terminal and a message saying the device has been renamed from <code>wlan0<\/code> to a unique identifier.<\/li>\n<li>Mine said <code>wlx3c52a1b01d6d<\/code>. Take note of this, we will need it shortly!<\/li>\n<li>If we run <code>ip l<\/code> again now, we will see our new device show up<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- notionvc: e276aca9-3045-4b47-a704-ebc8a01c91ad --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1-600x285.png\" alt=\"\" width=\"600\" height=\"285\" class=\"alignnone size-medium wp-image-30422\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1-600x285.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1-1024x486.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1-1536x729.png 1536w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-1.png 1828w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<ul>\n<li>We need to tell the ADP how to connect to your WiFi and we will create a configuration file to do this.<\/li>\n<li>First we need to be in superuser mode to do this because we are not able to create new network configurations as the standard digilent user. You do this with\n<ul>\n<li><code>sudo su<\/code><\/li>\n<li>The password is <code>digilent<\/code><\/li>\n<li>You will see the username change from <code>digilent<\/code> to <code>root<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Next we will set our WiFi details as environment variables for the next set of commands. You do that with the following commands:\n<ul>\n<li><code>WIF=wlx3c52a1b01d6d<\/code> (replace this value here with the unique value you saved above)<\/li>\n<li><code>WSSID=YourNetworkName<\/code><\/li>\n<li><code>WPWD=YourNetworkPassword<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Now that we have these details available as environment variables, we can create a configuration file for the ADP to connect. Here\u2019s the command for that:\n<ul>\n<li><code>wpa_passphrase \"$WSSID\" \"$WPWD\" &gt; \/etc\/wpa_supplicant\/wpa_supplicant-${WIF}.conf<\/code><\/li>\n<li>If you want to see what the <code>wpa_passphrase<\/code> command did, you can output the contents of the file it just wrote to with: <code>cat \/etc\/wpa_supplicant\/wpa_supplicant-${WIF}.conf<\/code><\/li>\n<\/ul>\n<\/li>\n<li>To connect to this WiFi network, we will now need to enable and start a service for this network interface. We can do this as follows:\n<ul>\n<li><code>systemctl enable wpa_supplicant@${WIF}.service<\/code><\/li>\n<li><code>systemctl start wpa_supplicant@${WIF}.service<\/code><\/li>\n<li>This will now cause the ADP to connect to this WiFi network automatically on boot.<\/li>\n<li>After starting the wpa_supplicant service, you should see some text that says <code>authenticated<\/code> and <code>link becomes ready<\/code>. If you don\u2019t see an authenticated message, you may have typed your WiFi username or password incorrectly.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- notionvc: ed75740a-570a-44f4-8b94-a708c729602d --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2-600x294.png\" alt=\"\" width=\"600\" height=\"294\" class=\"alignnone size-medium wp-image-30423\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2-600x294.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2-1024x502.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2-1536x753.png 1536w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-2-2048x1004.png 2048w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<ul>\n<li>Now if we run <code>ip a<\/code> we should see we have been assigned an IP address on our WiFi network.<\/li>\n<li>Take note of this IP address!<\/li>\n<li>To double check that we are connected to the internet, we can run <code>ping 8.8.8.8<\/code>. You should see a response of 64 bytes from the server, indicating we are connected to the internet. Press <code>^C<\/code> (Ctrl + C) to exit the ping.<\/li>\n<\/ul>\n<p><!-- notionvc: 54ed8470-84a5-40b9-9c01-b4d07f373374 --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-3-600x184.png\" alt=\"\" width=\"600\" height=\"184\" class=\"alignnone size-medium wp-image-30424\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-3-600x184.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-3-1024x315.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-3.png 1328w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<ul>\n<li>Type <code>exit<\/code> to exit superuser mode.<\/li>\n<li>The prompt should return to saying <code>digilent<\/code> instead of <code>root<\/code>.<\/li>\n<\/ul>\n<h2>Setting up SSH for remote access<\/h2>\n<h3>Creating a keypair<\/h3>\n<p>To log in remotely to the ADP, we need to create some SSH keys. Back in your terminal on your machine, we can run the following commands to create some keys!<\/p>\n<p>On macOS\/Linux:<\/p>\n<ul>\n<li><code>ssh-keygen -t ed25519 -a 100 -C adpkey -f ~\/.ssh\/adpkey<\/code>\n<ul>\n<li>This saves a public\/private keypair into the <code>.ssh<\/code> directory in your home directory.<\/li>\n<\/ul>\n<\/li>\n<li>When prompted for a passphrase, leave it blank.<\/li>\n<\/ul>\n<p>On Windows:<\/p>\n<ul>\n<li>Open PuTTYgen<\/li>\n<li>In Parameters, select EDDSA and set the bit size to 255. Sometimes, the EDDSA option may show up as ED25519.<\/li>\n<li>Click Generate.<\/li>\n<li>Leave the passphrase blank.<\/li>\n<li>Copy down the Public key in the text field as we will use that shortly to copy into the ADP.<\/li>\n<li>Click Save Private Key and choose a safe place to save the <code>.ppk<\/code> file.<\/li>\n<\/ul>\n<h3>Copying the public key to the ADP3450<\/h3>\n<p>On macOS and Linux, this is super easy to do with just one command:<\/p>\n<ul>\n<li><code>ssh-copy-id -i ~\/.ssh\/adpkey digilent@your-ip-address<\/code>\n<ul>\n<li>The IP address after the <code>@<\/code> should match the IP address you got from your ADP when running the <code>ip a<\/code> command earlier.<\/li>\n<\/ul>\n<\/li>\n<li>When prompted for a password, you should use the default password for the digilent user of <code>digilent<\/code>.<\/li>\n<li>You might have noticed that it doesn\u2019t seem very secure to have this default username and password combination open for anyone to log in remotely! We will secure this before opening it up to the wider internet.<\/li>\n<\/ul>\n<p>On Windows:<\/p>\n<ul>\n<li>We might not have the <code>ssh-copy-id<\/code> command available to us, but we can still copy the key to the ADP manually.<\/li>\n<li>Go back to the serial terminal you have open to the ADP in PuTTY (or reconnect if you closed it)<\/li>\n<li>Make sure you are in the digilent home directory.\n<ul>\n<li>The prompt should say <code>digilent@ADPro:~$<\/code> if it says <code>root<\/code>, you haven\u2019t exited superuser mode and need to type <code>exit<\/code>.<\/li>\n<li>You can check you are in the digilent home directory by seeing the <code>~$<\/code> in the prompt or typing <code>pwd<\/code> (meaning print working directory) which should show <code>\/home\/digilent<\/code><\/li>\n<\/ul>\n<\/li>\n<li>We need to make a directory to keep the user ssh keys.\n<ul>\n<li><code>mkdir ~\/.ssh<\/code><\/li>\n<li><code>chmod 700 ~\/.ssh<\/code> (This makes the directory only readable by the digilent user. It won\u2019t work if the directory is too permissive as the SSH service will block it)<\/li>\n<\/ul>\n<\/li>\n<li>Create a new file in the directory with an editor of your choice.\n<ul>\n<li><code>nano ~\/.ssh\/authorized_keys<\/code> (note the US English spelling!)<\/li>\n<li>Paste in the contents of the public key you just created. This will be the file ending in <code>.pub<\/code>. In Windows it will be in the text field in PuTTYgen titled <code>Public key for pasting into OpenSSH authorized_keys file<\/code>.<\/li>\n<li>The key might look incomplete, and start with a <code>$<\/code>. Don\u2019t worry, it\u2019s just scrolled to the right. If you move the cursor down or back to the left, you will see the rest of the key.<\/li>\n<li>Save the file and exit the editor, in nano, this is done with <code>Ctrl + X<\/code>, typing <code>Y<\/code> and hitting enter.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- notionvc: 6d9c8565-443d-4879-a84c-a021e3f4396b --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-4-600x141.png\" alt=\"\" width=\"600\" height=\"141\" class=\"alignnone size-medium wp-image-30425\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-4-600x141.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-4-1024x241.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/Untitled-4.png 1078w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Shrouk walks you through the whole process in our latest YouTube video: <a href=\"https:\/\/youtu.be\/yCoqerUw7Vo\">https:\/\/youtu.be\/yCoqerUw7Vo<\/a><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-30420 jlk' data-task='like' data-post_id='30420' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-30420 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-30420 jlk' data-task='unlike' data-post_id='30420' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-30420 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-30420 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Imagine you&#8217;re enjoying a serene holiday in Japan, the tranquility only interrupted by news of a sudden disaster striking your PCB back home. Panic sets in \u2013 do you rush &hellip; <\/p>\n","protected":false},"author":66,"featured_media":30435,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,1563,1561],"tags":[4372,4352,1452,4612,4614,4353,4616,4611,4613,144,4615],"ppma_author":[4508],"class_list":["post-30420","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-products","category-guide","category-applications","tag-adp","tag-adp3450","tag-guide","tag-internet","tag-keypair","tag-linux","tag-linux-mode","tag-remote-access","tag-ssh","tag-tutorial-2","tag-wireless-adapter"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2024\/01\/ConnectingADP3450toInternet-1080sq.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4508,"user_id":66,"is_guest":0,"slug":"selattar","display_name":"Shrouk El-Attar","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/69127a2e3e75c6545785742713efb3d0104009fe78f7b68fc9c4149f77308483?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/30420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=30420"}],"version-history":[{"count":6,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/30420\/revisions"}],"predecessor-version":[{"id":30467,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/30420\/revisions\/30467"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/30435"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=30420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=30420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=30420"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=30420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}