hankhank10 / vinylemulator

Emulate the tactile experience of a vinyl collection through your Sonos system, but with a back end run by Spotify
https://www.hackster.io/mark-hank/sonos-spotify-vinyl-emulator-3be63d
GNU General Public License v3.0
170 stars 29 forks source link

Trouble running vinylemulator #9

Closed twosmooth closed 4 years ago

twosmooth commented 4 years ago

I am running into an issue around step 13. I have the Sony RC-S380 card reader. It was found by the pi and it worked when I tested vinylemulator. When I closed the terminal and did step 14, my NFC chips would not work. So, I did the logical thing and completely started over. There had been a few trial and error moments during the initial setup, so I thought doing a fresh install might fix the problem. It did not. On my second attempt, I am getting an error on step 13 when I test vinylemulator. When I type python vinylemulator/readnfc.py, this is the error I get:

Loading and checking readnfc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SCRIPT
You are running version Alpha 0.9.2...
Traceback (most recent call last):
  File "vinylemulator/readnfc.py", line 136, in <module>
    if r.status_code != 200:
NameError: name 'r' is not defined

Mark, I made sure that "requests" was installed, and the requirements were already satisfied. I then made sure the Python library could communicate with my NFC reader, python -m nfc and I got no error messages.

This is the 1.0.3 version of nfcpy run in Python 2.7.16
on Linux-5.4.51-v7l+-armv7l-with-debian-10.4
I'm now searching your system for contactless devices
** found SONY RC-S380/S NFC Port-100 v1.11 at usb:001:009
I'm not trying serial devices because you haven't told me
-- add the option '--search-tty' to have me looking
-- but beware that this may break other serial devs

I tried to load vinylemulator again and I got the same error message as before. What next?

hankhank10 commented 4 years ago

This is not an NFC issue - the issue is that it can't seem to communicate with the version server. This in itself isn't an issue as you could disable the version checking (it's designed to be helpful but is not essential), but the script will need to be able to send HTTP requests as that's how it communicates with the sonos api.

For now, could you try commenting out lines 129-146 in the readnfc.py script to see if it's an issue with communicating with the version server or sending http requests at all.

twosmooth commented 4 years ago

That worked! I commenting out lines 129-146 and rebooted. I had already gone through all of the steps, so vinylemulator is running at startup. I placed one of my NFC tags near the reader and the song started playing immediately.

So, that tells us that the issue is the version checking, right? What did I do (or not do) to make this happen? I didn't see anyone else mention this issue. If you're like "it works noob, leave me alone!", that's all good. I really appreciate you taking the time to figure out where the issue was.

Thanks again!

hankhank10 commented 4 years ago

Great you got it working.

The fact it can't access the version server is weird. I presume your pi is connected to the internet?

Could you please try accessing "https://version.hankapi.com/vinylemulator" via a web browser manually?

Thanks

ashenshugarRET commented 4 years ago

Hello,

I have the exact same issue.

I am unable to reach the above address through my home's internet connection, however if I use my phone with the wifi off I can connect and see the Alpha 0.9.2 message.

So it appears access to your version checking server is being blocked by my ISP.

hankhank10 commented 4 years ago

Ok, thanks for flagging. That's strange and may be a certificate issue at the server end.

The whole version check thing was meant to help with debugging after crashes so if it's actually causing crashes then it should go while I figure it out.

I've just pushed another version (0.9.3) to github which removes the version check.

ashenshugarRET commented 4 years ago

Thanks,

The new version works perfectly for me now.