OctoPi 0.15.1 install-desktop script + xrdp on RPi 3B+

I have a new Raspberry Pi 3B+ and a fresh install of OctoPi 0.15.1 with OctoPrint 1.3.8.

I edited the /boot files and (using a LinuxMint system) edited /etc/hostname and /etc/hosts to change the name to octopi2. The system booted and I was able to connect to OctoPrint successfully.

On my original OctoPi 0.14.0 system. I have executed the ~/scripts/install-desktop, added xrdp, and can connect with Windows Remote Desktop.

On my new OctoPi 0.15.1 system, I did the same thing but when I connect with Windows Remote Desktop, I get a blank screen. I attached an HDMI monitor, USB keyboard and mouse and the desktop comes up on the HDMI monitor.

I'm not sure how to proceed. Any suggestions?

Does that include /boot/config.txt?

hdmi-forcehotplug=1

It did not but I wasn't having problems with the HDMI desktop, only the desktop created with Windows Remote Desktop and it made no difference, still a blank screen. After a while, I get a Connection Log window which contains:

connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login into to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem

"some problem" isn't very useful. Hoping there is something more useful in some log file somewhere, but I have no idea where to start looking. I'm not even sure what other forum would be appropriate because as soon as I say "OctoPi", I think I'm killing any chance of getting help.

If I hit OK on the above window, it goes back to the Xrdp Login window on top of the same teal background.

The problem with a headless Raspi upon POST is that it doesn't register a physical display and the driver stack just doesn't load (or something like that). Then when you show up later and you want the X system to render remotely there's no context to be sent; it's just blank.

By toggling that config.txt setting, it forces the driver stack to load anyway. If I'm guessing correctly and you did that one right, then you'd RDP into a baby screen with like 800x480 resolution or something ridiculous. The next step then is to default the resolution mode to something beefier. This might be it:

hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt=720 480 60 1 0 0 0

Thanks for your help. I tried that and it didn't help.

I think there's either some package missing or some (other) file that needs to be edited or created. I'm going to try another SD card and configure a full Raspbian Stretch and see if I can get Xrdp to work in that configuration. If it doesn't work there, I'll have more options for getting help.

I was hoping someone in this forum would have done the same thing as I'm trying and been successful so they could point out the stupid thing I missed :blush:

I personally VNC into my Black Pearl Conky—themed local Desktop; that's the screenshot that I provided on a different thread. It was of course necessary to run that install-desktop script. I initially did all the work on a local monitor connected to the Pi and then got things so that I could remote in.

I remember fussing with the X configuration. I'm reviewing my setup notes for that and this one seems interesting:

[x] You have run sudo raspi-config and have setup the boot option so that it successfully logs in automatically into the graphical desktop each boot, as well as setting the maximum resolution that the LCD can handle...

And here is my README.md notes from the section where I'm setting it up, noting that the orientation on the TFT still isn't happy and I spend a fair amount of time trying to get the calibration working. The original routine for calibrating TFTs broke in Stretch, for what it's worth. Note that I edit the config.txt several times. I usually document like this so that I can have reproducible results at a later time.

Take this with a grain of salt. This represents about 4 hours' worth of research for all the hiccups involved.


  1. sudo scripts/install-desktop
  2. sudo nano /boot/config.txt
dtparam=i2c_arm=on
dtparam=spi=on
dtoverlay=ads7846,penirq=25,speed=10000,penirq_pull=2,xohms=150
  1. sudo mkdir /etc/X11/xorg.conf.d/99_calibration.conf
Section "InputClass"
        Identifier "calibration"
        MatchProduct "ADS7846 Touchscreen"
        Option "Calibration" "3853 170 288 3796"
        Option "SwapAxes" "1"
EndSection
  1. sudo apt-get update
  2. sudo apt-get install -y libts-bin evtest xinput python-dev python-pip
  3. sudo pip install evdev
  4. sudo apt-get install -y xinput-calibrator
  5. sudo apt-get install -y xvkbd
  6. sudo nano /boot/cmdline.txt
fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
  1. sudo nano /boot/config.txt
dtparam=audio=on
dtparam=spi=on
dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
dtparam=i2c_arm=on
dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1
  1. sudo nano /etc/modules
spi-bcm2835
snd-bcm2835
i2c-bcm2708
i2c-dev
ads7846
flexfb
fbtft_device
  1. sudo nano /etc/modprobe.d/lcd.conf
options flexfb  width=320  height=480  regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3
options fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24
options ads7846_device model=7846 cs=1 gpio_pendown=17  keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900
  1. sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
Section "InputClass"
    Identifier "calibration"
    MatchProduct "ADS7846 Touchscreen"
EndSection
  1. sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
        Identifier      "Allwinner A10/A13 FBDEV"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb1"
        Option          "SwapbuffersWait" "true"
EndSection
  1. Physically add a USB-based keyboard to get past the login prompt
  2. Login after reboot
  3. DISPLAY=:0 xinput_calibrator
Calibrating standard Xorg driver "ADS7846 Touchscreen"
	current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535
	If these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL).
	--> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"ADS7846 Touchscreen"
	Option	"MinX"	"21458"
	Option	"MaxX"	"21822"
	Option	"MinY"	"42359"
	Option	"MaxY"	"44270"
	Option	"SwapXY"	"1" # unless it was already set to 1
	Option	"InvertX"	"0"  # unless it was already set
	Option	"InvertY"	"0"  # unless it was already set
EndSection
  1. sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
  2. sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
  3. sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test
  4. sudo apt-get install libxaw7-dev libxxf86vm-dev libxaw7-dev libxft-dev
  5. cd ~ && git clone https://github.com/KurtJacobson/xtcal && cd xtcal && make
  6. sudo nano /etc/udev/rules.d/95-stmpe.rules
SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"
  1. sudo rmmod stmpe_ts; sudo modprobe stmpe_ts
  2. DISPLAY=:0.0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
# Noting here that the touchscreen still isn't behaving yet.
  1. sudo raspi-config
Set to auto-login for desktop in Boot options
  1. sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer
  2. sudo raspi-config
Turn on VNC under interfacing options
  1. sudo nano /root/.vnc/config.d/vncserver-x11
Authentication=VncAuth
EnableAnalytics=0
Encryption=AlwaysOff
  1. sudo vncpasswd -service
  2. Finder -> Cmd-K -> vnc://pi@charming-pascal.local

My research has come up with 4 instances of your complaint, admittedly using older hardware, and older software, but all 4 exhibit the same problems you're having, and in all 4, the solution was the same

remove xrdp, vnc4server, tightvnc, then install tightvncserver, then install xrdp in that order

It seems that the vnc4server that comes with raspbian conflicts with xrdp, yet, somehow, xrdp USES tightvncserver to function, which I don't quite understand, as I thought it was a standalone product, but in all 4 cases that was the fix.

I admit to not testing it to verify :frowning:

@Spyder Thanks for that but unfortunately, it didn't work. Changed the symptoms just a bit. I got an error from Remote Desktop and it looks like the xrdp process died on the RPi.

What did work was starting from a Raspian Stretch image, add the xrdp package, and it works.

@OutsourcedGuru When I try and use VNC (TightVNC Viewer on Windows) I get:

Error in TightVNC Viewer: No security types supported. Server sent security types, but we do not support any of them.

Since it appears that the VNC running on Raspbian Stretch is from RealVNC, Just for grins I tried their viewer and it works!

Sweet. And presumably you're on a headless Raspi so the X subsystem has a driver stack so you've vetted that just now with the VNC client at least.

If you follow the bouncing README.md above, you have to tweak the VNC server a little to adjust the way it credentials (sometimes). The native method doesn't seem to be super-compatible with the VNC library that others have used, like OSX's Finder program. You can see my attempts at circumventing that, which is successful in my case.

It isn't headless at the moment. I guess I should remove the HDMI monitor, the USB keyboard, and USB mouse, reboot, and see what happens next.

Yep. Because that HDMI config I gave you earlier helps to load the stack when it's headless.

I tried this same modification using a fresh Raspbian Stretch Lite image and it failed the same way. Now that OctoPi was out of the picture, I went to the Raspberry Pi Forums and a search for "xrdp" found the solution...

You have to edit /etc/X11/Xwrapper.config

allowed_users=console
change to allowed_users=anybody

Thanks to all that tried to help me here, I appreciate it.

1 Like