Hacking [Tool] Joy-Con Toolkit

  • Thread starter Thread starter CTCaer
  • Start date Start date
  • Views Views 1,288,963
  • Replies Replies 1,757
  • Likes Likes 136
New Joy-Con Toolkit v5.0.0 is now released!
  • IR camera and NFC support
  • Switch update 5.0.0 controller colors (Grips) support
  • Check changelog in OP for more!

mwg8Msy.png
Oh so we can dump Amiibos/wright NFC cards now? If not that be a nice feature to add in sure others will agree?
 
  • Like
Reactions: Exeat
This IR camera is really not bad at all. Will it be possible to change the settings on the fly in future versions ?
Does the IR camera have the possibility to ajust the gain by itself depending on the amount of light ?

For now you can only change the color filters, because they are on the side of the app. We just get a 8bpp monochrome raw image, so it's easy to manipulate.
But to be true, I don't know. I never tried. I just built it to a similar way of what Switch does. And for the common registers, I still don't know what the other values in the external light filter do (IF they do anything :P).

Currently what switch does is to change the IR mode to "background" then suspend the MCU (this is the default state when you turn on the Joy-Con) and do the whole configuration from the start.
But maybe it's possible to send the 2 commands responsible for the real configuration, maybe 3 if we include the image size for the resolution.

About the automatic gain:
Keep in mind that digital gain is crap and does not work like exposure and ISO. It just multiplies the signal and can produce extreme noise and artifacts.
So aside from that, I did not found any register to configure, that enables some kind of auto exposure. I only found a register that behaves sth like enable manual exposure / use maximum exposure.
Maybe if the on the fly configuration works, I can write an algorithm that changes exposure (and sometimes gain), based on the average intensity (Int) reported by the sensor.
Or at least sth that can sample some frames with a low res and switch to what res you chose when you use auto exposure and gain.

What is my biggest concern is the framerate, or in other words the data rate. Currently we can only get 300bytes per 15ms or 20KB/s. And the camera sensor supports 66fps at full res.
But I don't think this will change in the future though.
I know that the sensor MCU and the other IR modes support quantization and can reach 66fps with a res of 30x40.
What quantization does is that it reduces the 8bit color to 6bit color. From 256 colors to 64.
A clever method, especially here that we don't care to have quite many different shades. But I don't know if you can force it on this IR mode. If this is possible, it can quadruple the framerate to all resolutions.

Btw, you can find the fps by doing this: 1000 / (((width*height)Bytes / 300Bytes) * 15ms)


Oh so we can dump Amiibos/wright NFC cards now? If not that be a nice feature to add in sure others will agree?
Not yet. For now only a simple info about type and UID of the tag. But the controllers support full read/write of Ntags and Mifare tags. So it is planned for the future.



Anyway, this was just the start. A stable start. So now I can start the trial and error testing phase and try to change different config registers.
We have a long road ahead of us and time will tell.

--------------------- MERGED ---------------------------

Lol it works. You can change settings on the fly..
Expect a new version in the near future.
 
  • Like
Reactions: MK73DS and Shadow#1
nice update and was wondering if anyone was trying to make music via the hd rumble thx to the hd rumble player
 
Maybe if the on the fly configuration works, I can write an algorithm that changes exposure (and sometimes gain), based on the average intensity (Int) reported by the sensor.
Or at least sth that can sample some frames with a low res and switch to what res you chose when you use auto exposure and gain.

--------------------- MERGED ---------------------------

Lol it works. You can change settings on the fly..
Expect a new version in the near future.

That's precisely what I want :) Thank you for your hard work on it !

Speaking of data transfer rate, is it a limitation of Bluetooth or the JoyCon hardware ?
 
I think because of Bluetooth profile (BT-HID) mostly. The hardware supports up to 6mbps (750KB/s max theoretical air throughput).

NOTICE: The next section is pretty technical.

So let's break down what we know, the facts, the theories and the unknowns.
(I'm excluding the Pro controller here, because I don't have one.)
-------------------------------
First of all the max net data rate we ever saw for the Joy-Con is:
362bytes * 66.67 (it pushes every 15ms) = 24.1KB/s - 193.0Kbps.
This is without the bt headers (the actual is 24.7KB/s - 197.9Kbps).

But the it uses only 300bytes for the image portion in every packet.
That is 20.0KB/s - 160.0Kbps for the image transfer rate.
-------------------------------
Now let's break down the image sizes:
Code:
// 8bpp greyscale
320*240 = 76.8KB
160*120 = 19.2KB
80*60   = 4.8KB
40*30   = 1.2KB

And we also know that the sensor supports quantization. I said before that it produces 6bit images but I don't know for sure.
I just assumed 256 colors / 4 = 64 colors.
As I said the quantization lets you reduce the color depth, so you can fit the same resolution in less space.

I know that in the IR hand analysis image transfer mode, it receives a 40*30 image every packet.
That means that in 300bytes it fits an encoded 1200pixel image and thus in every byte they encode 4 pixels.
An easy quantization method to do this, is by using 2bits in a byte for every pixel. But this creates images with 16 different colors.
As I said I don't know yet which algorithm it uses. And also if image transfer mode supports this.

So we the size become:
Code:
// ?bpp (4pixels per byte) greyscale
320*240 = 19.2KB
160*120 = 4.8KB
80*60   = 1.2KB
40*30   = 0.3KB
-------------------------------
So let's have the max framerates now:
Code:
// 8bpp greyscale
320*240 = 0.00fps (3840ms per frame)
160*120 = 1.04fps (960ms per frame)
80*60   = 4.16fps (240ms per frame)
40*30   = 16.67fps (60ms per frame)
[CODE]// ?bpp (4pixels per byte) greyscale
320*240 = 1.04fps (960ms per frame)
160*120 = 4.16fps (240ms per frame)
80*60   = 16.67fps (60ms per frame)
40*30   = 66.67fps (15ms per frame)

Because of the way image transfer works, it has additional latency of 30ms (because it sends the last image fragment 3 times).
The quantized hand analysis image transfer mode does not have this. It immediately pushes the 1st fragment for the new image.
-------------------------------

So now you know how it sends the images. But how about using other BT modes?
If we use other BT profiles to tranfer the image, we can have 10 times bigger fps (BT2.0) or 30x fps (BT4.0).
But you want to also send controller buttons/sticks/acc/gyro states also. So you have to change the whole implementation..
So I don't think this will change soon. Maybe there's a way already, but I don't know it.
-------------------------------
Another thing I saw, were the videos from Nintendo Labo.
It looks like they use 160*120 at around 15fps for the live view which is pretty strange.
Maybe they already implemented new encoding modes in joy-con fw 3.89.
We will find out when it comes out.



Ok that's it for now.
If I forgot sth or you have a question on these, please ask.
And have in mind, that I am still learning how Joy-Con's IR/NFC MCU works.
 
I am so glad you made this tool! Thanks alot CTCaer!

I do have one question for anyone. Does anyone have a hex for the jungle green color if the shells that Basstop makes?
 
  • Like
Reactions: iepuras
Edit analog sticks user calibration:
  • Edit the analog stick's X/Y ranges and centers. All controllers are supported.
    This can correct accidental walking and slow running when the switch's calibration does not let you calibrate them correctly.

you say we can calibrate the stick and fix bug but what exactly and also how the calibration works because the stick of my joy con goes very bad because it is often stuck in one direction while I do not touch and the stick is in the middle and the calibration of the console does nothing so if someone can help it would be nice thank you
 
I am so glad you made this tool! Thanks alot CTCaer!

I do have one question for anyone. Does anyone have a hex for the jungle green color if the shells that Basstop makes?
Open the photo in amazon and then use the eyedropper tool from my toolkit. You drag and drop where you want to take a color from your screen.


Edit analog sticks user calibration:
  • Edit the analog stick's X/Y ranges and centers. All controllers are supported.
    This can correct accidental walking and slow running when the switch's calibration does not let you calibrate them correctly.

you say we can calibrate the stick and fix bug but what exactly and also how the calibration works because the stick of my joy con goes very bad because it is often stuck in one direction while I do not touch and the stick is in the middle and the calibration of the console does nothing so if someone can help it would be nice thank you

Well if you change the range, this is mitigated. For better results you'll have to wait a bit. In the future I'll also put factory settings edit. With this you'll be able to change the deadzone.
 
So, could that fix my problem?
It will mitigate the problem. If the deadzone is high enough to cover the sticking place it will not make your character walk/run.
But the problem remains.

I did the same, made the deazone (xAE) bigger, but when I had some time, I used an air spray and then an electronics spray cleaner.
Don't by any chance use any lubricant and especially not WD-40.
These don't bond well with the plastic used for the stick. And also every dust speckle will stuck inside.

You need an electronics contact cleaner.
 
It will mitigate the problem. If the deadzone is high enough to cover the sticking place it will not make your character walk/run.
But the problem remains.

I did the same, made the deazone (xAE) bigger, but when I had some time, I used an air spray and then an electronics spray cleaner.
Don't by any chance use any lubricant and especially not WD-40.
These don't bond well with the plastic used for the stick. And also every dust speckle will stuck inside.

You need an electronics contact cleaner.


thank you my dad has the necessary tools but the crack of the stick is enough or I need a screwdriver for 3 star to open the joy con
 
thank you my dad has the necessary tools but the crack of the stick is enough or I need a screwdriver for 3 star to open the joy con
Crack?

If you look closely, you will see that the stick has sth like a cap. You need to apply the electronics cleaner between the cap and the base of the stick (both of them protrude out of the hole that is covered with a black film ring).
Don't shove anything in between though, you'll risk breaking it or denting it. Just move the stick around and apply small quantities. Then keep moving it around until the liquid evaporates.
 
Crack?

If you look closely, you will see that the stick has sth like a cap. You need to apply the electronics cleaner between the cap and the base of the stick (both of them protrude out of the hole that is covered with a black film ring).
Don't shove anything in between though, you'll risk breaking it or denting it. Just move the stick around and apply small quantities. Then keep moving it around until the liquid evaporates.

I risk damaging the cap if I lift it slightly with a mini screwdriver? for the electronic contact cleaner my father wants to know the break cleaner can it be enough and he asks it is liquid that evaporates quickly can there be a risk of broken

thank you for helping me you save me Canadian $ 100
 
Don't use metal. Use a toothpick.
Also the break cleaner won't do. I believe it's worse than a lubricant spray for this job.
Better buy an electronics contact cleaner. It has many uses as a cleaner, so I don't believe it's a waste of money (it's cheep also).

If this doesn't work, you can then open the joy-con and remove the stick and open it. But you need to be careful, it's very delicate and easy to forget where every piece must go. It has a lot of them.
 
Don't use metal. Use a toothpick.
Also the break cleaner won't do. I believe it's worse than a lubricant spray for this job.
Better buy an electronics contact cleaner. It has many uses as a cleaner, so I don't believe it's a waste of money (it's cheep also).

If this doesn't work, you can then open the joy-con and remove the stick and open it. But you need to be careful, it's very delicate and easy to forget where every piece must go. It has a lot of them.

thank you I give you news tomorrow
 
Am i doing something wrong or why do i get Error: 3MCUONBUSY! when trying to use the ir camera
UPDATE: FIXED it
 
Last edited by ExploitTnT,

Site & Scene News

Popular threads in this forum