paul-lrr / nifty-recognizer

node server and html files to connect the Deckedbuilder card recognizer to a streaming overlay
Other
36 stars 4 forks source link

Webpage not updating #6

Closed RetroGuernsey closed 4 years ago

RetroGuernsey commented 7 years ago

Hi,

I seam to have everything installed correctly and Decked Builder reads the card ok and I have added the line to the XML with the Node.js working but the page does not update with the card. Not sure in relevant but when i go to localhost i get a Cannot GET / error

Windows 10 if that is of any help

ciserman commented 6 years ago

Has anyone else encountered or solved this issue? If I use the card-controller.html page and drag a card there the card-view.html will update, but nothing updates when I read a card from Decked Builder. Is it required to register the product? I wasn't sure if this build would work and didn't want to waste the money if it wasn't going to work for me.

paul-lrr commented 6 years ago

Hey ciserman, Just tested it again and the script seems to be still working for me. Does deckedbuilder successfully register the cards as they are scanned? eg. does the card show up in the Recognized Cards list on the right of the cardcam window?

ciserman commented 6 years ago

Yes, it does show up in Decked, but the HTML local file does not change from the default card backing.

ciserman commented 6 years ago

I am wondering now if it has to do with using the free version. I had wanted to see if it would work for me before buying it, but I might just bite the bullet and see if that's the issue.

paul-lrr commented 6 years ago

Hmmm. It looks like DeckedBuilder might be overwriting its config file and removing the <v key="OrbCam_match_url" value="http://localhost/cardmatch/{0}" /> line. Can you check your deckedbuilder.xml file and see if that line is still there? Also, what version of deckedbuilder are you using? There should be a tab at the top of the window that says CardCam2 (Beta), that is the cardcam that you want to use.

ciserman commented 6 years ago

Yeah, I did add the line, but it gets overridden at some point. I am using the CardCam2 (beta)

paul-lrr commented 6 years ago

Ok, try adding the line and then marking the xml file as Read Only so that deckedbuilder can't change it

ciserman commented 6 years ago

I have marked as read only, the line does not go away, but the image still does not update.

Berilio commented 6 years ago

I'm having the same problem. The webpage doesn't get updated with card images from decked builder. Tried to change the xml file to read only , but that caused an error on decked builder, so i had to revert it.

paul-lrr commented 6 years ago

I’m afraid I don’t know what is causing this. The weird thing is I have tested it a few times with different deckedbuilder versions and can not replicate the problem.

I am modifying the file in C:\Users\\AppData\Local\deckedbuilder\deckedbuilder.xml, is that the same file you are editing?

Berilio commented 6 years ago

Yup, thats the file i was modifying.

I was going to take a few screenshots to demonstrate what i did, but then i got across this:

https://i.imgur.com/sxEmk00.png

A new line under the "" line appeared. This is the line:

<v key="CardCam_Cam" value="@device:pnp:\\?\usb#vid_0bda&amp;pid_57b5&amp;mi_00#6&amp;4d9b0b7&amp;0&amp;0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global" />

I don't know if thats of any help. If its not, tell me and ill try to provide more information.

Greven145 commented 6 years ago

That new line appears to be settings for the webcam you chose and is likely unrelated.

I had similar issue when I first ran the software, and decided to narrow down where the problem was by removing DeckedBuilder from the equation. I ended up making some small tweak to better debug the process: ` io.on('connection', function (socket) { console.log('Initializing listeners');

app.get('/cardmatch/:id', function (req, res) {
    console.log(`Incoming request for ${req.params.id}`)
    res.send(req.params.id);
    if (!isNaN(req.params.id)) {
        socket.broadcast.emit('card_image', { 'auto': true, 'src': 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=' + req.params.id + '&type=card' });
    }
});

socket.on('card_image', function (msg) {
    socket.broadcast.emit('card_image', msg);
});

});`

I also ran the process with express debugging turned on to see if the requests were coming into express.

DEBUG=express:* node index.js

Then you can hit the url in your browser and should get the multiverse ID back as a response instead of an error.

http://localhost/cardmatch/438475

Also remember that you must have the card viewer open and connected for express to apply the listeners to /cardmatch/:id, so if it's not open nothing will ever happen.

paul-lrr commented 6 years ago

So it turns out that Deckedbuilder has been working on some improvements to the cardcam system, but the latest version of Deckedbuilder (1.43) broke the OrbCam_match_url functionality. I have been in contact with the developer and they should be pushing out a new version that gets it working again soon.

Berilio commented 6 years ago

Nice! Thanks for all the hardwork you do for us paul!

alchemyprime commented 5 years ago

Hi Paul. Thanks for the recognizer. I was wondering if this problem has yet been solved? I can't get the recognizer to work with SLOBS at all anymore. :( I even tried the idea Greven suggested, and nothing worked.

dfunston commented 5 years ago

Anyone know of a way to install an older version of Deckedbuilder where OrbCam_match_url works? Looks like 1.43 is still the latest version as of now. I've tried using 1.25, but that's missing CardCam2 (Beta) and doesn't seem to use the OrbCam_match_url either from my testing.

I added the following code to index.js just above the io.on block in order to see http requests. If I go to a browser and request localhost/cardmatch/{id}, I get a result, but nothing appears when scanning a card using Deckedbuilder 1.25 or 1.43.


server.on('request', function(req, res){
    console.log(req.url);
    console.log(req.method);
    console.log(req.headers);
});`
chkurkowski commented 4 years ago

@paul-lrr, is there any news on when there will be some sort of update fixing this functionality or any ideas on some workarounds?

paul-lrr commented 4 years ago

I have actually been talking to the makers of DeckedBuilder and I think I will be able distribute an updated version of the DeckedBuilder program that will work with nifty recognizer as well as the utility they developed to make custom recognition sets. I have to do a few updates to the nifty-recognizer software and write some documentation to actually make it useful but I hope to have it available in the next few weeks.

chkurkowski commented 4 years ago

That's awesome! This sounds like the exact set of things we need to get everything up and running for our setup. Will you be doing a stream/video for this or would you just post here?

paul-lrr commented 4 years ago

I have created a new branch of this repo called extras-included. If you switch to that branch, you should see the new, more comprehensive readme and also be able to download the new deckedbuilder that works with the overlay and the orb_maker utility to make custom orb files. Before I push the branch to master, I would appreciate it if you could try out overlay with the new deckedbuilder and orb_maker programs and let me know if they work and if my instructions in the readme are clear enough.

chkurkowski commented 4 years ago

I will check it out and see if I can get it working as soon as I'm out of my next class in a little over an hour. I'll post here with my results. Thanks!

chkurkowski commented 4 years ago

I'm working on getting all this working. I have the node server running but the HTML card view is not updating from DeckedBuilder, it does update from the Controller just not the card camera. Edit: I guess I just figured this out so ignore this part. The line was getting deleted (since the XML was updated) on app close and so the order I was editing things in wasn't working.

I also have a folder with Gatherer images but running the Orb Maker command Line program has not been working. I'm relatively new to the command line so I could be doing something wrong, here is an image of the error. Image of Error

paul-lrr commented 4 years ago

Ok, couple of things. First, DeckedBuilder should be sending a request to http://localhost/cardmatch/<multiverse id> to send the card info. If you manually go to http://localhost/cardmatch/1234 in your web browser, does the cardviewer pick up the card? (which in this case should be Water Elemental) If so, then the problem is that DeckedBuilder isn't sending the info, if manually sending a card doesn't work, then the problem might be in the server or the card viewer itself.

Secondly, it looks like you have a few extra characters in the orb_maker command. For what you are doing, the command should be orb_maker.exe JundLands_chase.orb *.jpg (that is running the orb_maker.exe program with the fist argument as the output filename and the second argument as the file list, which in this case is all the files in the current directory ending in .jpg)

chkurkowski commented 4 years ago

Ok I got everything working now. I think almost all of my issues just came from me being relatively new to the Command Line still. To answer your initial question I think that the read me is well laid out and most of my problems came from lack of knowledge rather than poor instruction. Thanks again for the work you've done getting this out, and the help you've given me tonight. We'll be sure to leave a special thanks for both you and the developers of DeckedBuilder when we get our stream fully set up.

paul-lrr commented 4 years ago

Glad to hear it! Please let me know when you get your stream set up, I'd like ot see the system in operation on another channel

Cindurion commented 4 years ago

Awesome, this is really cool-looking! I managed to follow the tutorial fairly easily (Though you might wanna go over the basics of using the command console for users who aren't familiar with it and just wanna run the program). Everything seems to be working really well on my end, so it's looking amazing so far. The only snag I've hit upon is loading in custom sets. Is it hardcoded to only accept .jpg files? Because I noticed that when I'm downloading files from gatherer, the files are in jfif format which doesn't seem to be supported. Other than that, if I convert the files to .jpg it seems to work, so I was just curious if jpg is the only supported file format.

Cindurion commented 4 years ago

Say, you wouldn't happen to know a tool for quickly downloading a decklist's cards? Or do you generally go through decklists by hand when using this?

Cindurion commented 4 years ago

Hey, we were going to use the tool this weekend but it was having some serious issues recognizing some of the cards. It wasn't able to get past the recognizer threshold. I noted that it worked fine if I was using the program normally (selecting the set the card was originally from), I'm guessing the custom orb files aren't as easy for the program to recognize? Any ideas on improving the recognizing?

paul-lrr commented 4 years ago

Are you using Gatherer as the source of the card images? The size of the images used to build the orb file definitely makes a difference. The ideal size is ~250px wide (gatherer images should be about the right size). If you are using images from a higher resolution source (like scryfall), make sure to resize them before running orb_maker

Berilio commented 4 years ago

I have actually been talking to the makers of DeckedBuilder and I think I will be able distribute an updated version of the DeckedBuilder program that will work with nifty recognizer as well as the utility they developed to make custom recognition sets. I have to do a few updates to the nifty-recognizer software and write some documentation to actually make it useful but I hope to have it available in the next few weeks.

Is this update live? If not, any news on the development? ;] Thanks o/

paul-lrr commented 4 years ago

The new release includes the custom build of DeckedBuilder and the orb_maker program! (they are in the extras folder)