f-log

just another web log

25 Sep 2025:
wifi headset woes

Wifi Headset woes

I have a little issue with the Quest 2 and it all revolves around my Wifi. The router cannot be moved and is in the far corner of the downstairs. My computer is the opposite of the house and is connected through ethernet via the mains power ring.

The weird thing is, 1 in 5 times the Quest 2 will be fine upstairs and other times it will be unable to handle as much as 1 frame per second(*)

As my Godot VR development continues I really want a good connection so I can hop in and out of VR. That is not to say that doing Godot VR development without the headset isn't possible ...

I heard that the WiVRn Linux app now supports wired connection over USB and really wanted to check it out, but there are some steps that are not normal .

  1. You need your headset in Developer Mode
  2. To get this you need to visit developer.oculus.com
  3. Log in with the same Meta account as you use for your headset.
  4. Go to your profile and My Apps
  5. Create an Organisation. Any name will do, it just has to be unique.
  6. Agree to the Terms and Conditions
  7. Turn on your headset and load the Meta mobile app
  8. Click on the headset and then select Headset settings and Developer mode
  9. Enable Developer mode
  10. Start the WiVRn dashboard.
  11. Run the following two commands (might have to authorise the connection first time around inside the headset)
  12. That's it!

You do have to have Android Developer tools already installed, but I had those.

adb reverse tcp:9757 tcp:9757
adb shell am start -a android.intent.action.VIEW -d "wivrn+tcp://localhost" org.meumeu.wivrn

results in the port number and a response of

Starting: Intent { act=android.intent.action.VIEW dat=wivrn+tcp://localhost/... pkg=org.meumeu.wivrn }

and you should find that WiVRn has started on the headset without you doing anything and it is ready for you to start some VR-ing!

If you get this response then a popup will be waiting to be OK-d in the headset

adb: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

(*) While writing this up I have seen that other people have had the same 1 in 5 Wifi issues and it is all to do with the Quest 2 dropping to the lowest Wifi speeds when it sleeps. So in theory, I could just set the headset to not sleep and turn the Wifi off and on to try and get it back to full strength. But with the cable plugged in I am getting the Quest charged, so I think I will stick with that.

24 Sep 2025:
how I found my hands and then could not keep my fingers off the buttons

How I found my hands and then could not keep my fingers off the buttons

If it wasn't obvious

 git diff HEAD~3 HEAD~4

showed me the difference between the two commits and could see I had set the visibility of the XROrigin3D to false in the main scene. Which was annoying because that was the only place I wasn't looking!

Then once I could see my hands I had some more fun.

I had it so when your hand pointed at a tile it highlighted (and deselected any existing highlighted tiles), but what I needed was to detect a button press and then initiate the mine clearing algorithm.

There were a nice button_pressed and button_released signal events I could hook into. When I ran the code everything went nuts as if I was constantly pressing and releasing all the buttons at once!

One of the cool and rather odd things about the Quest 2 controllers is they can detect if you finger is near a button. So, I was in fact touching and releasing different buttons, just incredibly lightly.

The fix is to use

input_float_changed(name: String, value:float)

and that value can be checked for 1.0 (pressed fully) and 0.0 (released completely)

The game is not quite working. If I highlight certain tiles and press the trigger then it does correctly uncover that title and all the surrounding tiles (and their surrounding tiles etc). Then other tiles just uncover themselves and do not try and deal with the tiles around them.

16 Sep 2025:
how i lost my hands

How I lost my hands

I was mucking about in Godot and not using the Quest 2 headset to make sure everything worked ...

Somehow, somewhere I had hidden or disabled the hand models that appear as your controllers.

But I was using git so all I had to do was find the check-in before they disappeared and compare it. Godot is all text files and although somewhat cryptic all the changes are logged there.

git checkout HEAD~2

Test in Godot hands are still gone, so I need to go back further...

git checkout HEAD~3

Now the hands are back but it looks like really old code...

What was the message that appeared after the first command?

Note: switching to 'HEAD~2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 30d4a0d replaced floor with PlayArea, height magically fixed, raycast not visible

Oh so this was not 3 commits ago it is now 2+3 commits ago!

So I can just run git switch - then? Well, yes, but not more than once, now I am stuck in detached HEAD :(

I tried my usual reset command

git checkout .

but it helpfully checked out the same commit, because it is the new HEAD

All the LLMs and Google wanted me to use --reset hard but it was much easier to just

git checkout main

and I am back to the true HEAD!

Now I can carefully checkout the actual 3rd commit

 git checkout HEAD~3

hands still MIA, switch back to main

git checkout main

and try the 4th

 git checkout HEAD~4

Ah ha! the hands are back!

I just need to switch back to main

git checkout main

and diff the two

 git diff HEAD~3 HEAD~4

Git for the Win!

08 Sep 2025:
git to github

Git to Github

This is an update for my reference as the previous notes have gone a bit stale.

To take an existing local project and put it on Github.

cd into your project folder and run

git init
git add -A
git commit -m "initial commit"

The commit is now officially locally created.

Then go to Github and create a new repo and come back with the new-repo-name

git remote set-url origin git@github.com:my-username/new-repo-name.git
git remote -v

Where my-username is your github username.

Your remote is now pointing to github

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

to add your passphrase and log in to github

git push --set-upstream origin main

should push all your project files to github

if it gives you a message about needing to pull first you can

git pull
git fetch origin
git push --force origin main

then to test it add a README.md file

vi README.md
git add .
git commit -m "added README"
git push

prophet!

08 Sep 2025:
instanciated mines

Instantiated mines

Here is a screenshot of a 10x10 grid of mines and mine counts from my Godot 3D 2D minesweeper.

screenshot of 3d 2d minesweeper board

Now just have write all the interactive bits.

08 Sep 2025:
godot goes backwards

Godot goes backwards

I am writing a 3D version of 2D minesweeper in Godot and the one key area of coding is the logic of creating the board.

It needs to have enough mines randomly placed and also not to create clusters of 8 or more that would could be impossible to decipher. That logic worked surprisingly well, but when I came to counting the mines around a square, I got a shock. The counts were off for the first line and first column. The numbers were too high.

After some quite considerable debugging I find that both Godot and Python allow negative indexes to arrays. Or maybe I did know and forgot .

So those counts were counting the mines on the other side of the map!

Note to self;

Exceed the bounds of an array, get and error

Use a negative index and bounce back to the other end of the array

This is one of those things that you could go your entire life coding and never hit, so, lucky me!

08 Sep 2025:
gut-ed by godot testing code

Gut-ed by Godot Testing

not sure why the code got all screwed up there, here it is again.

 func _get_obj_filename(obj):
    if typeof(obj) == TYPE_OBJECT:
        var script = obj.get_script()
        if script and script.has_method("get_path"):
            var path = script.get_path()
            if path != "":
                return path
    return "unknown"
08 Sep 2025:
gut-ed by godot testing

Gut-ed by Godot Testing

I was quite pleased with my progress after only a few short hours of Godot coding. Things were generally just working, so I did some refactoring and then looked to add some unit tests...

First you have to install an Add-On called Gut , then enable it, then it should just be a matter of creating a test and running it.

But I got a very weird response when running my first very simple test.

Parser Error: Function "inst_to_dict()" not found in base self.

It seems the only way of fixing it is to either; write more complex tests or patch the testing framework. The issue is that the Gut system is trying to work out the details of the file your test is running from so that it can report the file name etc. But when the this code runs the test file details are reported as Boolean, not a file and obviously a Boolean does not have a file name property and it fails.

I opted to replace the offending code with

func _get_obj_filename(obj): if typeof(obj) == TYPE_OBJECT: var script = obj.get_script() if script and script.has_method("get_path"): var path = script.get_path() if path != "": return path return "unknown"

which fixed it!

loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!