HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Installing ARpiCADE for the first time? Having issues? Check here first for solutions and tips on installing.

Moderator: dee2eR

wboy
Contributing Member
Contributing Member
Posts: 45
Joined: Mon Jan 29, 2018 1:20 pm

HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by wboy » Thu Feb 22, 2018 11:29 am

The following guide will instruct you on how to configure your RPi's Wi-Fi on the stock ARpiCADE OS release, and also root SFTP enabling it so you can use any Windows PC on your network to transfer your ROMs to the SD card using the brilliant SFTP client WinSCP...

Prepare yourself a ARpiCADE 3.811 SD card using the IMG download found in dee2eR's first post here... https://arpicade.com/forums/viewtopic.php?f=12&t=369

If you need assistance in preparing the SD card and also growing the BOOT partition to utilize all the space available on your SD card, be sure to check out FrizzleFried's HOWTO post & informative link within here... https://arpicade.com/forums/viewtopic.php?f=5&t=452

Place the newly prepared ARpiCADE 3.811 SD card in your Raspberry Pi (mounted on your RaspberryJAMMA, interfacing your cabinet's JAMMA harness).

Plug in a USB keyboard to your Raspberry Pi before powering up your cabinet!!!

Now power your cabinet and wait until your are presented with the pac-man themed Attract-Mode menu which obviously loads an empty game list for now.

Press the ESC key, and select Yes to exit the Attract-Mode menu.

As per the stock /boot/run.sh shell script, ARpiCADE now loads AdvMENU. Press the ESC key again to exit to the terminal shell.

We need to give ourselves root access to ARpiCADE using sudo.

Code: Select all

pi@raspberrypi:~ $ sudo -s
We also need to set a root password using the command passwd. Enter your new password and retype it again as prompted. I use the password arpicade myself (don't tell anyone!)

Code: Select all

root@raspberrypi:/home/pi# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Lets also give your ARpiCADE OS a unique hostname instead of the default name set of raspberrypi. In the example below I use arpicade1

Code: Select all

root@raspberrypi:/home/pi# echo "arpicade1">/etc/hostname
Verify that worked using cat! #meow

Code: Select all

root@raspberrypi:/home/pi# cat /etc/hostname
arpicade1
Wi-Fi is now enabled by default since the release of ARpiCADE 3.8. If you are following this guide using 3.7 you can enable Wi-Fi as per the instructions at https://arpicade.com/faq/

As also described in the FAQ, we need to set your Wi-FI SSID name passphase. This can be done using the wpa_passphrase command after we change into the correct folder.

Code: Select all

root@raspberrypi:/home/pi# cd /etc/wpa_supplicant
root@raspberrypi:/etc/wpa_supplicant# wpa_passphrase "Your Wi-Fi SSID Name" "Your Wi-Fi passphrase">wpa_supplicant.conf
Verify you have entered the correct SSID name and passphrase using cat! #meow

Code: Select all

root@raspberrypi:/etc/wpa_supplicant/# cat wpa_supplicant.conf
network={
	ssid="Your Wi-Fi SSID Name"
	#psk="Your Wi-Fi passphrase"
	psk=477024ffa3fc26c7334ce1d01c54ec332a15a602ca47d1173c1379bb0e210ae8
}
Now create the required blank file named "ssh" in the /boot folder using touch and verify it's creation with cat. #meow

Code: Select all

root@raspberrypi:/etc/wpa_supplicant# cd /boot
root@raspberrypi:/boot# touch ssh
root@raspberrypi:/boot# ls -al ssh
-rwxr-xr-x 1 root root 0 Feb 10 01:31 ssh
Everything should be now configured for Wi-Fi success. Now let's enable root access via ssh/sftp using nano.

Code: Select all

root@raspberrypi:/etc/wpa_supplicant# cd /etc/ssh
root@raspberrypi:/etc/ssh# nano sshd_config
Scroll down using your arrow keys until you find the # Authentication: section. Set PermitRootLogin to yes. You can comment out the default value of without-password and place it on the line below.

Code: Select all

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
#without-password
StrictModes yes
To save your changes, press [Ctrl+X], followed by [Y] and [ENTER] to save the change.

IMPORTANT NOTE: The general recommended linux practice is to not enable password authentication for the root account. Lucky I haven't told you my password is arpicade. Even if I had though, I'm not concerned myself, my cabinet isn't on all the time. You can assess the risk yourself. Odds are you won't forward port 22 from your router to your ARpiCADE OS for the outside world to access. There is no need! So the risk lives within your own network. I may care to update the instructions later on how to create an authorized key and use it instead. Graduate past this tutorial first, and pester me for that later! :mrgreen:

Ok, now let's reboot ARpiCADE OS. Enter reboot.

Code: Select all

root@raspberrypi:/etc/ssh# reboot
Once back at the Attract-Mode menu, press ESC to quit it and also AdvMENU after it to return back to the terminal shell. You should notice the user@host now reflects your new hostname of pi@arpicade1.

Now let's confirm you have successfully connected to your Wi-Fi network using ifconfig wlan0 and also make note of the allocated IP address. In the example below you'll notice my RPi's Wi-Fi IP address is 192.168.1.101.

Code: Select all

pi@arpicade1:~ $ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: ff00::ff00:ff00:ff00:ff00/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:234 errors:0 dropped:96 overruns:0 frame:0
          TX packets:155 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18274 (17.8 KiB)  TX bytes:22510 (21.9 KiB)
Now head over to your networked Windows based PC. You can auto-install the SFTP client WinSCP by downloading and running the following link... https://ninite.com/winscp/. Be sure to check out all the auto-installers (and updater if you run the same download again at a later time) available at https://ninite.com.

Alternatively, the official site for WinSCP can be found at https://winscp.net/.

Once done, launch WinSCP and create yourself a profile. You will need to logon as root to transfer ROMs into the /boot/roms folders. If you like you can also clone the profile and define the other to logon as pi if you wish to make changes to anything within or under the /home/pi parent folder. The only benefit of this is the files will retain the correct ownership permissions for the pi user account, and not inherit roots. Refer to the attachment screen below for an example. If your hostname fails to resolve (e.g. arpicade1), use the IP address you noted before! You know the root password you set. I won't tell you mine, just in case you hack my network and disable free-play on my cabinet!

Once all done connect to your running cabinet's ARpiCADE OS and transfer away using copy and paste, drag and drap or right-click upload and download functionality. Reboot whenever you want to re-scan your newly added ROMs.

Happy wireless transferring!

wboy.
Attachments
winscp_profiles.png
winscp_profiles.png (12.43 KiB) Viewed 5978 times

dee2eR
Inventor
Inventor
Posts: 1626
Joined: Tue Aug 22, 2017 2:07 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by dee2eR » Sat Feb 24, 2018 12:26 pm

This is so good I almost want to get out my WIndows 7 laptop just to have a go.

Thanks for another great post. Mind if I add it to the instructions file?

wboy
Contributing Member
Contributing Member
Posts: 45
Joined: Mon Jan 29, 2018 1:20 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by wboy » Sun Feb 25, 2018 12:09 pm

Got for it.... please use however you like.

On linux you can easily use Filezilla as the client, or even Gigolo as included on Xubuntu by default simply by using the SSH service type.

... and if you're really bored and have too much time to burn, install and configure sshfs to mount it! :P

mR_CaESaR
Super Contributor
Super Contributor
Posts: 86
Joined: Thu Feb 15, 2018 11:59 pm
Location: Sydney, Australia

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by mR_CaESaR » Mon Feb 26, 2018 5:27 am

This is awesome!

I will give this a go sometime this week.

I was wondering how to get it done as I continually had to turn off the machine, transfer roms and then turn back the machine. This should save that whole process

wboy
Contributing Member
Contributing Member
Posts: 45
Joined: Mon Jan 29, 2018 1:20 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by wboy » Mon Feb 26, 2018 11:01 am

As per my post in the ARpiCADE 3.8 thread, to make the process a bit more easier (after you add roms) connect as root and edit the /boot/run.sh file. You can just right-click and edit the file within WinSCP using it's in-built editor.

Add the line if [ $(tty) != "/dev/tty1" ]; then exit; fi right after the #!/bin/bash similar to below. This simply stops the roms scan process when you access arpicade via a remote shell.

Code: Select all

#!/bin/bash

# Exit run.sh if not being executed from the main console/connected arcade monitor
if [ $(tty) != "/dev/tty1" ]; then exit; fi

# Setup dispmanx for clean advmame & daphne video output this version of SDL is modified to output for
...
Once done you can then use the Open Terminal (Ctrl+T) icon in the toolbar of WinSCP to also start a remote shell. Accept the separate shell warning (and disable it) and then enter the command sudo reboot to press [Execute] to restart ARpiCADE. On restart (as usual) it'll re-scan your newly added roms and showcase them a few seconds later for you in Attract-Mode - easy as Pi! :mrgreen:

If you plan to do a bit more remote shelling into ARpiCADE (for more then just sudo rebooting) then you may be better off installing Putty. The Ninite Putty auto-installer can be downloaded from https://ninite.com/putty. Official site installer can be download from https://www.chiark.greenend.org.uk/~sgt ... atest.html.

guntherm
Super Contributor
Super Contributor
Posts: 96
Joined: Sun Nov 11, 2018 8:58 am

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by guntherm » Sun Dec 02, 2018 2:57 pm

I am not getting something: On 3.83, cant get down the to the terminal window to do any of this. I am connected to PI, via FileZilla, but don't have permissions to do anything except view (using user: pi), which I understand won't.. but.. not getting to root/sudo su access can't add Themes via computer.

NoJive
Contributing Member
Contributing Member
Posts: 25
Joined: Mon Aug 27, 2018 6:26 am

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by NoJive » Mon Dec 24, 2018 3:51 pm

Thank you so much for this tutorial, it works great! ;)

Matt68061
Super Contributor
Super Contributor
Posts: 55
Joined: Fri Aug 25, 2017 8:39 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by Matt68061 » Wed Dec 26, 2018 8:41 pm

Has this changed in 3.83?

Thanks

dee2eR
Inventor
Inventor
Posts: 1626
Joined: Tue Aug 22, 2017 2:07 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by dee2eR » Wed Dec 26, 2018 11:44 pm

a few little details will have changed, I think the general idea will still work. 'F4' will now exit menus rather than 'esc' and the WPA_supplicant file now has a country code in it that I think will need to be set that wasn't in earlier versions. I think the rest should be about the same*.

*although I don't use any of the networking stuff outside of updating bits of the software so I could be wrong on this one....

Bubbak
Contributing Member
Contributing Member
Posts: 29
Joined: Sat Nov 25, 2017 3:35 pm

Re: HOWTO: Enable Wi-Fi and SFTP access to transfer your ROMs via a Windows PC using WinSCP!

Post by Bubbak » Sat Mar 09, 2019 8:56 pm

I think I screwed something up somewhere and figured I better ask before making it worse... I followed this a few weeks ago, and I ran into an issue with the hostname not recognizing, so I put it back to stock and it works fine. I can connect to it with putty, but after password, the screen is blank.. I don't get another prompt or anything. The wifi is working since I can connect remotely. While I was working on the pi with keyboard attached, I got to this point and was getting not found error -

Code: Select all

root@raspberrypi:/home/pi# cd /etc/wpa_supplicant
I set up the wifi through Attract-mode and when I verify it through that, it looks good. I can't get past this in the tutorial

I am running version 3.83

Post Reply