diff --git a/arduino/LoRaLed/LoRaLed.ino b/arduino/LoRaLed/LoRaLed.ino new file mode 100644 index 0000000..f09aa74 --- /dev/null +++ b/arduino/LoRaLed/LoRaLed.ino @@ -0,0 +1,55 @@ +#include +#include + +#define LORA_SS_PIN 10 +#define LORA_RST_PIN 9 +#define LORA_DI0_PIN 2 + +void setup() { + Serial.begin(9600); + while (!Serial); + + pinMode(LED_BUILTIN, OUTPUT); + + // Initialize LoRa module + LoRa.setPins(LORA_SS_PIN, LORA_RST_PIN, LORA_DI0_PIN); + if (!LoRa.begin(433E6)) { + Serial.println("LoRa initialization failed. Check your wiring!"); + while (true); + } + + // Connect to WiFi or Ethernet here + + // Connect to Socket.IO server + // Replace with the actual server address + // e.g., http://localhost:3000 + // Replace with an authentication token if required + // e.g., "?token=abcd1234" + //socketIO.connect(""); +} + +void loop() { + // Handle Socket.IO events or other tasks here + + // Check for incoming LoRa messages + int packetSize = LoRa.parsePacket(); + if (packetSize) { + while (LoRa.available()) { + String message = LoRa.readString(); + Serial.println("Received message: " + message); + + // Process the received message and control the LED + if (message == "led_on") { + digitalWrite(LED_BUILTIN, HIGH); // Turn on the LED + LoRa.beginPacket(); + LoRa.print("ack"); + LoRa.endPacket(); + } else if (message == "led_off") { + digitalWrite(LED_BUILTIN, LOW); // Turn off the LED + LoRa.beginPacket(); + LoRa.print("ack"); + LoRa.endPacket(); + } + } + } +} diff --git "a/public/ index.html" "b/public/ index.html" deleted file mode 100644 index 317430d..0000000 --- "a/public/ index.html" +++ /dev/null @@ -1,405 +0,0 @@ - - - - 868mhz.net - - - - - - - - - - - - - - - - -
-
-
-
- -

>>> PORT:

-
- -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-

-
-
- ↪ log -
-
-

OBJECTIVE:
Enter S/ash Gallery to step into the game and unlock gateway 1. Tap the different markers on the map in order to navigate and receive objectives. When set to the right digit, the modules in the locations will reveal a port number. Enter it above to collect dream logs. Follow the blue markers on the pavement to make your way through the landmarks.

-
- -
-

LOG 1 03:02:00 02-04-22 PORT: 9.1.13.

-
-
-

LOG 2 02:42:00 13-04-22 PORT: 16.18.15.

-
-
-

LOG 3 03:36:00 25-04-22 PORT: 20.5.3.

-
-
-

LOG 4 03:86:00 07-05-22 PORT: 20.15.18

-
-
-

LOG 5 06:86:00 17-05-22 PORT: 868

-
- -
-

- -
-
- ↪ -
- -
- - - -
- - - -
- - -
- -
- - - - - - - - - diff --git a/public/index.html b/public/index.html index a9782f1..2a0dc06 100644 --- a/public/index.html +++ b/public/index.html @@ -18,9 +18,11 @@ // Split the data into separate parts const [node, value] = data.split(' '); - if (node === 'node3' && value === '15'){ - document.body.style.backgroundColor = 'red';} - else { + + if (node === 'node3' && value === '15') { + // Change the background color to red + document.body.style.backgroundColor = 'red'; + } else { // Restore the default background color document.body.style.backgroundColor = 'white'; }