ESP32-Supabase icon indicating copy to clipboard operation
ESP32-Supabase copied to clipboard

realtime-postgresChanges does not work.

Open GuneshRaj opened this issue 1 year ago • 7 comments

Hi, I cant seem to get the realtime updates working. Im using Ardiono with ESp32 with v3 SDK.

I matted to connect to Supabase and handle DB transactions - works fine. However, the Real Time Table updates / Record updates does not trigger any events.

The code is exactly as your example with a different Table. The Table also us visible via the Anna Login and has Real time enabled with no RLS. The Table has been tested with realtime over the Web ad it works - so the config seems fine.

In the Loop run, it only prints this:

[WSc] Disconnected!

Appreciate any help here. Thanks

The Code

Sample Code:


// Some header codes and handlers

void HandleChanges(String result) {
    Serial.println(result);

  JsonDocument doc;
  deserializeJson(doc, result);

  // Example of what you can do with the result
  String tableName = doc["table"];
  String event = doc["type"];
  String changes = doc["record"];

  Serial.print(tableName);
  Serial.print(" : ");
  Serial.println(event);
  Serial.println(changes);
}

void setup() {
 // some code ...
  realtime.addChangesListener("mytable1", "UPDATE", "public", "id=eq.3");
  realtime.addChangesListener("mytable2", "*", "public", "");
  realtime.listen();
}

void loop() {
  realtime.loop();
}


GuneshRaj avatar Nov 14 '24 07:11 GuneshRaj

same issue with me

eslam-ebrahem2 avatar Nov 16 '24 19:11 eslam-ebrahem2

Same issue with me

tracemodule avatar Nov 29 '24 23:11 tracemodule

got same issue with realtime database..

[WSc] Disconnected!

tracemodule avatar Dec 01 '24 07:12 tracemodule

Same issue with realtime database

[WSc] Disconnected!

mendo10jm avatar Dec 01 '24 09:12 mendo10jm

Same issue here. I keep seeing "[WSc] Disconnected!" in the serial monitor.

chamals3n4 avatar Jan 13 '25 07:01 chamals3n4

Hello Guys, I create a user at supabase authentication and uncomment this line

realtime.login_email("[email protected]", "secret");

Image

its worked

abilioscoelho avatar Feb 05 '25 12:02 abilioscoelho

Any updates on this? Did somebody manage to get it working without user login?

troglodisme avatar Jun 25 '25 22:06 troglodisme