Skip to content

Commit fdb1d2b

Browse files
committed
Added RP2040 support and changed name of the library
1 parent 403440b commit fdb1d2b

14 files changed

Lines changed: 367 additions & 173 deletions

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Supabase-ESP32
2-
### A library to connect to Supabase's Realtime Database from an ESP32 in realtime with API Key authentication.
1+
# Supabase-Arduino
2+
### A library to connect to Supabase's Realtime Database from an Arduino with API Key authentication.
33

4-
The Arduino Nano ESP32 library provides a simple and efficient way to integrate Supabase.io's Realtime Database into your ESP32 projects. By leveraging API Key authentication, this library enables real-time communication between your ESP32 microcontroller and Supabase.io's powerful database infrastructure.
4+
The Arduino library provides a simple and efficient way to integrate Supabase.io's Realtime Database into your ESP32 or RP2040 projects. By leveraging API Key authentication, this library enables real-time communication between your microcontroller and Supabase.io's powerful database infrastructure.
55

6-
To get started, simply include the library in your Arduino IDE and follow the provided documentation to establish a connection with Supabase.io. Once connected, you can easily retrieve, update, and synchronize data between your ESP32 and the Supabase.io Realtime Database.
6+
To get started, simply include the library in your Arduino IDE and follow the provided documentation to establish a connection with Supabase.io. Once connected, you can easily retrieve, update, and synchronize data between your Arduino and the Supabase.io Realtime Database.
77

88
With the Arduino Nano ESP32 library, you can unlock the full potential of Supabase.io's Realtime Database and build IoT applications that seamlessly interact with cloud-based data. Start building your next project today!
99
---
@@ -12,9 +12,9 @@ At the moment installation has to be done manually either on a global level (*li
1212
The library will be soon available also from the Arduino IDE.
1313

1414
For the time being when including it you'll have to go with
15-
```#include "SupabaseESP32.h"```
15+
```#include "SupabaseArduino.h"```
1616

17-
#### Usage
17+
#### ESP32 Usage
1818
In order to setup the library you need to pass the following data.
1919
Please note that those data are available from you supabase database settings under the API tab (https://supabase.com/dashboard/project/PROJECT-CODE/settings/api).
2020
```
@@ -46,4 +46,7 @@ After that line of code, you can use three different method in order to interact
4646
supabaseClient.insert(column, value);
4747
```
4848

49+
#### RP2040 Usage
50+
Coming soon...
51+
4952
Under the examples you can find a .ino file that includes all the mentioned functions working.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <SupabaseArduino.h>
2+
3+
#define SSID "FabulousNet"
4+
#define PASSWORD "25jan2022"
5+
6+
#define URL "https://mwezguicqnnqaoolfnjr.supabase.co"
7+
#define APIKEY "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im13ZXpndWljcW5ucWFvb2xmbmpyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDk2MzA1MDUsImV4cCI6MjAyNTIwNjUwNX0.B9QVLOD3uP9MUPRqf64_VqSFmRV78FTRa89kdk3mGps"
8+
#define TABLE "Speed"
9+
10+
void setup() {
11+
// put your setup code here, to run once:
12+
Supabase supabase(SSID, PASSWORD, URL, APIKEY, TABLE);
13+
14+
supabase.begin();
15+
supabase.read();
16+
17+
delay(500);
18+
supabase.update(1, "velocity", 234.57);
19+
supabase.update(1, "distance", 12.48);
20+
21+
delay(500);
22+
supabase.read();
23+
}
24+
25+
void loop() {
26+
// put your main code here, to run repeatedly:
27+
28+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <SupabaseArduino.h>
2+
3+
const char* SSID = "FabulousNet";
4+
const char* PASSWORD = "25jan2022";
5+
6+
const char* URL = "mwezguicqnnqaoolfnjr.supabase.co";
7+
const char* APIKEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im13ZXpndWljcW5ucWFvb2xmbmpyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDk2MzA1MDUsImV4cCI6MjAyNTIwNjUwNX0.B9QVLOD3uP9MUPRqf64_VqSFmRV78FTRa89kdk3mGps";
8+
const char* BEARER = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im13ZXpndWljcW5ucWFvb2xmbmpyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDk2MzA1MDUsImV4cCI6MjAyNTIwNjUwNX0.B9QVLOD3uP9MUPRqf64_VqSFmRV78FTRa89kdk3mGps";
9+
10+
void setup() {
11+
// put your setup code here, to run once:
12+
Supabase supabase(SSID, PASSWORD, URL, APIKEY, BEARER);
13+
14+
supabase.begin();
15+
supabase.read();
16+
}
17+
18+
void loop() {
19+
// put your main code here, to run repeatedly:
20+
21+
}

examples/SupabaseESP32_Demo/SupabaseESP32_Demo.ino

Lines changed: 0 additions & 60 deletions
This file was deleted.

library.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "Supabase ESP32 Connection",
2+
"name": "SupabaseArduino",
33
"keywords": "supabase, arduino, realtime database, database, IoT",
4-
"description": "A library to connect to Supabase's Realtime Database from an ESP32 in realtime with API Key authentication.",
4+
"description": "A library to connect to Supabase's Realtime Database from an Arduino in realtime with API Key authentication.",
55
"repository":
66
{
77
"type": "git",
8-
"url": "https://github.com/zumatt/Supabase-ESP32"
8+
"url": "https://github.com/zumatt/Supabase-Arduino"
99
},
1010
"authors":
1111
[
@@ -19,8 +19,7 @@
1919
"dependencies":
2020
{
2121
},
22-
"version": "1.0.1",
22+
"version": "1.0.2",
2323
"frameworks": "arduino",
24-
"platforms": "espressif32",
2524
"examples": "examples/*/*.ino"
2625
}

library.properties

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name=Supabase-ESP32
2-
version=1.0.1
1+
name=Connect Arduino-Supabase
2+
version=1.0.2
33
author=Matteo Subet
44
maintainer=Matteo Subet https://github.com/zumatt
5-
sentence=Arduino Library to communicate with Supabase.io
6-
paragraph=Arduino Library to communicate with Supabase.io. The possible functions are the following: -insert -update -read
5+
sentence=Arduino Library to communicate with Supabase.io
6+
paragraph=This library allows you to communicate with the real-time database using an ESP32 or RP2040 Connect.
77
category=Communication
8-
url=https://github.com/zumatt/Supabase-ESP32
9-
includes=WiFi.h, HTTPClient.h
8+
url=https://github.com/zumatt/Supabase-Arduino
9+
architectures=*
10+
depends= WiFiNINA, ArduinoHttpClient

src/SupabaseArduino.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <SupabaseArduino.h>

src/SupabaseArduino.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
**************************************************
3+
*
4+
* @file SupabaseArduino.h
5+
* @brief Basic funtions for connecting supabase with Arduino
6+
*
7+
* https://github.com/zumatt/Supabase-Arduino
8+
*
9+
* Created based on the library https://github.com/clock27-lab/unofficial-esp32-supabase
10+
*
11+
* MIT License
12+
*
13+
* Copyright (c) 2024 Matteo Subet
14+
*
15+
* Permission is hereby granted, free of charge, to any person obtaining a copy
16+
* of this software and associated documentation files (the "Software"), to deal
17+
* in the Software without restriction, including without limitation the rights
18+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19+
* copies of the Software, and to permit persons to whom the Software is
20+
* furnished to do so, subject to the following conditions:
21+
*
22+
* The above copyright notice and this permission notice shall be included in all
23+
* copies or substantial portions of the Software.
24+
*
25+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31+
* SOFTWARE.
32+
*
33+
* @authors Matteo Subet https://github.com/zumatt/
34+
***************************************************/
35+
36+
#if defined(ARDUINO_NANO_ESP32)
37+
#include <boards/SupabaseESP32.h>
38+
#elif defined(ARDUINO_NANO_RP2040_CONNECT)
39+
#include <boards/SupabaseNanoRP2040.h>
40+
#else
41+
#error "Unsupported board selected!"
42+
#endif

src/SupabaseESP32.cpp

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/SupabaseESP32.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)