Homebrew [POC] 3DS Websocket server demo for homebrew utilities

TheCruel

Developer
OP
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
Testers needed. This is mainly a proof of concept for developers, but I would like others to test it too so I can better refine it with more browser/system support. Let me know if you have difficulties/bugs.

This technology can allow developers to make applications in web browsers that can interface with the 3DS console. A lot of possibilities.

Demo: http://ws3ds.cruels.net/

Server source: https://github.com/Cruel/websock3ds/
Web source: https://github.com/Cruel/websock3ds/tree/gh-pages



@MarcusD and @zaksabeast I would've pinged you guys about this in discord server, but I think some moralfag banned me.
 
Last edited by TheCruel,

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Does it just keep giving that over and over or does it eventually work? Because it will occasionally fail, but should keep retrying.

I left it try about 2-3 minutes but suddenly 3ds "console" stopped writing (I don't mean freeze, just it stopped printing new text), and after that, using the IP it works at first try. I've tested about 3 times. The two first times were like that. The third time, it only wrote that "error" text 4 times and stopped printing new text.
 
  • Like
Reactions: TheCruel

TheCruel

Developer
OP
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
I left it try about 2-3 minutes but suddenly 3ds "console" stopped writing (I don't mean freeze, just it stopped printing new text), and after that, using the IP it works at first try. I've tested about 3 times. The two first times were like that. The third time, it only wrote that "error" text 4 times and stopped printing new text.
Thanks, that gives me a better idea of what's going on. I think I might know what it is.
 
Last edited by TheCruel,
  • Like
Reactions: umbjolt

shutterbug2000

Cubic NINJHAX!
Member
Joined
Oct 11, 2014
Messages
1,088
Trophies
0
Age
29
XP
4,878
Country
United States
Can this interface with other websocket-based applications? Like, say I wanted to make a 3DS client for, idk, slither.io(just as an example). Would this work for that?
 

TheCruel

Developer
OP
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
Can this interface with other websocket-based applications? Like, say I wanted to make a 3DS client for, idk, slither.io(just as an example). Would this work for that?
It currently runs as a websocket server and not a client, but yeah you could use it as a websocket client too with slight changes. I was thinking about making a agar.io client for 3ds, but have other things to do atm.
 

Quantumcat

Dead and alive
Member
Joined
Nov 23, 2014
Messages
15,144
Trophies
0
Location
Canberra, Australia
Website
boot9strap.com
XP
11,094
Country
Australia
If you send text/pictures does it send it to every console that has installed the app? Or is it a unique installation per console somehow?

Edit: After seeing the code, I get it, it runs locally.

Would there be any chance of demonstrating uploading files from the 3DS to the server, and downloading files and saving them to the console's SD card?
 
Last edited by Quantumcat,

TheCruel

Developer
OP
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
If you send text/pictures does it send it to every console that has installed the app? Or is it a unique installation per console somehow?
This is only communication between your browser and the 3DS, nothing more. So nothing is stored on another server or going through any other server. The 3DS console is the websocket server and the browser is connecting to it.

My demo is hosted via github pages, so anyone can make their own too. Only problem is that it currently doesn't have SSL support. Or rather, most popular browsers reject self-signed certs over secured websocket, so I didn't bother figuring it out.
 
Last edited by TheCruel,

Quantumcat

Dead and alive
Member
Joined
Nov 23, 2014
Messages
15,144
Trophies
0
Location
Canberra, Australia
Website
boot9strap.com
XP
11,094
Country
Australia
This is only communication between your browser and the 3DS, nothing more. So nothing is stored on another server or going through any other server. The 3DS console is the websocket server and the browser is connecting to it.

My demo is hosted via github pages, so anyone can make their own too. Only problem is that it currently doesn't have SSL support.
Thanks, I was looking at the code, edited my post at the same time you replied :-)

Another edit, I realise no download/upload is possible, because it's javascript, not PHP. Is that right?
 

TheCruel

Developer
OP
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
Thanks, I was looking at the code, edited my post at the same time you replied :-)

Another edit, I realise no download/upload is possible, because it's javascript, not PHP. Is that right?
Sure, the code is already there for transferring images. Instead of just copying it to the framebuffer, you could save it to file. Likewise simple for sending from 3DS to browser.

At the moment, any binary data of the right size is considered an image to copy to framebuffer:
https://github.com/Cruel/websock3ds/blob/dcdb2036acb661fe55f13aeb50f92302576fc788/src/main.c#L97

But currently the browser client doesn't do anything with binary data sent to it since the title data the 3DS sends to it atm is a JSON string:
https://github.com/Cruel/websock3ds/blob/aec054c3c08a02d49fb6ad2da6e2122e6f1cd4ac/js/main.js#L33

EDIT: there are some security issues with browsers saving to disk, but it's possible you just need to add a button or something to trigger the saving. Guess it could be useful to show how to do that if anyone wants it.
 
Last edited by TheCruel,

Quantumcat

Dead and alive
Member
Joined
Nov 23, 2014
Messages
15,144
Trophies
0
Location
Canberra, Australia
Website
boot9strap.com
XP
11,094
Country
Australia
Thanks Cruel :-)

I made it into a sort of incredibly crappy chat room just for fun: http://quantumc.at/websoc/
It saves the text sent to a file and displays it in the browser and also sends it to the 3DS. I haven't actually tested it on my 3DS yet as I am in the library with wifi, that requires a sign-on page, so can't connect my 3DS to download the app. If it is broken I'll fix it in a couple of hours when home.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Btw today at school I gave one of my cookies from my snack to the girl I like.