Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Token RPi4b #62

Open
domcio01 opened this issue Jan 19, 2022 · 8 comments
Open

Invalid Token RPi4b #62

domcio01 opened this issue Jan 19, 2022 · 8 comments

Comments

@domcio01
Copy link

Hi i have problem with connecting my raspi with blynk.cloud via python3 i get invalid token information all the time. For now im only trying to connect and see if device is online.

blynk1

import BlynkLib
BLYNK_AUTH = 'CEliuHR*************1AafR9G9__k'
blynk = BlynkLib.Blynk(BLYNK_AUTH, server='blynk-cloud.com', port=8080)

while True:
    blynk.run()

and i got
blynk2

what i did :

pip install blynk-library-python

i also cloned this git and run

sudo python3 setup.py

i also tried to install other python blynk libraries from git but i have the same problem

@ebolisa
Copy link

ebolisa commented Jan 20, 2022

@ebolisa
Copy link

ebolisa commented Jan 20, 2022

Hi i have problem with connecting my raspi with blynk.cloud via python3 i get invalid token information all the time. For now im only trying to connect and see if device is online.

blynk1

import BlynkLib
BLYNK_AUTH = 'CEliuHR*************1AafR9G9__k'
blynk = BlynkLib.Blynk(BLYNK_AUTH, server='blynk-cloud.com', port=8080)

while True:
    blynk.run()

and i got blynk2

what i did :

pip install blynk-library-python

i also cloned this git and run

sudo python3 setup.py

i also tried to install other python blynk libraries from git but i have the same problem

Also, your're using an older lib version.

@domcio01
Copy link
Author

@ebolisa what i new version of lib 1.0.0? thanks that worked for ver 0.2.0 but not for 1.0.0

import BlynkLib
BLYNK_AUTH="token"
try:
#         blynk = BlynkLib.Blynk(BLYNK_AUTH, insecure=True)
        blynk = BlynkLib.Blynk(BLYNK_AUTH,
#        insecure=True,          # disable SSL/TLS
        server='blynk.cloud', # fra1.blynk.cloud or blynk.cloud
        port=80,                # set server port
        heartbeat=30,           # set heartbeat to 30 secs
        log=print              # use print function for debug logging
        )
except OSError as e:
    utime.sleep(3)
    restart_and_reconnect(e)
while True:
   blynk.run()

@ragasjohn
Copy link

Hello I have the same problem on a Pi Zero.
I just copied the example

Invalied auth token

@dulinux
Copy link

dulinux commented Apr 1, 2022

Same thing here: "Invalid auth token".

pi@raspberrypi:~/bin/doorbell $ pip3 list | grep -i blynk
blynk-library-python             0.2.0

My script test file:

import BlynkLib

BLYNK_AUTH = "oC############################aN"  # OMITTED FOR GITHUB

# initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)

@blynk.VIRTUAL_WRITE("V0")
def v0_write_handler(value):
    print('Current v0 value: {}'.format(value))

while True:
    blynk.run()

Double checked and the auth tokin is identical to the device's info.

pi@raspberrypi:~/bin/doorbell $ python3 blynk_og.py

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ for Python v0.2.0 (Linux)

Invalid auth token

@ebolisa
Copy link

ebolisa commented Apr 1, 2022

Try to use your local server (shown at the bottom rt in your dashboard) and not blynk.cloud. Also try the example shown above.

@dulinux
Copy link

dulinux commented Apr 2, 2022

My script test file:

blynk = BlynkLib.Blynk(BLYNK_AUTH)

Solved by manually specifying the server with:

 blynk = BlynkLib.Blynk(BLYNK_AUTH, server="blynk.cloud")

@ebolisa
Copy link

ebolisa commented Apr 2, 2022

If you use a closer server to you, the connection will be a bit faster. In EU it’s fra1.blynk.com As shown in the test code above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants