Tag: WinSCP

My raspberry Pi touchscreen arrived but it wasn’t smooth going

My raspberry Pi touchscreen arrived but it wasn’t smooth going

I bought the Longruner (no, not a typo!) 7″ touch screen and it turned up after a few days. It’s nicely made and similar to this, though it looks slightly different. That hand must be a dolls hand!

It doesn’t have any documentation but there was a DVD with three MS Word documents which I opened on my Windows PC (It comes in useful sometimes!). One of them the “7inch HDMI Display user Manual(En).docx” has a photo of the three ports.

There’s a full size HDMI socket and a USB to Android (Micro USB-B I believe) cable is included that plugs into a USB port and either of the Android type ports. You can either have power and touch screen with the port nearest the HDMI as I did or just power alone, if you want to use it as a monitor. The two green squares show the USB and touch/power cables.

When I switched it on, it just sat there saying no HDMI signal. That MS Word document included instructions to edit the config.txt in \boot. Of course I had no display but the Pi was plugged into the network and I ran WinSCP which logged in and let me view files. I don’t think you can edit files as root with WinSCP, and that config.txt file needs root access to edit it.

However I am a long time user of Putty. (You can also get putty from putty.org but I don’t know if that is also an official one). After that I could ssh into the pi, do a sudo -s command to switch in root and then nano /boot/config.txt to edit config.txt.

longruner touchscreen being touchedHere’s a photo of my fat finger moving the cursor round the screen. It works surprisingly well, and the display is lovely though my photos probably do not do it justice.

These are the lines you paste into the end of the config.txt, save it out and reboot.

max_usb_curren=1
hdmi_force_hotplug=1
config_hdmi_boost=7
hdmi_group=2
hdmi_mode=87
hdmi_drive=1
display_rotate=0
hdmi_cvt 1024 600 60 6 0 0 0

Now I just have to figure out how to use it in my games. The display is 1024 x 600 btw.

Plugging in a second monitor worked fine as this photo shows. The blacks are darker on the touchscreen but that’s just because the gammas don’t match and I was too lazy to change them!

Touchscreen and 2nd monitor on Raspberry Pi

Developing for Raspberry Pi without one

Developing for Raspberry Pi without one

Hyper-V RaspberryPi running VS CodeYes it is possible, as the screenshot shows. You can download a copy of Raspbian from Raspberry-pi. You can either download the .iso directly or save them a bit of bandwidth and do it via a file Torrent. It then takes about 15 minutes or so to install it. When you first run it, it will do an update.

It looks exactly like Raspbian on a PI but there are one or two little things to bear in mind. It’s 32-bit, the clipboard doesn’t seem to work and SSH by default is disabled. It’s real easy to enable it, just find Raspberry Pi Configuration. Click the Raspberry in a circle menu button at the top, then click Preferences and there it is on the menu that pops up. In the Interfaces tab, tick the Enabled checkbox for SSH.

I use the excellent WinSCP to connect to it. Conveniently the Pi will show you its ip address (or from a terminal run ifconfig and it will show you the ip address of eth0) and just put that in with username pi and your pi’s password which you should have changed when you set up Raspbian.

Finally you have to install Visual Studio Code and as usual, it’s not quite so easy. Most Linux distros these days are 64-bit and the official VS Code is only available for Debian in 64-bit and Raspbian is of course 32-bit. But there are community builds and it’s the same place that I got the ARM version from.

And here’s the result. A slightly sluggish (well it is under Hyper-V). I had to comment out the code that initialises the audio. Line 580 ish.

/*	int success=Mix_OpenAudio(22050, AUDIO_S16LSB, 2, 8192);
	if (success==-1 ) {
		LogError("InitSetup failed to init audio");
	}
	LoadSoundFiles();
*/

And here’s the results.
Asteroids running on Hyper-V Raspbian