Device won't come online even when running an example

Objective: To control the brightness of a virtual LED with a virtual variable resistor (ie the Slider widget).
Details :
• Hardware model + communication type: Raspberry Pi 4 Model B, wifi
• Smartphone OS (iOS or Android) + version: iOS 15
• Blynk server or local server: local server
• Blynk Library version: v.0.2.0 (Volodymyr Shymanskyy’s library)

The code isn’t mine, it’s just that I got an example, followed its steps and yet, it only shows the blynk logo. I’m using Thonny Python IDE.
Now, I’m coding on the RPi itself. When I saved and applied the widgets, using the blynk console, it says that my device is offline after I ran the example. Also, Quickstart gives me code in C++, not Python which is what I need for an RPi. How do I get my device online? And how do I upload the code to the RPi that I’m using to code?

Environment prepare:
In your Blynk App project:
  - add "Slider" widget,
  - bind it to Virtual Pin V4,
  - set values range 0-255
  - add "LED" widget and assign Virtual Pin V4 to it
  - Run the App (green triangle in the upper right corner).
  - define your auth token for current example and run it

import blynklib

BLYNK_AUTH = 'AUTH_TOKEN'

# initialize Blynk
blynk = blynklib.Blynk(BLYNK_AUTH)

WRITE_EVENT_PRINT_MSG = "[WRITE_VIRTUAL_PIN_EVENT] Pin: V{} Value: '{}'"


# register handler for virtual pin V4 write event
@blynk.handle_event('write V4')
def write_virtual_pin_handler(pin, value):
    print(WRITE_EVENT_PRINT_MSG.format(pin, value))


###########################################################
# infinite loop that waits for event
###########################################################
while True:
    blynk.run()

Are you sure?

The other things you mention in your post point towards you using the new Blynk IoT not Blynk Legacy.
There is no local server available for Blynk IoT.

Is there a reason why you’re using an RPI? It’s probably the worst client device you could choose an IoT project.

Pete.

  1. I was sure as I downloaded the local server on the 1st of March. I only saw Error 404 maybe 2 days ago. What do I do now?
  2. I am using the new one.
  3. Well, truth to be told, it really wasn’t my choice. I’ll have to ask my supervisor on that (This is actually a group project, I wouldn’t dare to overshare).

The new Blynk IoT app is not compatible with the Legacy local server that you say you are using. You need to use the Legacy app, and that opens-up a whole host of issues, such as not being able to register new accounts using the the latest Legacy app.

That’s the first time you’ve mentioned this.

In that case, you’re going to have a problem obtaining advice from a community forum, as you clearly need to go back to basics and there are a very limited number of people who use Python on an RPI in the forum.

Pete.