Author Archives: Alan

About Alan

Alan Renouf has a role of Automation Frameworks Product Manager at VMware responsible for providing the architects and operators of the cloud infrastructure with the toolkits/frameworks and command-line interfaces they require to build a fully automated software-defined datacenter. Alan is a frequent blogger at http://blogs.vmware.com/vipowershell and has a personal blog at http://virtu-al.net. You can follow Alan on twitter as @alanrenouf.

Edge Compute at VMware Explore Barcelona

Recently I started a new role at VMware focusing on the edge as part of the Service Provider & Edge Business Unit, I was excited by this move as the edge has been a focus point of mine for the last year now working in OCTO on Project Keswick.

There are so many aspects I am excited about working on edge compute, the most exciting part has to be the use cases I am seeing at the edge, these are totally different to the datacenter and are so much closer to the core business processes and critical to modernization of the features which have often long existed but are looking to be done in a faster, more resilient and more economical way. Anyway, more to come on this as I bring my blog back to life and start to focus more on everything edge related.

Lets start the ball rolling with some great ways to learn more about this exciting area of IT, coming up soon is VMware Explore Barcelona 6-9 Nov, I will be there talking to customers, partners and analysts and presenting the latest and greatest information from VMware.

My Sessions and whereabouts

If you are as excited about the edge as I am or would just like to chat please reach out to me, I would love to catch up and chat, hit me up on twitter (I cant bring myself to call it x) at @alanrenouf. You can also find me at my sessions below or at the edge booth in the solutions exchange.

Session ID / LinkTitleSpeakersSession TypeDate / Time
1999VMware Edge Compute Stack Reference Architecture Deep DiveMichael Wright, Sven Gmelin, Alan RenoufTutorialMonday, Nov 6 1:00pm – 2:30pm
CTEX VMware Edge Cloud Orchestrator – Scaling & deploying ESXi and Kubernetes at the Edge with Desired State Management & GitopsAlan RenoufCTEXTuesday 7th 11.45am – 12.45pm
23386VMware {code} Hackathon  – MUST ATTENDCome along and enjoy some fun, you don’t have to be able to code!HackathonMonday, Nov 6
12:45 PM – 1:00 PM

Edge Keynote Related Sessions

These are a must watch, full of awesome new announcements, new tech and fantastic customer stories:

ID / LINKTitle
SPeakersSESSION TYPEDAT / TIME
2161Solution Keynote: Everything Everywhere All at Once – Living on the Edge with VMware Sanjay Uppal & OthersKeynoteTuesday, Nov 7 2:45 PM – 3:15 PM
2157Technology Innovation Showcase Kit Colbet, Chris Wolf and othersKeynoteTuesday, Nov 74:00 PM – 5:00 PM 

Edge Compute Sessions

There will be lots of great sessions from my colleagues, partners we work with and customers who are doing awesome things at the edge, I am going to try and attend as many as I can

Session ID / LinkTitleSpeakersSession TypeDate / Time
1188Why ZEISS Semiconductor Will Virtualize Their Factory SystemsStephan Wolf, Martin Spaniol, Lars BischofBreakout Weds, Nov 8 – 2:00pm – 2:45pm
1643Energy Industry RoundtableAlexandra Baleta, Olga Grbovic, Chris MutchierTutorialMonday, Nov 6 – 4:00pm – 5:30pm
1663A New Era for Manufacturing:  Keep the World Moving, No Matter WhatSaadat Malik, Alexandra Baleta, Ronny Hendrych, Henning Loeser, Lars BischofTutorialMonday, Nov 6 – 2:00pm – 3:30pm
1718Retail Digital Transformation and the Future Store of TodayRyan Wehner, Stephen Byrne, Andre Schaefer, Arron LockTutorialMonday, Nov 6 – 2:00pm – 3:30pm
1987What’s New in Edge Compute Stack?Saadat Malik, Anand SrinivasBreakoutTuesday, Nov 7 – 10:30am – 11:15am
1992Edging Ahead Data-Driven Decisions for Edge AI with RabbitMQ and OpenVinoMichael Wright, Roger FreixaBreakoutThurs, Nov 9 – 12:30pm – 1:15pm
2000Transforming Utilities with VMware Edge Compute StackDavid Fry, Kennet NymanBreakoutWeds, Nov 8 – 3:15pm – 4:00pm
2001Transforming the Retail Experience with VMware Edge Compute StackCharles Cockshoot, Abhilasha ChoudhriBreakoutWeds, Nov 8 9:00am – 9:45am
2002Are you afraid of adopting Private 5G? Address your Fears with VMware PMNRam VenketaramaniBreakoutWeds, Nov 8 – 12:45pm – 1:45pm
2003VMware Edge Compute Stack – Practical Use Cases and SolutionsKangwarn Chinthammit, Martin Krentzer, Ben BrillatBreakoutTuesday, Nov 7 – 11:45am – 12:15pm
2005Ask Us About Edge Compute Stack and Edge Use CasesKangwarn ChinthammitMeet The ExpertsTuesday, Nov 7 1:30 PM – 2:00 PM & Wednesday, Nov 8 2:30 PM – 3:00 PM

Solutions Exchange

Make sure you also head to the VMware booth in the solutions exchange, I will be hanging around the edge area as there will be a lot of exciting demos and booths showing what we can do with Edge Compute, make sure you check out the lego manufacturing demo!

Looking forward to seeing you there!

Using Hugging Face Code Autocomplete in VSCode to help with PowerShell and PowerCLI Scripts

Whilst at VMware Explore this year I was introduced to Hugging Face Code Autocomplete plugin for Visual Studio Code as part of the SafeCoder announcement.

In the keynote demo Chris Wolf showed how SafeCoder could be used to safely complete some python code using a machine learning model which had been trained on the internal VMware code base, it gave great results and showed how using code completion can be safely used by providing an on-premises solution, SafeCoder made sure your company’s core IP or code was not sent to a public service and shared with the world whilst giving you the benefit of code assisted development.

I was intrigued by the demo and wondered how easy it would be and what kind of job the Hugging Face Code Autocomplete plugin for Visual Studio Code would do with PowerShell and specifically PowerCLI Code. Imagine having a LucD sat over your shoulder as you type, suggesting what your code should look like… well its not quite as amazing as Luc, I mean we all strive for that!

I was however impressed, below you can see a quick gif of me using it to create some comments about what I want to do it and it filling out the code as I do so, this is an awesome head start to creating your own scripts and learning.

Note: The current implementation uses the Hugging Face API and model which was trained on the internet so the data wont be 100% accurate, it will do a great job of giving you the fundamentals but rounding the edges and ensuring the script does what you need it to do will be your responsibility!

Hugging Face Code Autocomplete plugin for Visual Studio Code

Installing Hugging Face Code Autocomplete in VSCode

  1. Install VS Code if you don’t have it already.
  2. Install the VS Code plugin from here.
  3. Sign up for a Hugging Face account (free), you will need this for the plugin to access their API.
  4. Setup an API token which you can use for VS Code to access the Hugging Face API.
  5. In VS Code press Cmd/Ctrl+Shift+P to open VSCode command palette.
  6. Type: Hugging Face Code: Set API token.
  7. Paste your API token into the plugin.
  8. You are done! I normally type #PowerShell Code as my first comment to help it know that’s what i expect and not some other language.

Monitoring processes inside a vm with PowerCLI

As part of a large scale data analysis project I was working on recently I used Horizon View and Instant clones to allow me to deploy hundreds of VMs based on my original templated VM which had my app I wanted to use to take in the data, transform it and then return a result. Its important to note that this app was never written to work in a batch mode, it literally took one input and gave an output based on a number of factors.

Whilst this post is not about the benefits of Instant Clones, let me tell you, once I had the original template VM working correctly and optimized for performance it worked like a charm, there is something to be said for the simplicity and efficiency of instant clones and the memory sharing techniques it uses to be able to run hundreds of essentially the same VM.

Once I had these VMs deployed via Horizon I could easily send a job to each VM and tell it to run the job, as these jobs however took an indeterminate amount of time to crunch the data, I needed a way to monitor them and let me know when all the jobs had finished on all the VMs so I could pull the data to analyze it.

First I went down the route of using Invoke-VMScript to hook inside the VM’s and see if the process was running, this however took a long time to complete on 100’s of virtual machines and the monitoring job often took over 20 minutes to monitor the VMs and tell me if the job was completed… far too long for what I needed. So after some googling I learned from my good friend William Lam that there was a new API available that through VMtools would update the GuestInfo with the processes running inside the VM on a configurable timely basis (see his post here), this allowed me to essentially push the information externally to the VM Guest Operating system and grab the info when I needed it to see if my process was running.

William had also written a handy function which I adjusted to work with an array of VMs and tell me if the process was running.

Using these new found skills I was easily able to write a function that allowed me to pull the running processes from the VMs and remove them from the list as that process finished inside the VM, for the icing on the cake I even got it to update me in slack on how it was doing 😉

So i thought I would share this script and encourage you to think about using this way which is much easier and a more performant way to pull the results of the running processes..

Monitoring Script

Function Send-SlackMessage ($Channel = "#MyProjectChannel", $Message) {
        
    $payload = @{
        "channel"    = $Channel
        "icon_emoji" = ":datacenter:"
        "text"       = $Message
        "username"   = "DC Script"
    }

    Invoke-WebRequest `
        -UseBasicParsing `
        -Body (ConvertTo-Json -Compress -InputObject $payload) `
        -Method Post `
        -Uri "https://myslackhookurl" | Out-Null
}

Function Get-VMApplicationInfo {
<#
    .DESCRIPTION Retrieves discovered applications running inside of a VM
    .NOTES  Author:  William Lam
    .NOTES  Site:    www.virtuallyghetto.com
    .NOTES  Reference: http://www.virtuallyghetto.com/2019/12/application-discovery-in-vsphere-with-vmware-tools-11.html
    .PARAMETER VM
        VM Object
    .PARAMETER Output
        CSV or JSON output file
    .EXAMPLE
        Get-VMApplicationInfo -VM (Get-VM "DC-01")
    .EXAMPLE
        Get-VMApplicationInfo -VM (Get-VM "DC-01") -UniqueOnly
    .EXAMPLE
        Get-VMApplicationInfo -VM (Get-VM "DC-01") -Output CSV
    .EXAMPLE
        Get-VMApplicationInfo -VM (Get-VM "DC-01") -Output JSON
#>
    param(
        [Parameter(Mandatory=$true)]$VM,
        [Parameter(Mandatory=$false)][ValidateSet("CSV","JSON")][String]$Output,
        [Parameter(Mandatory=$false)][Switch]$UniqueOnly
    )

    $appInfoValue = (Get-AdvancedSetting -Entity $VM -Name "guestinfo.appInfo").Value

    if($appInfoValue -eq $null) {
        Write-Host "Application Discovery has not been enabled for this VM"
    } else {
        $appInfo = $appInfoValue | ConvertFrom-Json
        $appUpdateVersion = $appInfo.updateCounter

        if($UniqueOnly) {
            $results = $appInfo.applications | Sort-Object -Property a -Unique| Select-Object @{Name="Application";e={$_.a}},@{Name="Version";e={$_.v}}
        } else {
            $results = $appInfo.applications | Sort-Object -Property a | Select-Object @{Name="Application";e={$_.a}},@{Name="Version";e={$_.v}}
        }

        Write-verbose "Application Discovery Time: $($appInfo.publishTime)"
        if($Output -eq "CSV") {
            $fileOutputName = "$($VM.name)-version-$($appUpdateVersion)-apps.csv"

            Write-Host "`tSaving output to $fileOutputName"
            ($appInfo.applications) | ConvertTo-Csv | Out-File -FilePath "$fileOutputName"
        } elseif ($Output -eq "JSON") {
            $fileOutputName = "$($VM.name)-version-$($appUpdateVersion)-apps.json"

            Write-Host "`tSaving output to $fileOutputName"
            ($appInfo.applications) | ConvertTo-Json | Out-File -FilePath "$fileOutputName"
        } else {
            $results
        }
    }
}


Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ErrorAction SilentlyContinue -Confirm:$false -DisplayDeprecationWarnings $false | out-null
$ProgressPreference = 'SilentlyContinue'


Connect-viserver vcsa-01a.myenv.local -username Administrator@vsphere.local -password VMware1! | Out-Null
$vms = get-vm InstantCloneVM* | Where-Object {$_.PowerState -eq "PoweredOn"} | Sort-Object Name
Send-Slackmessage -message "Monitor Job Started" 
do {
    foreach ($vm in $vms) {
        Write-Host "Checking $VM status..."
        $result = Get-VMApplicationInfo -VM $VM| Where { $_.Application -eq "MyAppProcess.exe" }
        if (!$result){
            Write-Host "Removing $vm as it has completed"
            $vms = $vms | where { $_.Name -ne $vm.name}
        } else {
            Write-Host "$vm still running"
        }
        if (($vms.count -lt 10) -and (! $sentmail)){
            Send-Slackmessage -message "Less than 10 Sigma VMs left"
            $sentmail = $true
        }
    }
    if (! ($oldnumvms -eq ($vms.count))){
        Send-Slackmessage -message "$($vms.count) VMs still running"
    }
    start-sleep -s 30
    $oldnumvms = $vms.count
}
while ($vms)
Send-Slackmessage -message  "All Jobs Completed"

Talking Virtual Reality with today’s teens

Recently I was honored to be asked to talk about Virtual Reality with a good friend of mine, Andrew Boose. He has been a keen follower of VR and whenever we met he would always have a keen interest in what was going on in the VR space and what was coming next.

His awesome parents of course encouraged this hobby and purchased him his first VR headset, the Quest 2… A great choice if you ask me.

Unlike most kids his age Andrew understands that these devices are more valuable than just playing games and recently asked me to jump on a podcast with him to record some of our thoughts on how these devices are being used outside of the gaming circles,

In this 20 minute podcast we discuss a variety of topics like:

  • How I use VR in my job
  • How I see VR being used in enterprise companies
  • Some of the ways we are using VR at VMware
  • What we think the future holds for VMware

TalkingVirtual Podcast – Andrew Boose (age 16) – 20 minutes 09 seconds

I want to thank Andrew for the interesting discussion and for being interested in such an awesome technology at such a young age. Andrew has a bright future ahead of him!

Building an Arcade Cabinet

After my house burnt down recently I needed something to relax me and remove some of the stress of day to day work, filling out endless insurance documents or thinking about what needed to be done to build our next house was getting to me, this kind of stress is common place at the moment, something I see a lot of people can relate to in these pandemic times!

For a while now I have been looking into building an Arcade Cabinet but never really found time to do it.

Given my unique point in life where I literally own nothing, and as something fun to do I set about watching YouTube videos, talking to friends and searching the web for how to put one together and what I would need.  I found my stress relief project!

The idea in this blog post is not to claim I am now an expert at building Arcade cabinets, far from it, its more to share my experience as I cam from knowing nothing and there were questions I had that I had to look in multiple places to answer, this will hopefully provide someone some useful information and help them.

Continue reading

Screen Sharing and Recording a Oculus Quest 2 with a Windows or Mac Computer

With the Oculus Quest 2 coming out recently and having a new better screen resolution, the previous command line options for Oculus Quest 1  screen sharing I blogged don’t quite work for a good sharing mechanism.

I have played around a little and have come up with some numbers that work quite well with scrcpy, follow the below details to install the packages needed and get up and running with screen sharing of the Oculus Quest 2.

Initial Install and Setup

  1. Enable developer mode on your Oculus Quest 2 (https://www.youtube.com/watch?v=1PTFkLnJRLs)
  2. Plug the USB-C cable into your computer and the Quest, this also works with USB to USB-C
  3. If its your first time plugging into this computer you will need to accept the prompt within the device that allows you to access the device from the computer as per below and check the box to always allow if you want to skip this section in the future
  4. For Windows download and unzip the latest build of scrcpy from https://github.com/Genymobile/scrcpy/releases a direct link for the current version when writing this is here: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip
  5. For Mac the application is available in Homebrew. Install it using the following from a terminal window:
    brew install scrcpy
  6. You will also need adb. you can install this by running the following from a terminal window:
    brew cask install android-platform-tools

Sharing the Screen connected via cable

  1. Open a command prompt (cmd.exe) or and CD into the extracted folder from above
  2. Run the following command:
    scrcpy--crop 1632:1220:100:320 -m 1600 -b 25M

Sharing the Screen connected wirelessly

You will still need a cable to make an initial connection and start the client on the Quest and then you can disconnect and use wirelessly, use the following steps to connect wirelessly:

  1. Follow steps 1-4 above in the setup section
  2. Open a command prompt (cmd.exe) and CD into the extracted folder from above
  3. While the device is connected via a cable run the following to find out what your Quests IP address is in the src section:
    adb shell ip route
    192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.198
  4. Now run the following replacing the IP address below (192.168.1.198) as yours:
    adb tcpip 5555
    adb connect 192.168.1.198:5555
  5. Disconnect the cable from the PC and with the device disconnected run the command to connect to the device as below
scrcpy --crop 1632:1220:100:320 -m 1600 -b 25M

Sharing Window

If everything worked above a new window should appear showing the device screen, you can then maximize this for a better demo window.

Testing was done with variations of the scrcpy command but the above was found to be the best viewing size to enable a good demo.

Recording the screen

There is also a great way to capture the screen while mirroring, add the following command options to the end of the scrcpy command above to do this:

 --record file.mp4

To disable mirroring while recording:

 --no-display --record file.mp4

Troubleshooting

Connection Issues

If you get a blank window or are unable to connect when device is plugged in you should be able to run the following command from the same folder above:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 device

The device should show above rather than:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 unauthorized

If you get the latter then make sure you have enabled developer mode and authorized the device as per step 1-3 above.

Target Machine refused connection when in wireless

If you receive a message like the following: “cannot connect to 192.168.1.198:5555: No connection could be made because the target machine actively refused it. (10061)”

Reconnect the Quest to the computer and go from Step 3 in the wireless connection steps above, this is caused because the client on the quest stopped, normally as you reset the device.

Thank You Everyone!

“Thank You”…. words that just really do not convey the magnitude of what I am feeling right now for friends, family, my VMware colleagues and the vCommunity.

I have always prided myself on being the person who helps others, whether its through my blog, my scripts, being a PM and pointing my products in the right direction or just in general life, I have enjoyed being the one who supports others…. recently the shoe has been on the other foot.  As I’m sure most of you know by now, my family home was completely obliterated by the CZU Lightning Complex Fire along with 100’s of other houses.  We were evacuated at 3AM in the morning and were able to grab the basics like passports, a change of clothes and most importantly the family were able to escape safely to a nearby town and a friends house.

We had the bad news a few days after, everything we have ever owned was destroyed 🙁

We are completely overwhelmed and thankful for the incredible response to the Go Fund Me account and Venmo account that was set up for us by friends and contributed to by 100’s of people.

We can’t describe how we are feeling very well as every hour brings a roller coaster of emotions, we have such highs when we see how much everyone wants to help us and how much we are loved and then we have such lows when we remember the little things that we have lost, the kids yearbooks, cheer and softball trophies, all my youngest sons toys and books, My wife’s Tupperware collection, My clown picture that terrified me as a child, so when my Nan passed away of course that was what I wanted from her house!!

This incredible amount of money will make such a difference, there is so much that we have to organize and pay out for even before we can get up to our land and find out where we even begin to start.

Again we thank each and everyone of you that has so generously donated to us, no money can’t buy you happiness, but it can buy peace of mind and at the moment that’s priceless, without this fund we would have no peace of mind and I can’t imagine how much harder that would make this horrendous situation.

I hope people reading this never have to go through this kind of experience, especially with children, my biggest worry is making sure I provide a stable environment for them.

I have no doubt we will rebuild a better, bigger house once everything is all sorted out and I work through the insurance mine field! My family arrived in America 8 years ago with 8 suitcases and now we are starting again, we know we can do this as the amount of friends we have made is clearly visible through the support we are getting at the moment!

During the bad times there were definitely things that brightened our spirits, far too many to mention here as the help and comments and messages were literally hundreds a day, here are a few that my family found touching, inspiring and funny…

  • The Matlocks, you are amazing! Everything you do for us is fantastic, we are so lucky to have you
  • Pat Gelsinger and the entire C level team at VMware for helping me in every way possible they could
  • Matt Coppinger for being there for me when I melted down in the midst of all the stress!
  • Duncan, Cormac, William, Frank, we have been together since the start and I don’t know what I would do without you guys.
  • Tina & Rick Walsworth, you are amazing, enabling us to get back on our feet in the darkest of our times and have a fresh mind while we worked on insurance and next steps.
  • Andy Banta for making me laugh when my wife couldn’t understand why the donated amount was $256 – Anyone in IT will get the joke!
  • Michael Dell for reaching out to me and making sure we were ok
  • Chris Wolf (You know what you did! WOW!)
  • Tisa Murdock – You really touched our hearts, thank you!
  • My team for picking up the slack while I wasn’t around and we still had deadlines to meet
  • The Rolen Clan, the Adams Family, the Boose Family, all our other friends who were there for us, what ever we needed!
  • Bess and her team at Studio 3 Design for helping us move forward and thing about the memories we want to make in our new home!
  • The vCommunity, I have known the VMware community has been special since I joined it but it astounds me just how fantastic it really is and how much people help and care for each other!
  • The comments on the Go Fund Me page kept us going, my family read every one of them and loved them.

Again, if I didn’t mention you its not that I don’t appreciate you its just that my brain is still fried from working things out! Thank you.

THANK YOU ALL!

And finally a few more pics from the rubble which I will one day print out…

 

Screen sharing and recording a Pico Neo2 with Windows or Mac

Recently I have been using the Pico Neo2, a 6DOF device with is comparable to the Oculus Quest and works pretty well for enterprise use cases.

Compared to other headsets it is a lot more open when it comes to working with and managing the operating system, in developing for the headset there were occasions when I needed to share or record the screen to show others what I was seeing.

As with sharing the Quest, previously written about here, Screen Copy (scrcpy) came in very handy with the right configuration for the headsets display.

One thing that is rather annoying about the Pico is that it loves to change screen resolution when you are using it, mainly when accessing what was previously a 2D android based app or settings dialog etc.  In VR you wont really notice the difference as they do a great job of handling the 2D apps and giving you an immersive space to work with them but when using scrcpy you often see the output completely change.  The only workaround I have found for this is that when a 2D screen appears and messes up the screen display, just run scrcpy with no parameters.  This will default to the resolution of the screen and show you the 2D dialog, as soon as you go back into VR mode though you will need to relaunch scrcpy in the below way otherwise you will get a 2 Eye output.

But for most experiences in VR you can use the below instructions to display and record the screen.

Initial Install and Setup

  1. Plug the USB-C cable into your computer and the Pico Neo2.
  2. If its your first time plugging into this computer you will need to accept the prompt within the device that allows you to access the device from the computer and check the box to always allow if you want to skip this section in the future
  3. For Windows download and unzip the latest build of scrcpy from https://github.com/Genymobile/scrcpy/releases a direct link for the current version when writing this is here: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip
  4. For Mac the application is available in Homebrew. Install it using the following from a terminal window:
  5. brew install scrcpy
  6. You will also need adb. you can install this by running the following from a terminal window:
  7. brew cask install android-platform-tools

Sharing the Screen connected via cable

  1. Open a command prompt (cmd.exe) or and CD into the extracted folder from above
  2. Run the following command:
  3. scrcpy --crop 1280:1776:400:60 -m 1600 -b 25M

Sharing the Screen connected wirelessly

You will still need a cable to make an initial connection and start the client on the Neo2 and then you can disconnect and use wirelessly, use the following steps to connect wirelessly:

  1. Follow steps 1-4 above in the setup section
  2. Open a command prompt (cmd.exe) and CD into the extracted folder from above
  3. While the device is connected via a cable run the following to find out what your Quests IP address is in the src section:
  4. adb shell ip route
    192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.198
  5. Now run the following replacing the IP address below (192.168.1.198) as yours:
  6. adb tcpip 5555
    adb connect 192.168.1.198:5555
  7. Disconnect the cable from the PC and with the device disconnected run the command to connect to the device as below
scrcpy --crop 1280:1776:400:60 -b 25M

Sharing Window

If everything worked above a new window should appear showing the device screen, you can then maximize this for a better demo window.

Testing was done with variations of the scrcpy command but the above was found to be the best viewing size to enable a good demo.

Recording the screen

There is also a great way to capture the screen while mirroring, add the following command options to the end of the scrcpy command above to do this:

 --record file.mp4

To disable mirroring while recording:

 --no-display --record file.mp4

Troubleshooting

Connection Issues

If you get a blank window or are unable to connect when device is plugged in you should be able to run the following command from the same folder above:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 device

The device should show above rather than:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 unauthorized

If you get the latter then make sure you have enabled developer mode and authorized the device as per step 1-3 above.

Target Machine refused connection when in wireless

If you receive a message like the following: “cannot connect to 192.168.1.198:5555: No connection could be made because the target machine actively refused it. (10061)”

Reconnect the Pico to the computer and go from Step 3 in the wireless connection steps above, this is caused because the client on the Pico stopped, normally as you reset the device.

Immersive Education in Virtual Reality – Your chance to join in

Education, its one of those subjects that’s front of mind for me at the moment, anyone who has children will know that recently and under current circumstances with the pandemic, the kids and teachers are finding it hard to provide an alternative learning experience, one that allows the teacher to give great content and engage the children, but at the same time give the children the interaction and social aspects they need for a good learning experience.

For a long time now it bugs me that the way we teach has not been modernized for decades, the classrooms and content may have changed but the way we teach is still fundamentally the same.

The team I work on did some early prototyping on some of the key use case subjects we saw in XR and one of these was education, since then I have been sold that this medium allows for a much more enriched learning experience and with COVID-19 more recently it has only reinforced my thoughts on this subject.

I have seen lots of great articles on VR in Education (one of my favorites here) and they are normally aimed at college students.  Having a child myself who is just about to enter high school I felt like she should also be able to take advantage of this medium and new way of learning, then when browsing LinkedIn recently I found a great offer which I wanted to share so that others could take advantage of it.

No alternative text description for this image

Wendy Martin, who was a national finalist for teacher of the year is teaching a four week class about Biological Form and Function in Virtual Reality using  VictoryXR and it is aimed at high school or smart middle school students as is a group collaborative experience.

This also hits on another great reason to use VR, no frogs will be harmed during this lesson! (only virtual frogs).

VictoryXR is a VR Educational Platform and is being used to provide this learning experience, it is available for $165 per year for the Academy or VicrotyXR.Direct is $10 per month per headset.

The additional cost of this training from Wendy is $40, but they are providing a coupon code for 50% off: VXRWM50

The course will be four sessions, with independent activities during the week and the following dates/times are available:

Tue, July 14th @ 11:00 Anatomical Form & Function
Tue, July 21st @ 11:00 Evolutionary Form & Function
Tue, July 28th @ 11:00 Genetic Form & Function
Tue, Aug 4th @ 11:00 Viral Form & Function

Can’t make it? No problem, they will be recorded and you will have  access to the classes after the event.

What you need:

  • A VR headset
  • A license from VictoryXR.

SIGN UP HERE: https://lnkd.in/ez5MYHU

This sounds like a great way to bring the best education to you wherever you live and set your child up with an immersive experience with a nationally recognized teacher.

SCREEN SHARING AND RECORDING A PICO G2 4K WITH A WINDOWS OR MAC COMPUTER

Recently I have been using the Pico G2 4K, a 3DOF device with one controller which works pretty well for enterprise use cases such as 360 video or simple training use cases.

Compared to other headsets it is a lot more open when it comes to working with and managing the operating system, in developing for the headset there were occasions when I needed to share or record the screen to show others what I was seeing.

As with sharing the Quest, previously written about here, Screen Copy (scrcpy) came in very handy with the right configuration for the headsets display.

One thing that is rather annoying about the Pico is that it loves to change screen resolution when you are using it, mainly when accessing what was previously a 2D android based app or settings dialog etc.  In VR you wont really notice the difference as they do a great job of handling the 2D apps and giving you an immersive space to work with them but when using scrcpy you often see the output completely change.  The only workaround I have found for this is that when a 2D screen appears and messes up the screen display, just run scrcpy with no parameters.  This will default to the resolution of the screen and show you the 2D dialog, as soon as you go back into VR mode though you will need to relaunch scrcpy in the below way otherwise you will get a 2 Eye output.

But for most experiences in VR you can use the below instructions to display and record the screen.

Initial Install and Setup

  1. Plug the USB-C cable into your computer and the Pico G2 4K.
  2. If its your first time plugging into this computer you will need to accept the prompt within the device that allows you to access the device from the computer and check the box to always allow if you want to skip this section in the future
  3. For Windows download and unzip the latest build of scrcpy from https://github.com/Genymobile/scrcpy/releases a direct link for the current version when writing this is here: https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip
  4. For Mac the application is available in Homebrew. Install it using the following from a terminal window:
  5. brew install scrcpy
  6. You will also need adb. you can install this by running the following from a terminal window:
  7. brew cask install android-platform-tools

Sharing the Screen connected via cable

  1. Open a command prompt (cmd.exe) or and CD into the extracted folder from above
  2. Run the following command:
  3. scrcpy --crop 1280:1776:400:60 -m 1600 -b 25M

Sharing the Screen connected wirelessly

You will still need a cable to make an initial connection and start the client on the Pico and then you can disconnect and use wirelessly, use the following steps to connect wirelessly:

  1. Follow steps 1-4 above in the setup section
  2. Open a command prompt (cmd.exe) and CD into the extracted folder from above
  3. While the device is connected via a cable run the following to find out what your Pico’s IP address is in the src section:
  4. adb shell ip route
    192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.198
  5. Now run the following replacing the IP address below (192.168.1.198) as yours:
  6. adb tcpip 5555
    adb connect 192.168.1.198:5555
  7. Disconnect the cable from the PC and with the device disconnected run the command to connect to the device as below
scrcpy --crop 1280:1776:400:60 -b 25M

Sharing Window

If everything worked above a new window should appear showing the device screen, you can then maximize this for a better demo window.

Testing was done with variations of the scrcpy command but the above was found to be the best viewing size to enable a good demo.

Recording the screen

There is also a great way to capture the screen while mirroring, add the following command options to the end of the scrcpy command above to do this:

 --record file.mp4

To disable mirroring while recording:

 --no-display --record file.mp4

Troubleshooting

Connection Issues

If you get a blank window or are unable to connect when device is plugged in you should be able to run the following command from the same folder above:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 device

The device should show above rather than:

PS C:\Users\alan\Downloads\scrcpy-win64-v1.10> .\adb.exe devices
List of devices attached
1PASH9AF839266 unauthorized

If you get the latter then make sure you have enabled developer mode and authorized the device as per step 1-3 above.

Target Machine refused connection when in wireless

If you receive a message like the following: “cannot connect to 192.168.1.198:5555: No connection could be made because the target machine actively refused it. (10061)”

Reconnect the Pico to the computer and go from Step 3 in the wireless connection steps above, this is caused because the client on the Pico stopped, normally as you reset the device.