1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Upgrade your Robo R2 to a capacitive 5 inch touch screen (Completed)

Discussion in 'Projects' started by CdRsKuLL, Oct 1, 2018.

  1. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    First, a big thanks to the community on here that helped me with this little project.

    Background
    After watching and reading a lot of reviews on the R2 it seemed to me that the touchscreen could cause some operational issues and sometimes required a stylus. At the time of design and manufacture, it might well be that only a few touchscreen options were available, but now we can purchase a capacitive touchscreen as a replacement.

    What is the difference between resistive (current R2 screen) and capacitive?
    tocuhscreen.PNG

    The resistive touchscreen itself is made up of several layers, the topmost of which flexes under your finger or stylus, and is pushed back onto a layer behind it. This effectively completes a circuit, telling the R2 which part of the screen is being pressed.

    Capacitive touchscreens don’t rely on pressure, but rather they use electrodes to sense the conductive properties of objects, such as your finger. So, they don’t rely on having an object pressing particularly hard on their surface, but will only react to certain objects.

    This makes the capacitive screens far more sensitive and accurate. They also generally look brighter and clearer as they don't require the flexible film on top. Simply put, they operate far better than any resistive screen and a well worthy upgrade to any R2.

    The new screen
    I purchased a Waveshare 5inch HDMI LCD (H) 800x480 from Amazon UK for £56.00. You can get them cheaper but I wanted it next day :) Below is a link for the one I purchased.
    Amazon UK - https://amzn.to/2xLPUdO
    screen.JPG
    The reason I choose this one is it has the same mounting holes as the current one so should be a direct replacement. I say 'should' as I haven't actually got an R2 at the moment :) ......

    Replacing the old screen
    So, Geof has already written a great thread regarding replacing the touchscreen so it's pointless me doing something similar. Please check out his thread here OR if you have a newer R2 then I think you can access all the touchscreen screws and swap without having to take it all apart first.

    The new screen only uses the HDMI and a USB port, it does not use the GPIO ribbon connector so you don't need that anymore.

    Changes you need to get the new screen working
    So, this is where the fun starts. :) First, we will get the screen working, and rotate it by 180 degrees. The current resistive touchscreen in the R2 is installed upside down and it has it's screen rotated 180 degrees. So we need to change it back. To do this we do the following.

    WARNING - Please read everything twice, also take a back up of your current microSD so you can always go back. You are doing this at your own risk.....

    Before you start make sure your R2 is on your network either via Wifi or the Cat5 LAN connector at the back. Also, take note of the name / IP address of it so you can access it later.


    Getting your display to show correctly


    Edit the config.txt file in the boot drive
    First, we need to remove the microSD card from the PI and put it into a PC so we can edit a file.
    When you first insert the card into your reader on your PC you may get a couple of messages about format drive, don't worry just click 'cancel'. Then go to file explorer and view the boot drive that's appeared. Double click on the config.txt file and it will open in notepad.

    config.JPG

    Now in notepad near the bottom, comment out the dtoverlay and the display_rotate. This means put a # in front of them like below

    notepad.JPG

    Click File, then Save and you're done. Put the microSD card back into the PI. You will now have a display that's shows the right way up :)

    Getting your new touchscreen to work

    This is a bit more involved but still not that hard to do. Please make sure you are confident in the below procedure before attempting it.

    Connect via SSH to your R2
    Download Putty onto your PC - https://www.putty.org/ This will let you SSH into your PI and make the required changes. If you are using the newer RoboOS you might need to enable SSH via Octoprint. To do this please have a look HERE

    Now, turn on your R2, it should display as normal but the touchscreen will not function correctly. Give it a minute or so to get connected to your network, then connect to it via putty. You will need your IP address to access it. Mine is 192.168.1.131, your's will be different.

    putty.JPG

    Click open and you should then see a screen like below, if it comes up with a message, just click yes..

    p1.jpg

    Login as pi
    Password is raspberry

    You should then see the following screen

    p2.jpg

    The green bit will say something different but as long as you see the above then you're good for the next bit.

    The easiest way to do the next bit is just copy and paste the below text into the putty terminal. To do this select the below text, copy.. then click on the green block in the terminal and just right click. The text will then appear and you just click return.

    In the putty terminal write.. and press enter

    cd oprint/local/lib/python2.7/site-packages/kivy

    p3.jpg

    Then write
    nano ~/.kivy/config.ini

    The following screen will appear. Press your down arrow key until you come to the [input] section. You need to edit this so it looks like the screenshot. The lines you need to add are

    mouse = mouse
    mtdev_%(name)s = probesysfs,provider=mtdev
    hid_%(name)s = probesysfs,provider=hidinput

    p4.jpg

    Now save the changes by pressing ctrl 'X', It will ask you if you want to save, press Y and enter. It will confirm the name, just click enter and you're done.

    Type the following and say yes when asked. This is just updating missing components.

    sudo apt-get update
    sudo apt-get install xserver-xorg-input-libinput
    sudo apt-get install mtdev-tools
    sudo reboot

    Your R2 will then reboot and you should have a fully working touchscreen :)..

    You can now sit back and enjoy the fluid frontend of the R2 in all its glory. Oh and whilst you have a smile on your face, stick the old stylus on eBay as you won't be needing it again!

    Huzzah !!!

    Thanks,

    Steve
     
    #1 CdRsKuLL, Oct 1, 2018
    Last edited: Oct 1, 2018
  2. EmbraceNext

    EmbraceNext New Member

    Joined:
    Jun 23, 2018
    Messages:
    11
    Likes Received:
    3
    You have done it! This is awesome! You filled in the missing holes and now I am able to use my touch screen. How did you find what to put in the kivy config.ini file?
     
    mark tomlinson likes this.
  3. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Hey EmbraceNext,

    Thanks :) It took a lot of googling and just trial and error really. WheresWaldo put me on the right track as I didn't know anything about Kivy beforehand. So it's all his fault.. lol

    I did notice a slight off-set as the actual screen isn't central in its housing, so there will be a small difference now you don't have to mount it upside down. I would be very interested to see some images once installed. I will hopefully be getting my R2 next week, fingers crossed.

    Thanks,

    Steve
     
  4. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Okay, been doing a bit of thinking and because the screen isn't quite central we might need to mount it upside down copying the original screen orientation. I think we can get away with using the existing hdmi plug as it will move it back out of the way. The other cable is the usb which is there anyway.. So when I finally get hold of an R2 I'll confirm either way.. However for reference to invert the new touchscreen you will need to change a setting in Kivy (The one you added the [input] details above. .. and in splash.sh

    So when you edit Kivy - config.ini file above you also need to set the rotation to 180 like below;
    Rotation = 180
    This is above the [input] section.

    This rotates the screen 180 degrees, which is what we want.. However, the Robo boot logo is still the right way up. So, to invert the boot logo you need to edit splash.sh, to do this you need to do..
    sudo nano /etc/init.d/splash.sh
    Then you need to add in --orientation 180, so it looks like below
    omxplayer --orientation 180 --aspect-mode fill /etc/init.d/splash.mp4 & exit 0

    Save, and sudo reboot.. and the logo will be rotated now :)

    I have read that using this method reduces the load on the CPU rather than using the screen_rotate which is currently used. No idea if this is true.

    You might have noticed the actual boot logo is a mp4 video file.. I might do a new loading screen if I get chance. :)

    Thanks,

    Steve
     
    #4 CdRsKuLL, Oct 2, 2018
    Last edited: Oct 2, 2018
    WheresWaldo likes this.
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    Got my screen from Amazon & Waveshare today. Going to play around with it for a bit then install it in my R2. It is definitely brighter than the screen that comes in the R2, and I played a bit with the OSD menus.

    @CdRsKuLL did you get your R2 yet?
     
    #5 WheresWaldo, Oct 7, 2018
    Last edited: Oct 7, 2018
  6. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Hey WheresWaldo,

    Sadly not, should be this week fingers crossed :) The seller has been away so I've had to wait.

    I was busy this weekend and did install a touchscreen / MKS Board and PI into my Z603s printer. What I did find out doing this is you will need to install the new screen upside down like the one in the R2 otherwise, you will be missing about 4mm of the screen at the bottom.

    So, you will need to do change rotation in the Kivy config.ini and rotate the boot video with the instructions above. I'll upload the boot screen to the other thread in a bit I did.

    The HDMI lead should just pull out off the old board and plug in this new one, still using the U type connector. You will have to let me know if the included USB lead with the new screen is long enough, it should be but its hard to tell just from photos.

    This was my weekend project as well as making a start designing up a BB-9 droid to put my Google home in :)

    jg10.jpg jg4.jpg jg6.jpg jg13.jpg

    I've still got to finish the image, add the camera and wire up some LEDs... Then I want to add a spring steel plate with PEI, removable with a pinda level sensor on it.. Oh, and I might even add a filament sensor too.. Not that I really need another printer but I really enjoy the challenge. Oh, and the reason I changed the motherboard.. so I can add some TMC2130 !!

    Please let me know how you get on with the screen, if you can get some photos so I can include them in a full write up that would be great.

    Thanks,

    Steve
     
    mark tomlinson likes this.
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    So I installed the touchscreen this morning and I am adjusting the display now. Several things to consider;

    1. You must install the screen upside down, it will match the original screen that way.
    2. The Robo supplied HDMI cable is too short, you need about 8 inches and the 6 inch cable doesn't reach.
    3. Using a regular HDMI cable works and you don't really need the U shaped HDMI adapter.
    4. You lose the USB slot next to the screen, both the HDMI cable as well as the USB cable required for the touchscreen interfere with the mounting of the USB port.
    5. The screen is physically thicker than the original screen, it required the use of about 2 mm of spacers under all four mounting screws to prevent bending the circuit board.
    6. All screen adjustments must be done before screwing everything back in, you have no access to the OSD menu or buttons after the printer is reassembled.
    7. Beware the front panel, mine was not a friction fit, there was some adhesive on each tab and some of them broke off when removing the front panel. The screws behind it actually hold it in place so I am not sure why there was adhesive at the tabs.
    8. I would recommend making an image of your Robo supplied microSD card and replacing it with a Class 10 / UHS 1 microSD of higher capacity. First the higher class card will allow the boot up and menu to be quicker (marginally) and the added capacity will make up for losing the front USB port. A 32GB Samsung EVO is always a good choice and usually on sale very other week at Best Buy.
    For µSD imaging on Windows, Win32DiskImager works really well.
     
    #7 WheresWaldo, Oct 8, 2018
    Last edited: Oct 8, 2018
    Geof and CdRsKuLL like this.
  8. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Great news you got it working. If you used the original U HDMI and maybe an elbow micro USB can you still keep the front USB port do you think?

    Also. do you think it was a worthwhile upgrade? ... oh, and photos, we all like photos :)
     
    Dan Verdi likes this.
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    It would still be a tight fit and you either need to reverse the rPi in the bottom of the case or get a longer one to make it reach, and it still might not fit without putting pressure on the LCD circuit board. I didn't want to do all that much work and I don't use the front USB.
     
  10. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    It's in and working. much more responsive than the resistive screen, also appears to be brighter with better contrast, especially since it has a limited range of adjustability. Now I need to model and print a cover for the hole left by the USB adapter.

    Now what is left is to do an,
    Code:
    sudo apt-get dist-upgrade
    to get all held back packages updated. Then onto updating to Raspbian Stretch.
     
    #10 WheresWaldo, Oct 8, 2018
    Last edited: Oct 8, 2018
  11. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Have you put the new boot splash on yet? Also, let me know if the dist-upgrade works. I tried upgrading octoprint last night. It upgraded fine but RoboLCD would no longer display. Didn't look into it too much as it was already 1am and I needed to be up for 6:30am for work.

    Steve
     
  12. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    There are issues with RoboLCD and RoboOS, seems like Robo would just as soon forget about upgrading it. There used to be a repository for both, it uses a lot of OSS software but all my requests for source have been ignored.
     
  13. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    No I didn't install the new splash, I am going to create my own in GIMP. On the new screen you can see how poorly the original splash was rendered, a lot of artifacts around the Robo logo.
     
  14. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    It's a shame they decided not to release the source anymore.

    I've just run the sudo apt-get dist-upgrade and it's rebooted fine :) just backing it all up now. It even connected 1st time to my motherboard which it wasn't doing before.. so thanks for that :)
     
  15. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,338
    Likes Received:
    7,035
    Technically on some of it they are required to.
     
    Geof and WheresWaldo like this.
  16. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    jg14.jpg Hopefully, I'll have my R2 by the end of the week now.. Until then, at least I have something to play with....
     
    Geof and mark tomlinson like this.
  17. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    @CdRsKuLL

    apt-get dist-upgrade only updates held back packages and cleans up dependencies. If you want to upgrade from Jessie to Stretch (I am in the middle of that right now) you have to update your /etc/apt/sources.list to include new Stretch repositories. Then do the sudo apt-get update || sudo apt-get upgrade followed by the sudo apt-get dist-upgrade
     
    Geof likes this.
  18. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,817
    Likes Received:
    3,539
    Geof likes this.
  19. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,338
    Likes Received:
    7,035
    I made sure I updated both /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list

    Just to be sure :)
     
    Geof likes this.
  20. CdRsKuLL

    CdRsKuLL Member

    Joined:
    Sep 27, 2018
    Messages:
    81
    Likes Received:
    34
    Just upgraded mine.. wasn't the easiest but I got there in the end. I'm just backing the SD card up now I've finished..

    Some photos below;

    Old screen
    [​IMG]
    New screen
    [​IMG]
    New screen fitting with some washers underneath to make up the space
    [​IMG]

    I had to trip some of the plastic off the usb socket.. nightmare getting it all to fit. Also had to remove the plastic from the usb touch screen plug. I then recovered it in shrinkwrap
    [​IMG]

    My advice would be to buy some tiny 90 degree usb cables and maybe try and source a smaller hdmi cable.
    [​IMG]
    You can see what I've trimmed off here. It still sits at a slight angle but I can use the usb port now.

    I've managed to break the case LED's, as they aren't lighting up now, but I will be replacing them soon anyway.

    1st upgrade done.. hmm I wonder whats next. :)
     
    #20 CdRsKuLL, Oct 12, 2018
    Last edited: Mar 26, 2019

Share This Page